qiskit.circuit.QuantumCircuit.measure_all¶
- QuantumCircuit.measure_all(inplace=True, add_bits=True)[fuente]¶
Adds measurement to all qubits.
By default, adds new classical bits in a
ClassicalRegister
to store these measurements. Ifadd_bits=False
, the results of the measurements will instead be stored in the already existing classical bits, with qubitn
being measured into classical bitn
.Returns a new circuit with measurements if
inplace=False
.- Parámetros
inplace (bool) – All measurements inplace or return new circuit.
add_bits (bool) – Whether to add new bits to store the results.
- Devuelve
Returns circuit with measurements when
inplace=False
.- Tipo del valor devuelto
- Muestra
CircuitError – if
add_bits=False
but there are not enough classical bits.