Register#
- class qiskit.circuit.Register(size=None, name=None, bits=None)[소스]#
기반 클래스:
object
Implement a generic register.
참고
This class should not be instantiated directly. This is just a superclass for
ClassicalRegister
andQuantumRegister
.Create a new generic register.
Either the
size
or thebits
argument must be provided. Ifsize
is not None, the register will be pre-populated with bits of the correct type.- 매개변수:
- 예외 발생:
CircuitError – if both the
size
andbits
arguments are provided, or if neither are.CircuitError – if
size
is not valid.CircuitError – if
name
is not a valid name according to the OpenQASM spec.CircuitError – if
bits
contained duplicated bits.CircuitError – if
bits
contained bits of an incorrect type.
Attributes
- bit_type = None#
- instances_counter = count(0)#
- name#
Get the register name.
- name_format = re.compile('[a-z][a-zA-Z0-9_]*')#
- prefix = 'reg'#
- size#
Get the register size.
Methods