QMInstructionProperties¶
- class QMInstructionProperties(duration=None, error=None, qua_pulse_macro=None, quam_macro=None, fidelity_dict=None, *args, **kwargs)[source][source]¶
Bases:
InstructionPropertiesQiskit instruction properties enriched with a QUA pulse macro.
qua_pulse_macroaccepts two forms:A
QuamMacroinstance – a structured QuAM component whose attributes (duration,fidelity,pulse, …) are declared following the QuAM documentation. When this form is used,durationanderrorare automatically inferred from the macro’s attributes unless explicitly provided.A plain callable – a bare QUA macro function with no QuAM attributes. In this case
durationanderrormust be supplied explicitly if they are needed.
The two forms are transparently unified through the
qua_pulse_macroandquam_macroproperties.Two-qubit QuAM macros often store
fidelityas a mapping of benchmark names rather than a single float. That mapping is exposed asfidelity_dictand is not converted into a scalarerror(the RustInstructionPropertiesbase still only storesdurationanderror).propertiesis a display mapping used byqiskit.transpiler.Target.__str__()on Qiskit versions that print extra properties; eachfidelity_dictentry is unrolled as its own extra-property key.Create a new
QMInstructionProperties.- Parameters:
duration – Gate duration in seconds. Inferred from
qua_pulse_macrowhen aQuamMacrois provided and this is left asNone.error – Gate error rate. Inferred as
1 - fidelityfrom aQuamMacrowhenfidelityis a scalar and this is left asNone. Mapping fidelities do not seterror.qua_pulse_macro – Either a
QuamMacro(structured QuAM component with declarative attributes) or a plain callable (bare QUA macro function).quam_macro – Explicit
QuamMacroinput. When bothquam_macroandqua_pulse_macroare supplied,quam_macrotakes priority andqua_pulse_macrois ignored.fidelity_dict – Explicit multi-benchmark fidelity map. Used only when there is no macro, or the macro’s
fidelityis not a mapping. A mapping on the live macro always wins.
- property qua_pulse_macro: Callable | None¶
The QUA macro as a callable.
If the underlying object is a
QuamMacro, its.applymethod is returned so that callers always receive a uniform callable interface. For a plain callable, it is returned as-is.
- property quam_macro: QuamMacro | None¶
The underlying
QuamMacro, orNone.Returns the original
QuamMacroinstance when one was provided, giving access to its full attribute set (duration,fidelity,pulse, etc.). ReturnsNonewhen the macro was supplied as a plain callable.
- property fidelity_dict: dict | None¶
Benchmark-name mapping from the live macro, or an explicit constructor value.
Returns
Nonewhen neither a mappingfidelityon the macro nor an explicitfidelity_dictwas provided. An empty mapping (typical of an uncalibrated two-qubit gate) is returned as{}.
- property properties: dict | None¶
Display mapping for
qiskit.transpiler.Target.__str__().Includes a compact
quam_macro/qua_pulse_macrostring, then each non-emptyfidelity_dictentry as its own key (soprint(target)lists benchmarks such asrbandxebrather than a nested dict). ReturnsNonewhen there is nothing to print, so the Target omits the extra-properties block.