ClassicalRegister module
- class ClassicalRegister
Implements the ClassicalRegister class. Use this class to define the extent of the classical registers needed for the computation.
- ClassicalRegister(self, size, name='')
Creates a named classical register of the required size.
- Example:
>>> cr = ClassicalRegister(5, "c")
- Args:
- size (int):
The number of bits in the classical register.
- name (Optional[str]):
The name of the classical register. If no name is provided, the default name of “c_” will be used.
- Returns:
ClassicalRegister
- Raises:
- RunTimeError:
If no more bits can be created.
- size(self)
Returns the number of bits in the classical register.
- Args:
None
- Returns:
int
- Raises:
None
- name(self)
Returns the name of the classical register.
- Args:
None
- Returns:
str
- Raises:
None
- prefix()
Returns the prefix character of the classical register.
- Args:
None
- Returns:
char
- Raises:
None