-
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
Incorrect Simulation Results #13116
Comments
Seems like the issue is specific to statevector simulation methods. Running the same script for the |
Hmm I can't reproduce this using either of |
I am running the same version of qiskit-aer and qiskit ! |
Hmm interesting. If you change the code to run on Qiskit's from qiskit.quantum_info import Statevector
# your code....
qc.csx(0,1).inverse()
qc.swap(0,2)
qc.id(1)
# no measurements!
# qc.measure_all()
for i in range(4):
pass_manager=generate_preset_pass_manager(backend=backend, optimization_level=i)
transpiled_circuit = pass_manager.run(qc)
results = Statevector(transpiled_circuit).probabilities_dict(decimals=6)
print(f"Optimisation Level: {i}, Results: {results}") |
These are the results: Optimisation Level: 0, Results: {np.str_('110'): np.float64(1.0)}
Optimisation Level: 1, Results: {np.str_('110'): np.float64(1.0)}
Optimisation Level: 2, Results: {np.str_('100'): np.float64(1.0)}
Optimisation Level: 3, Results: {np.str_('100'): np.float64(1.0)} |
The problem was reproducable on Qiskit 1.2.0, but disappears on 1.2.1 (I also tried on an M2 mac). This was likely a bug with the |
@Cryoris Can i know why this issue was specific to optimisation level 2 or 3 ? |
The issue with the CU3Gate/CUGate (#13121) would only occur when we ran |
@Cryoris But, why did it giving correct output in some runs and incorrect output in some results ? |
The transpiler has stochastic components to it, so unless you set the I'll close the issue now since it appears to have been fixed in 1.2.1, but feel free to re-open if there's more to discuss. |
Environment
What is happening?
The following circuit is expected to provide a 110 as dominant state. But it is resulting in state 100 for all shots randomly for optimisation level 2 and 3. The issue could possibly be in the transpilation of the circuit.
How can we reproduce the issue?
What should happen?
Running the script for 1st time provides correct results
But running the scirpt for the 3rd time gave me the following result:
But running the same result on Qiskit 1.1.0 is working properly.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: