Transpiler error during execution of circuits with dynamical decoupling on real backends
See original GitHub issueEnvironment
‘qiskit-terra’: ‘0.18.3’, ‘qiskit-aer’: ‘0.9.1’, ‘qiskit-ignis’: ‘0.6.0’, ‘qiskit-ibmq-provider’: ‘0.18.1’, ‘qiskit-aqua’: ‘0.9.5’, ‘qiskit’: ‘0.32.1’, ‘qiskit-nature’: None, ‘qiskit-finance’: None, ‘qiskit-optimization’: None, ‘qiskit-machine-learning’: None}
What is happening?
A Transpiler Error occurs when executing circuits with dynamical coupling on real backends:
TranspilerError: "This circuit None may involve a delay instruction violating the pulse controller alignment. To adjust instructions to right timing, you should call one of scheduling passes first. This is usually done by calling transpiler with scheduling_method='alap'."
Whether or not these errors occur to be dependent on the type of circuit. For instance, the following circuit executes without errors:
But the same test circuit FAILS after adding one extra hadamard on qubit 0: .
Commenting out the hadmard on qubit 0 will allow the circuit to execute without errors. Changing to backend = FakeMumbai()
also executes without errors. Changing optimization level =1
to other levels makes no difference.
Code fails on multiple real devices (not just IBM mumbai).
How can we reproduce the issue?
The code below
from qiskit.transpiler import PassManager, InstructionDurations
from qiskit.transpiler.passes import ALAPSchedule, DynamicalDecoupling
from qiskit.circuit.library import XGate
from qiskit import QuantumCircuit, transpile, execute, IBMQ
IBMQ.load_account()
provider = IBMQ.get_provider(hub='ibm-q-internal' , group='performance', project='demos')
realbackend = provider.get_backend('ibmq_mumbai')
circ = QuantumCircuit(4)
circ.cx(0, 1)
circ.cx(2, 3)
circ.h(0) # comment out to run without errors
circ.cx(1, 2)
circ.measure_all()
circ_t = transpile(circ, backend=realbackend,scheduling_method="alap")
dd_sequence = [XGate()] * 2
spacing = []
durations = InstructionDurations.from_backend(realbackend)
pm = PassManager([ALAPSchedule(durations),
DynamicalDecoupling(durations, dd_sequence, qubits=None, spacing=None)])
circuits = pm.run(circ_t)
job = execute(circuits, realbackend, shots=10)
fails with error:
TranspilerError: "This circuit None may involve a delay instruction violating the pulse controller alignment. To adjust instructions to right timing, you should call one of scheduling passes first. This is usually done by calling transpiler with scheduling_method='alap'."
What should happen?
Code should execute without Transpile errors irrespective of the type of circuit.
Any suggestions?
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (7 by maintainers)
Top GitHub Comments
Yes, this actually involves the refactoring of the whole framework in addition to the DD pass. I have updated the behavior of scheduling pass in #7655, and current stage is #7709 which upgrades scheduler pass and introduces
BasePadding
class which will be new base class of dynamical decoupling pass. Then, DD pass will be upgraded to consider the pulse alignment. Hopefully I can get reviews soon.The best (or temporarily) solution for now would be asking the DD pass to check the constraints and insert delays that conform to the pulse alignment constraints. @ajavadia