QRegManager
QuICT.algorithm.tools.QRegManager ¶
Quantum register allocator
Source code in QuICT/algorithm/tools/reg_manager.py
alloc ¶
Allocate designated number of qubits and return the newly allocated register as a list.
Parameters:
-
num_q(int) –Number of qubits to allocate.
Returns:
-
List[int]–List[int]: List of indices for the newly allocated qubits.
Source code in QuICT/algorithm/tools/reg_manager.py
ancilla_num
classmethod
¶
Calculate the total ancilla qubits needed for a collection of CompositeGates.
Parameters:
-
gate_list(List[Composite | None]) –A collection of CompositeGates (possibly has None in the list).
Returns:
-
int(int) –The least number of ancilla qubits required to meet the usage for all the composite gates in the list.