class documentation

class QumodeRegister(Sequence[Qumode]): (source)

Constructor: QumodeRegister(num_qumodes, num_qubits_per_qumode, name)

View In Hierarchy

Wrapper to QisKit QuantumRegister to represent multiple qubits per qumode.

Implements __getitem__ to make QumodeRegister appear to work just like QuantumRegister with instances of CVCircuit.

Static Method calculate_cutoff Undocumented
Method __add__ Undocumented
Method __contains__ Return true if this QumodeRegister contains the given qubit. This allows callers to use in python syntax.
Method __getitem__ Return a list of QisKit Qubit for each indexed qumode
Method __init__ Initialize QumodeRegister
Method __iter__ Iterate over the list of lists representing the qubits for each qumode in the register
Method __len__ The length of a QumodeRegister is the number of qumodes (not the num_qumodes * num_qubits_per_qumode)
Method __repr__ Undocumented
Method get_qumode_index Get the qumode index for the given qubit in this register
Instance Variable num_qubits_per_qumode Undocumented
Instance Variable num_qumodes Undocumented
Instance Variable qreg Undocumented
Instance Variable size Undocumented
Property cutoff Undocumented
Property name Undocumented
Property qubits Undocumented
def calculate_cutoff(num_qubits_per_qumode: int) -> int: (source)

Undocumented

def __add__(self, other: Sequence[Qumode]) -> list[Qumode]: (source)

Undocumented

def __contains__(self, qubit: Qubit): (source)

Return true if this QumodeRegister contains the given qubit. This allows callers to use in python syntax.

@overload
def __getitem__(self, key: int) -> Qumode:
@overload
def __getitem__(self, key: slice) -> list[Qumode]:
(source)

Return a list of QisKit Qubit for each indexed qumode

Parameters
key:slice or intindex into qumode register
Returns
listlist pf qubits from QuantumRegister representing qumode
Raises
ValueErrorif slice or int not provided
def __init__(self, num_qumodes: int, num_qubits_per_qumode: int = 2, name: str | None = None): (source)

Initialize QumodeRegister

Parameters
num_qumodes:inttotal number of qumodes
num_qubits_per_qumode:int, optionalNumber of qubits representing each qumode. Defaults to 2.
name:str, optionalName of register. Defaults to None.
def __iter__(self) -> Iterator[Qumode]: (source)

Iterate over the list of lists representing the qubits for each qumode in the register

def __len__(self): (source)

The length of a QumodeRegister is the number of qumodes (not the num_qumodes * num_qubits_per_qumode)

def __repr__(self) -> str: (source)

Undocumented

def get_qumode_index(self, qubit: Qubit) -> int: (source)

Get the qumode index for the given qubit in this register

num_qubits_per_qumode = (source)

Undocumented

num_qumodes = (source)

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

qubits: QuantumRegister = (source)

Undocumented