CompositeGate#
- class iqm.pulse.gate_implementation.CompositeGate(parent, name, locus, calibration_data, builder)#
Bases:
GateImplementationBase class for gate implementations that are defined in terms of other gate implementations.
Composite gates can be implemented using other pre-existing gate implementations (called its member gates) by using
build()in the_call()method. You should not callScheduleBuilder.get_implementation()directly in composite gate code.A CompositeGate subclass needs to declare what its member gates are, e.g. to be able to verify that they are calibrated, using the
registered_gatesclass attribute.It is possibe to calibrate (some of) the member gates separately from the common calibration, by listing their names in
customizable_gatesclass attribute. However, if no custom calibration data is provided, the composite gate will use the common calibration for the member operations.Note
CompositeGate.needs_calibration()only tells whether the implementation class itself needs calibration data, not whether the member gates need some.Module:
iqm.pulse.gate_implementationAttributes
These member operations can be calibrated separately from their common calibration by adding
OCalibrationDatanodes for them under theOILCalibrationDatanode of the composite gate.Mapping from member operation names to the designated default implementation of that operation.
Names of the member operations used by the composite gate.
idUnique str identifier, needed for certain caching properties.
sub_implementationsSingle-component sub-implementations for factorizable gates with len(locus) > 1, otherwise empty.
Methods
Construct an implementation for a member (registered) gate.
Optional calibration data keys for this class, in addition to the required items in
parameters.- Parameters:
parent (QuantumOp)
name (str)
locus (Locus)
calibration_data (OILCalibrationData)
builder (ScheduleBuilder)
- registered_gates: tuple[str, ...] = ()#
Names of the member operations used by the composite gate. There must be corresponding keys in
builder.op_table.
- customizable_gates: tuple[str, ...] | None = None#
These member operations can be calibrated separately from their common calibration by adding
OCalibrationDatanodes for them under theOILCalibrationDatanode of the composite gate. Must be a subset ofregistered_gates. By default all member operations are customizable.
- default_implementations: dict[str, str] = {}#
Mapping from member operation names to the designated default implementation of that operation. Filling this attribute allows one to define a different default implementation from the common default in
builder.op_tableto be used in the context of this composite gate. If a member operation is not found in this dict as a key, the CompositeGate will use the common default as its default implementation.
- classmethod optional_calibration_keys()#
Optional calibration data keys for this class, in addition to the required items in
parameters.These keys are not required to be present in
OILCalibrationDatawhen validating it.
- build(op_name, locus, impl_name=None, *, strict_locus=False, priority_calibration=None)#
Construct an implementation for a member (registered) gate.
A custom calibration for
op_namewill be sought incalibration_data. If any calibration parameters are found, they override the corresponding parameters in the common calibration data.- Parameters:
op_name (str) – member operation name
impl_name (str | None) – Implementation name. If not given, uses the default implementation defined in the class instance if any, and otherwise the common default in
builder.op_table.strict_locus (bool) – iff False, for non-symmetric implementations of symmetric ops the locus order may be changed if no calibration data is available for the requested locus order
priority_calibration (dict[str, Any] | None) – If given, overrides the custom calibration for the member gate. Deprecated, should not be used.
- Returns:
Calibrated member gate implementation.
- Return type: