iqm.pulse.gates.register_implementation

iqm.pulse.gates.register_implementation#

iqm.pulse.gates.register_implementation(operations, gate_name, impl_name, impl_class, set_as_default=False, overwrite=False, quantum_op_specs=None)#

Register a new gate implementation, and a new gate if needed.

TODO: split the method for adding a new gate implementation and a new gate + implementation

Parameters:
  • operations (dict[str, QuantumOp]) – Known operations, mapping gate names to QuantumOps. A new QuantumOp is inserted here.

  • gate_name (str) – The gate name for which to register a new implementation.

  • impl_name (str) – The “human-readable” name with which the new gate implementation will be found e.g. in settings.

  • impl_class (type[GateImplementation]) – The python class of the new gate implementation to be addded.

  • set_as_default (bool) – Whether to set the new implementation as the default implementation for the gate.

  • overwrite (bool) – If True, allows replacing any existing implementation of the same name.

  • quantum_op_specs (QuantumOp | dict | None) – The quantum operation this gate represents. If a QuantumOp is given, it is used as is. If None is given and the same gate has been registered before, the previously registered properties are used. Otherwise, the given dict values are given to the constructor of QuantumOp. For any missing constructor values, some defaults suitable for a 1-QB gate are used.

Return type:

None