qecx.model.operations.LogicalGateSet

class qecx.model.operations.LogicalGateSet(entries)

Bases: Mapping[str, Mapping[tuple[Operand, …], VariantGroup[LogicalGateVariant]]]

Logical-gate variants addressed by gate name and operand signature.

Holds LogicalGateVariant groups keyed by gate name, then by canonical operand signature; registered under the operations_key "logical_gates".

find(gate, operands)

Return the logical-gate variant registered for a signature, or None.

Resolves gate gate and the operand signature operands to the default variant of the matching group, matching the signature up to block-label renaming.

Parameters:
  • gate (str) – The logical gate name.

  • operands (tuple[Operand, ...]) – The operand signature to look up.

Returns:

The matching group’s default variant, or None when no group matches.

Return type:

LogicalGateVariant | None

to_dict()

Return the operation set as its serialized container.

Returns:

The logical-addressing operation container, ready to embed under the set’s operations_key in a document dict.

Return type:

dict[str, Any]