mqt.core.ir.registers

Module Contents

class QuantumRegister(start: int, size: int, name: str = '')

A class to represent a collection of qubits.

Parameters:
  • start – The starting index of the quantum register.

  • size – The number of qubits in the quantum register.

  • name – The name of the quantum register. A name will be generated if not provided.

property name: str

The name of the quantum register.

property start: int

The index of the first qubit in the quantum register.

property size: int

The number of qubits in the quantum register.

property end: int

Index of the last qubit in the quantum register.

__eq__(arg: object, /) bool
__ne__(arg: object, /) bool
__hash__() int
__getitem__(key: int) int

Get the qubit at the specified index.

__contains__(item: int) bool

Check if the quantum register contains a qubit.

class ClassicalRegister(start: int, size: int, name: str = '')

A class to represent a collection of classical bits.

Parameters:
  • start – The starting index of the classical register.

  • size – The number of bits in the classical register.

  • name – The name of the classical register. A name will be generated if not provided.

property name: str

The name of the classical register.

property start: int

The index of the first bit in the classical register.

property size: int

The number of bits in the classical register.

property end: int

Index of the last bit in the classical register.

__eq__(arg: object, /) bool
__ne__(arg: object, /) bool
__hash__() int
__getitem__(key: int) int

Get the bit at the specified index.

__contains__(item: int) bool

Check if the classical register contains a bit.