-
Notifications
You must be signed in to change notification settings - Fork 12
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: improve implicit qubit permutations warning #421
Conversation
tests/qiskit_convert_test.py
Outdated
with pytest.warns(UserWarning, match="The pytket Circuit contains implicit qubit"): | ||
tk_to_qiskit(c) | ||
|
||
state_backend = AerStateBackend() |
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 wrote this test without the flag added to ensure that it failed.
The warning only appears for AerBackend
and not AerStateBackend
. I would've expected both to generate a warning (i.e. record
to be of length 2)
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.
Ah its because the state and unitary backends replace implicit swaps with SWAP gates whereas AerBackend
does not.
@@ -194,7 +194,7 @@ Every {py:class}`~pytket.backends.backend.Backend` in pytket has its own {py:met | |||
2 preserve barriers in a circuit, while optimisation level 3 will remove them. | |||
|
|||
:::{list-table} **Default compilation pass for the IBMQBackend and IBMQEmulatorBackend** | |||
:widths: 25 25 25 | |||
:widths: 25 25 25 25 |
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 fixes an error due to an invalid number of columns
Sorry for commit spam. I think the linting settings were broken in my IDE. |
@@ -286,6 +286,7 @@ def process_circuits( | |||
circuit_batches, batch_order = _batch_circuits(circuits, n_shots_list) | |||
|
|||
replace_implicit_swaps = self.supports_state or self.supports_unitary | |||
perm_warning = False |
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.
No need to define a variable, it's only used once.
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.
Fair enough. Done dd6e973
Co-authored-by: Alec Edgington <[email protected]>
Co-authored-by: Alec Edgington <[email protected]>
Description
Added the change from #412 back in again with a boolean flag to ensure that unhelpful warnings aren't generated when using
AerBackend
with optimisation level 2See discusssion in #411
Driveby: fix invalid table of compilation passes (see df0cda3)
Related issues
closes #411
Checklist