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:
OperationQrisp 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
Operationclass but does not provide adefinition(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 inparam_names. The IQM Pulse converter uses these names to reconstruct the dictionary argument required byQuantumOp.__init__().- Parameters:
quantum_op (QuantumOp) – IQM Pulse quantum operation definition. This object is expected to contain the concrete parameter values in its
paramsattribute and the concrete qubit count in itsarityattribute.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 abstract (symbolic) parameters to concrete values.
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_dictwith the resolved values. Only dynamic (JAX-compatible) parameters are substituted; static parameters are preserved unchanged.
Inheritance
