register_manager
BitRegister
Bases: Register
BitRegister manages a (virtual) bit register.
Source code in opensquirrel\register_manager.py
QubitRegister
Bases: Register
QubitRegister manages a (virtual) qubit register.
Source code in opensquirrel\register_manager.py
Register
Bases: ABC
Register manages a (virtual) register.
Source code in opensquirrel\register_manager.py
get_index(variable_name, sub_index)
Get the Index for a given subIndex
of a variable_name
.
get_range(variable_name)
RegisterManager
RegisterManager keeps track of a (virtual) qubit register, i.e., an array of consecutive qubits, and the mappings between the (logical) qubit variable names, as used in an input cQASM program, and the (virtual) qubit register.
For example, given an input program that defines 'qubit[3] q': - variable 'q' is mapped to qubits 0 to 2 in the qubit register, and - positions 0 to 2 in the qubit register are mapped to variable 'q'.
The mapping of qubit variable names to positions in the qubit register is an implementation detail, i.e., it is not guaranteed that qubit register indices are assigned to qubit variable names in the order these variables are defined in the input program.