-
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
transpile ansatz and pauli-lists separately in VQE #6454
Changes from 22 commits
f4aec15
b065320
e02a061
6106e83
f00d82d
8948a8f
bab18b5
ce72422
a698c92
ee73ba9
d3b80d1
eba2bd4
16cf929
7b13a91
c65902a
d25c5c7
853d64d
3a160b3
535e0ee
951fd54
5e002a0
30b34c6
7418ac2
63dc784
410538e
6990e36
08b51c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,11 +123,11 @@ def _set_type_checked_item(self, virtual, physical): | |
|
||
def __delitem__(self, key): | ||
if isinstance(key, int): | ||
del self._p2v[key] | ||
del self._v2p[self._p2v[key]] | ||
del self._p2v[key] | ||
elif isinstance(key, Qubit): | ||
del self._v2p[key] | ||
del self._p2v[self._v2p[key]] | ||
del self._v2p[key] | ||
Comment on lines
-126
to
+130
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should probably not be touched There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not? This is clearly a bug, @hhorii found. This is necessary to execute our code. Should we separate the PR? |
||
else: | ||
raise LayoutError( | ||
"The key to remove should be of the form" | ||
|
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.
I suppose we need to set the "final" layout here, however,
_layout
stores the initial layout of the transpiled common circuit.Unfortunately, we have no simple way to get the final layout of a transpiled circuit so far.
The following could work (I know it's not smart. Does anyone think of any better idea?):
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.
Thank you. You are right. We assume
_layout
is the final layout.I have fixed the PR from your advice. Is this correct? 7418ac2
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.
I have shown how one can get the required final layout (permutation) here: #6827
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.
Thank you so much. It's really useful.