quantify_scheduler.backends.qblox.register_manager
¶
Utility class for dynamically allocating registers for Qblox sequencers.
Module Contents¶
Classes¶
Utility class that keeps track of all the registers that are still available. |
Functions¶
|
Verifies whether the passed name is a valid register name. Raises on any of the |
- class RegisterManager[source]¶
Utility class that keeps track of all the registers that are still available.
Instantiates the RegisterManager.
- property available_registers: Set[str][source]¶
Getter for the available registers.
- Returns:
A set containing all the available registers.
- allocate_register() str [source]¶
Allocates a register to be used within the q1asm program.
- Returns:
A register that can be used.
- Raises:
IndexError – When the RegisterManager runs out of registers to allocate.
- free_register(register: str) None [source]¶
Frees up a register to be reused.
- Parameters:
register – The register to free up.
- Raises:
ValueError – The value provided is not a valid register.
RuntimeError – Attempting to free a register that is already free.
- _verify_valid_register(register_name: str) None [source]¶
Verifies whether the passed name is a valid register name. Raises on any of the conditions:
register_name does not start with “R” or
register_name does not have an integer next
the integer is higher than the number of registers in the sequence processor
the integer is negative valued
- Parameters:
register_name – The register to verify.
- Raises:
ValueError – Invalid register name passed.