Open nkanazawa1989 opened 1 year ago
Oh, this is a big oversight in the constructor method, you're right from_configuration
completely overlooks that in the old data model measure
was implicitly available on all qubits. We need to be adding measure
by default to the output Target
in all cases when from_configuration
is used.
@nkanazawa1989 , can I try solving this issue?
I have got permission to work on this issue, so I am currently working on this issue :)
Environment
What is happening?
When we create
Target
from the legacy models withTarget.from_configuration
, it doesn't work with circuit scheduler.How can we reproduce the issue?
A factory method
Target.from_configuration
introduced in 0.24 doesn't handle measurement instructions properly. This method only creates instruction entries for basis gates, however, IBM backends don't contain "measure" in the basis gates.This causes a bug in the circuit scheduler chain.
The last line raises
because of the missing measure instruction. Even if we manually add "measure" to the basis gates, scheduler chain doesn't work because the factory method only checks the gate length property, i.e. "measure" duration is separately provided from gate length in IBM Provider model.
https://github.com/Qiskit/qiskit-terra/blob/5013fe2239290414f2cfaafae13c6a9c09ddbbda/qiskit/transpiler/target.py#L1362
What should happen?
Target should have filled
InstructionProperties
for measure instructions.Any suggestions?
The logic I implemented for IBM Provider is robust to missing operations in basis gates.
https://github.com/Qiskit/qiskit-ibm-provider/pull/413