QMInstructionProperties

class QMInstructionProperties(duration=None, error=None, qua_pulse_macro=None, quam_macro=None, *args, **kwargs)[source][source]

Bases: InstructionProperties

Qiskit instruction properties enriched with a QUA pulse macro.

qua_pulse_macro accepts two forms:

  • A QuamMacro instance – a structured QuAM component whose attributes (duration, fidelity, pulse, …) are declared following the QuAM documentation. When this form is used, duration and error are 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 duration and error must be supplied explicitly if they are needed.

The two forms are transparently unified through the qua_pulse_macro and quam_macro properties.

Create a new QMInstructionProperties.

Parameters:
  • duration – Gate duration in seconds. Inferred from qua_pulse_macro when a QuamMacro is provided and this is left as None.

  • error – Gate error rate. Inferred as 1 - fidelity from a QuamMacro when left as None.

  • qua_pulse_macro – Either a QuamMacro (structured QuAM component with declarative attributes) or a plain callable (bare QUA macro function).

  • quam_macro – Explicit QuamMacro input. When both quam_macro and qua_pulse_macro are supplied, quam_macro takes priority and qua_pulse_macro is ignored.

property qua_pulse_macro: Callable | None

The QUA macro as a callable.

If the underlying object is a QuamMacro, its .apply method 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, or None.

Returns the original QuamMacro instance when one was provided, giving access to its full attribute set (duration, fidelity, pulse, etc.). Returns None when the macro was supplied as a plain callable.