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. |
- class RegisterManager[source]#
Utility class that keeps track of all the registers that are still available.
- 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” orregister_name
does not have an integer nextthe 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.