IQMPulseOperation#

Module: iqm.qrisp_iqm.pulse_operation

class iqm.qrisp_iqm.pulse_operation.IQMPulseOperation(quantum_op: QuantumOp, param_dict: dict[str, Any] | None = None, num_clbits: int = 0)#

Bases: Operation

Qrisp Operation that represents an IQM Pulse quantum operation.

This class allows users to insert specific IQM Pulse quantum operations (like barriers, delays, or custom gate implementations) directly into a Qrisp QuantumCircuit. These operations are treated as opaque boxes by the Qrisp transpiler, ensuring they survive the compilation process and reach the backend unchanged.

Mechanism for transpilation survival: Because IQMPulseOperation inherits from the base Operation class but does not provide a definition (decomposition into standard gates) or built-in QASM conversion, Qrisp’s transpilation passes generally ignore it. It passes through optimizations untouched, preserving its position in the circuit relative to other gates.

Parameter handling: Parameters are passed as a dictionary. Qrisp stores the values in params (required for any parameter optimization or bind logic). This class additionally stores parameter names in param_names. The IQM Pulse converter uses these names to reconstruct the dictionary argument required by QuantumOp.__init__().

Parameters:
  • quantum_op (QuantumOp) – IQM Pulse quantum operation definition. This object is expected to contain the concrete parameter values in its params attribute and the concrete qubit count in its arity attribute.

  • param_dict (dict[str, Any] | None) – Dictionary of parameter name-value pairs. Must match the QuantumOp’s params.

  • num_clbits (int) – Number of classical bits the operation uses.

Examples

Create a delay operation and embed it in a Qrisp circuit:

from iqm.pulse.quantum_ops import QuantumOp
from iqm.pulse.gates.delay import Delay
from iqm.qrisp_iqm import IQMPulseOperation
from qrisp import QuantumCircuit

# Build the delay QuantumOp from the IQM SDK primitives
delay_quantum_op = QuantumOp(
    name="delay",
    arity=1,
    params={"duration": (float,)},
    implementations={"wait": Delay},
    symmetric=True,
)

# Wrap it in a Qrisp-compatible operation with a 100 ns duration
pulse_op = IQMPulseOperation(
    delay_quantum_op,
    param_dict={"duration": 100e-9},
)

# Insert into a Qrisp circuit — the delay survives transpilation
qc = QuantumCircuit(2)
qc.cz(0, 1)
qc.append(pulse_op, [qc.qubits[0]])

Methods

bind_parameters

Bind abstract (symbolic) parameters to concrete values.

get_unitary

Returns the unitary matrix representation of the operation.

bind_parameters(subs_dict: dict[Any, Any]) Self#

Bind abstract (symbolic) parameters to concrete values.

Extends the base Operation.bind_parameters to also update param_dict with the resolved values. Only dynamic (JAX-compatible) parameters are substituted; static parameters are preserved unchanged.

Parameters:

subs_dict (dict[Any, Any])

Return type:

Self

get_unitary(decimals: int = -1) ndarray#

Returns the unitary matrix representation of the operation.

Raises:

ValueError – If the operation has no defined unitary.

Parameters:

decimals (int)

Return type:

ndarray

Inheritance

Inheritance diagram of iqm.qrisp_iqm.pulse_operation.IQMPulseOperation