-
Notifications
You must be signed in to change notification settings - Fork 370
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 param positions for circuits with conditionals #1851
Conversation
I can confirm this solves #1849 so I think after adding a test it can be merged |
@@ -441,22 +461,28 @@ def test_check_parameter_binds_exist(self): | |||
|
|||
def test_global_phase_parameters(self): | |||
"""Test parameterized global phase""" | |||
backend = AerSimulator() | |||
backend = AerSimulator(method="extended_stabilizer") |
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.
Is it enough only testing extended_stabilizer
?
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.
Yes. We do not know practical cases to use parameterized global phases without extended_stabilizer
. From the implementation perspective, parameters for global phases are resolved in common part for any methods.
* fix parameter indexing issues. * fix issues in parameterization of global phase * add reno * fix lint * fix release note * fix a bug to call _convert_circuit_binds * add test
* bump version strings and prepare for release * Remove `AerCircuit` from result of `backend.run()` (#1845) * take AerCircuit from _metadata in experiment result * add reno * Fix rST formatting --------- Co-authored-by: Jake Lishman <[email protected]> * pin numpy version lower than 1.25 (#1859) * Fix param positions for circuits with conditionals (#1851) * fix parameter indexing issues. * fix issues in parameterization of global phase * add reno * fix lint * fix release note * fix a bug to call _convert_circuit_binds * add test * Support save_statevector for QuantumCircuit from QASM3 string (#1846) * Support save_statevector for QuantumCircuit from QASM3 string * add qiskit_qasm3_import to requirements-dev.txt * simplify default_qubits() * fix lint error * skip qasm3 circuit test in 3.7 * New GPU binaries with cuQuantum support (#1854) * New GPU binaries with cuQuantum support * format setup.py * remove testpipy settings * Update setup.py to use numpy with version lower than 1.25 * changed package names, qiskit-aer-gpu for CUDA12, and qiskit-aer-gpu-cu11 for 11 * format setup.py * Update README.md Co-authored-by: Matthew Treinish <[email protected]> * Update releasenotes/notes/renew_gpu_binaries-2cf3eba0853b8407.yaml Co-authored-by: Matthew Treinish <[email protected]> * update release note --------- Co-authored-by: Hiroshi Horii <[email protected]> Co-authored-by: Matthew Treinish <[email protected]> * bump up python version from 3.7 to 3.8 to run cibuildwheel (#1867) * bump up python version from 3.7 to 3.8 to run cibuildwheel * bump up all python version in deploy workflow * add reno * set numpy version constraint only in dev (#1871) * add numpy version constraint only in dev * set numpy version constraint in contraints.txt * bump up version in docs --------- Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: Jun Doi <[email protected]> Co-authored-by: Matthew Treinish <[email protected]>
Summary
Resolve #1849
Details and comments
When conditional gates exist, parameter positions are changed because
bfunc
operations are injected.It is the root cause of #1849 that reports wrong parameter bindings with circuits that have conditional gates.
With this PR, positions of Qiskit instructions and Aer operations are mapped and Aer's parameter bindings are based on this mapping.
Also this PR fixes a bug in parameterization of global phases, which was introduced in #1814. Its implementation was not correct and a test was not enough.