question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transpiler removes resets at beginning of circuits unless level=0

See original GitHub issue

Information

  • 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')

image

becomes:


backend = FakeCasablanca()
trans_qc = transpile(qc, backend)
trans_qc.draw('mpl')

image

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:open
  • Created 2 years ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
taalexandercommented, Apr 26, 2022

I can confirm that this is still an open issue, especially for our QASM3 support which currently does not initialize the qubits by default.

0reactions
ajavadiacommented, Apr 26, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found