Closed anedumla closed 11 months ago
Is the number 16 particular to IBM hardware? If so, we probably need to solve this in a slightly more general way, with a user- or backend-defined alignment.
I am not the right person to ask about this, maybe @eggerdj knows.
16 is indeed specific to IBM hardware. Other hardware may use different multiples. We should avoid hard-coding multiples of 16, instead this should come from a configuration.
@jakelishman We can solve this in a backend oriented way since the 16-sample granularity is available in the configuration. For example,
backend.configuration().timing_constraints
gives:
{'acquire_alignment': 16,
'granularity': 16,
'min_length': 64,
'pulse_alignment': 1}
One question to consider, should this de done in the DD pass or is there some other pass that I am not aware of that tries to satisfy such timing constraints.
There is a separate pass to align with backend specified timing constraints: https://github.com/Qiskit/qiskit-terra/blob/main/qiskit/transpiler/passes/scheduling/instruction_alignment.py Can you try integrating that into your custom passmanager with dd as I expect it to solve the issue if it's run after dd.
This is satisfied both by the pass that Matthew linked, and also in the dynamical decoupling pass by setting (..pulse_alignment=backend.target.pulse_alignment).. So I think this can be marked as resolved.
Environment
What is happening?
When running
PassManager
withDynamicalDecoupling
the sequence of delays returned are not always multiple of 16 and the resulting circuit cannot be run on real hardware.How can we reproduce the issue?
Printing the values of the DynamicalDecoupling class gives:
What should happen?
The taus should all be multiples of 16.
Any suggestions?
From DynamicalDecoupling:
Even if
slack
is a multiple of 16, whenevera
is not an integer there is no assurance thatint(slack*a)
will also be a multiple of 16 (e.g. thea
's in the example above are not integers).