qat.experimental.dialect.gate.ir.types module

class AlgorithmicQubitType(*parameters)

Bases: AlgorithmicQubitType

An algorithmic qubit type, assigned at circuit construction time.

Represents a qubit as it appears in an algorithm, such as a qubit in a source QASM2 program, with no hardware assignment. Placement maps algorithmic qubits to physical qubits.

classmethod get_irdl_definition()

Get the IRDL attribute definition.

name: ClassVar[str] = 'gate.qubit.algorithmic'

The attribute name should be a static field in the attribute classes.

class PhysicalQubitType(index)

Bases: PhysicalQubitType

A physical qubit type, assigned after placement.

Variables:

index – The index of the qubit on the device. Must not be negative.

classmethod get_irdl_definition()

Get the IRDL attribute definition.

index: IntegerAttr = <xdsl.irdl.attributes._ParameterDef object>
name: ClassVar[str] = 'gate.qubit.physical'

The attribute name should be a static field in the attribute classes.

verify()

Check that the attribute parameters satisfy the expected invariants. Raise a VerifyException otherwise.

Return type:

None

class QubitType(*parameters)

Bases: ParametrizedAttribute, TypeAttribute

Abstract base for qubit type.

Concrete subtypes distinguish algorithmic qubits (pre-placement, directly from the source program) from physical qubits (post-placement), allowing placement to be expressed as a type-level rewrite without any structural change to the circuit ops.

name: ClassVar[str] = 'gate.qubit'

The attribute name should be a static field in the attribute classes.