qib.operator.control_instructions.MeasureInstruction¶
- class qib.operator.control_instructions.MeasureInstruction(qubits: Sequence[Qubit] | None = None, clbits: Sequence[int] | None = None)[source]¶
Bases:
ControlInstructionA measurement instruction for a quantum circuit.
The measurement instruction in quantum computing converts the quantum information of a qubit into classical information by collapsing the qubit’s state to one of the basis states, typically |0> or |1>, according to the probabilities defined by its quantum state.
Methods
Instructions in quantum circuits do not have a sparse matrix representation, because they are not quantum operations that act on the state of qubits.
Generate a Qobj OpenQASM representation of the instruction.
Return the list of fields hosting the quantum particles which the instruction is applied on.
A control instruction is never Hermitian.
A control instruction is never unitary.
Return the list of memory slots the instruction will store the results in.
Apply the instruction on the specified qubits.
Return the list of quantum particles the instruction is applied on.
Attributes
The number of "wires" (or quantum particles) this instruction is applied on.
- as_matrix()[source]¶
Instructions in quantum circuits do not have a sparse matrix representation, because they are not quantum operations that act on the state of qubits. Instead, these instructions serve as control directives within a quantum circuit.
- fields()[source]¶
Return the list of fields hosting the quantum particles which the instruction is applied on.
- property num_wires¶
The number of “wires” (or quantum particles) this instruction is applied on.