-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Initialize.gates_to_uncompute method #12976
Fix Initialize.gates_to_uncompute method #12976
Conversation
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 10465223853Details
💛 - Coveralls |
The CI failures should be fixed after #12979 will be merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very related to the comment below: StatePreparation
is a Gate
but currently contains an Instruction
(namely an Isometry
). We should update this such that a gate contains only other gates, e.g. by doing something like
def _define_synthesis_isom(self):
# ... previous code ...
# we know Isometry produces only Gate objects in this case,
# so we can directly compose it's definition
isom = Isometry(self._params_arg, 0, 0)
initialize_circuit.compose(isom.definition, inplace=True, copy=False)
Let's wait for @woodsp-ibm to confirm this is good, but this LGTM -- thanks for the updates! 🙂 Edit: I just saw #12969 (comment), so it's good to go 👍🏻 |
@Cryoris I had checked it yesterday and it was all good #12969 (comment) but I just rechecked it now and used both initializer and state_preparation files from here and it passes the finance tests so its all good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passes the Finance tests now - thx!
Thanks for double checking @woodsp-ibm! (and thanks for remembering the merge queue @alexanderivrii 😉) |
* add back files needed in Initialize.gates_to_uncompute() * add a test for Initialize.gates_to_uncompute() method * fix a comment * add release notes * update gates_to_uncompute such that it will call Isometry * remove unused imports * transfer code from StatePreparation to Initialize.gates_to_uncompute * update code following review (cherry picked from commit aa09a02)
* add back files needed in Initialize.gates_to_uncompute() * add a test for Initialize.gates_to_uncompute() method * fix a comment * add release notes * update gates_to_uncompute such that it will call Isometry * remove unused imports * transfer code from StatePreparation to Initialize.gates_to_uncompute * update code following review (cherry picked from commit aa09a02) Co-authored-by: Shelly Garion <[email protected]>
Summary
close #12969
Fix some code that has been removed in #12178, so that the
Initialize.gates_to_uncompute
method will not failDetails and comments
Initialize.gates_to_uncompute
is based onStatePreparation._gates_to_uncompute()
that now contains the inverse ofIsomtery
in order to make it more efficient