-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
QPy roundtripping discards physical qubit information on circuit #10112
Comments
mtreinish
added a commit
to mtreinish/qiskit-core
that referenced
this issue
May 23, 2023
This commit adds the missing support for QuantumCircuit.layout to the qpy format. This necessitates bumping the QPY format version to 8 to accomodate the extra data needed for representing the details of the layout. The tricky piece with representing the 3 TranspileLayout attributes is representing the virtual bits in the initial layout because there is no guarantee that the input circuit's registers are in the output circuit (typically they are not when transpile() is used). Fixes Qiskit#10112
4 tasks
blakejohnson
pushed a commit
to blakejohnson/qiskit-ibm-runtime
that referenced
this issue
May 26, 2023
* Add support for exporting qasm3. * Address issue in Qiskit/qiskit#10112
github-merge-queue bot
pushed a commit
that referenced
this issue
Jul 7, 2023
* Add support for QuantumCircuit.layout to qpy This commit adds the missing support for QuantumCircuit.layout to the qpy format. This necessitates bumping the QPY format version to 8 to accomodate the extra data needed for representing the details of the layout. The tricky piece with representing the 3 TranspileLayout attributes is representing the virtual bits in the initial layout because there is no guarantee that the input circuit's registers are in the output circuit (typically they are not when transpile() is used). Fixes #10112 * Fix handling of empty layout * Expand test coverage * Fix lint * Add qpy compat tests * Fix compat tests * Add release notes * Adjust layout creation to be register independent * Finish docs * Only check layout in compat tests with circuits * Fix typos * Fix doc typo in qiskit/qpy/__init__.py Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com> * Adjust introduction version for layout qpy compat tests * Unify qpy compat test version filter style * Add new line to layout error message * Simplify serialization logic Co-authored-by: Jake Lishman <jake.lishman@ibm.com> * Doc fixes * Improve test coverage * Don't reuse bits between initial layout and circuit in qpy compat tests. * Update qiskit/qpy/__init__.py * Fix test typo * Use a register in compat tests for consistent equality * Update test/python/qpy/test_circuit_load_from_qpy.py --------- Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com> Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
mergify bot
pushed a commit
that referenced
this issue
Jul 7, 2023
* Add support for QuantumCircuit.layout to qpy This commit adds the missing support for QuantumCircuit.layout to the qpy format. This necessitates bumping the QPY format version to 8 to accomodate the extra data needed for representing the details of the layout. The tricky piece with representing the 3 TranspileLayout attributes is representing the virtual bits in the initial layout because there is no guarantee that the input circuit's registers are in the output circuit (typically they are not when transpile() is used). Fixes #10112 * Fix handling of empty layout * Expand test coverage * Fix lint * Add qpy compat tests * Fix compat tests * Add release notes * Adjust layout creation to be register independent * Finish docs * Only check layout in compat tests with circuits * Fix typos * Fix doc typo in qiskit/qpy/__init__.py Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com> * Adjust introduction version for layout qpy compat tests * Unify qpy compat test version filter style * Add new line to layout error message * Simplify serialization logic Co-authored-by: Jake Lishman <jake.lishman@ibm.com> * Doc fixes * Improve test coverage * Don't reuse bits between initial layout and circuit in qpy compat tests. * Update qiskit/qpy/__init__.py * Fix test typo * Use a register in compat tests for consistent equality * Update test/python/qpy/test_circuit_load_from_qpy.py --------- Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com> Co-authored-by: Jake Lishman <jake.lishman@ibm.com> (cherry picked from commit dbf1230)
github-merge-queue bot
pushed a commit
that referenced
this issue
Jul 10, 2023
* Add support for QuantumCircuit.layout to qpy This commit adds the missing support for QuantumCircuit.layout to the qpy format. This necessitates bumping the QPY format version to 8 to accomodate the extra data needed for representing the details of the layout. The tricky piece with representing the 3 TranspileLayout attributes is representing the virtual bits in the initial layout because there is no guarantee that the input circuit's registers are in the output circuit (typically they are not when transpile() is used). Fixes #10112 * Fix handling of empty layout * Expand test coverage * Fix lint * Add qpy compat tests * Fix compat tests * Add release notes * Adjust layout creation to be register independent * Finish docs * Only check layout in compat tests with circuits * Fix typos * Fix doc typo in qiskit/qpy/__init__.py Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com> * Adjust introduction version for layout qpy compat tests * Unify qpy compat test version filter style * Add new line to layout error message * Simplify serialization logic Co-authored-by: Jake Lishman <jake.lishman@ibm.com> * Doc fixes * Improve test coverage * Don't reuse bits between initial layout and circuit in qpy compat tests. * Update qiskit/qpy/__init__.py * Fix test typo * Use a register in compat tests for consistent equality * Update test/python/qpy/test_circuit_load_from_qpy.py --------- Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com> Co-authored-by: Jake Lishman <jake.lishman@ibm.com> (cherry picked from commit dbf1230) Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
What is happening?
When roundtripping a transpiled circuit for a backend, and then dumping to OpenQASM 3 the circuit is no longer on physical qubits when emitted to OpenQASM 3. This impacts the backend when circuit merging is not applied.
How can we reproduce the issue?
Emits
What should happen?
Commenting out the QPy roundtripping
Gives
Any suggestions?
This may be fixed by setting the layout on roundtripping
The text was updated successfully, but these errors were encountered: