# Register `qualtran.Register`
View source on GitHub
|
qualtran.Register(
name,
dtype,
shape=attr_dict['_shape'].default,
side=attr_dict['side'].default
)
Each register has a name and a quantum data type. A collection of `Register` objects are used
to define a bloq's signature, see the `Signature` class.
qualtran namespace.
`shape`
: An optional tuple of integer dimensions to declare a multidimensional register. The
total number of bits is the product of entries in this tuple times `bitsize`.
`side`
: Whether this is a left, right, or thru register. See the documentation for `Side`
for more information.
`bitsize`
:
`shape_symbolic`
:
## Methods
is_symbolic
is_symbolic() -> bool
all_idxs
all_idxs() -> Iterable[Tuple[int, ...]]
Iterate over all possible indices of a multidimensional register.
total_bits
total_bits() -> int
The total number of bits in this register.
This is the product of bitsize and each of the dimensions in `shape`.
total_qubits
total_qubits() -> int
The total number of qubits in this register.
This is the product of the register's data type's number of qubits
and each of the dimensions in `shape`.
total_cbits
total_cbits() -> int
The total number of classical bits in this register.
This is the product of the register's data type's number of classical bits
and each of the dimensions in `shape`.
adjoint
adjoint() -> 'Register'
Return the 'adjoint' of this register by switching RIGHT and LEFT registers.
__ne__
__ne__(
other
)
Check equality and either forward a NotImplemented or return the result negated.
__eq__
__eq__(
other
)
Method generated by attrs for class Register.