Transpiler removes resets at beginning of circuits unless level=0
See original GitHub issueInformation
- Qiskit Terra version: latest
- Python version:
- Operating system:
What is the current behavior?
qc = QuantumCircuit(5, 4)
qc.reset(range(5))
qc.x(4)
qc.h(range(5))
qc.cx(range(4), 4)
qc.draw()
qc.h(range(4))
qc.barrier()
qc.measure(range(4), range(4))
qc.draw('mpl')
becomes:
backend = FakeCasablanca()
trans_qc = transpile(qc, backend)
trans_qc.draw('mpl')
Steps to reproduce the problem
Run above at optimization levels 1->3.
What is the expected behavior?
If the user explicitly puts resets at the beginning of a circuit they should remain there. This is important as the unconditional reset done by default on IBM Quantum systems is not perfect, leading to state prep errors. Adding a reset at the beginning of a circuit greatly suppresses these errors and is needed to get high-fidelity results.
Suggested solutions
Do not remove resets at the beginning of circuits. i.e. do not run this RemoveResetInZeroState
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Executing Experiments ( qiskit.execute_function )
Transpiler options are automatically grabbed from backend.configuration() and backend.properties(). If any other option is explicitly set (e.g. coupling_map), ...
Read more >How to not optimize the quantum gates in a qiskit circuit when ...
1 Answer 1. Sorted by: Reset to default. Highest score (default) ...
Read more >Release News: Qiskit v0.39.0 is Here! | by Abby Mitchell
Transpiler passes (optimization level 0 and 1) now support dynamic circuits. ... Qiskit Aer has been moved to a new namespace in preparation...
Read more >A Novel Compiler Optimization for Quantum Circuits - arXiv
are implemented in the IBM's Qiskit transpiler. Our experimental ... lows [3]: Level 0 maps the circuit to the quantum device,.
Read more >Circuit Sessions with Kevin Krsulich - YouTube
Topic: Transpiling Quantum CircuitsJoin us, as we explore the value and use of quantum circuits in our new livestream public lecture series, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm that this is still an open issue, especially for our QASM3 support which currently does not initialize the qubits by default.
let’s just remove the
RemoveResetInZeroState
pass. It’s kind of pointless I think. I think what it’s doing is valid but don’t see much use for it.