Spanish
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

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. If add_bits=False, the results of the measurements will instead be stored in the already existing classical bits, with qubit n being measured into classical bit n.

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

QuantumCircuit

Muestra

CircuitError – if add_bits=False but there are not enough classical bits.