Measure instruction
A measure
instruction performs a measurement to its qubit argument and
assigns the outcome to a bit variable.
The general form of a measure instruction is as follows:
bit-argument =
measure
qubit-argument
Grammar for measure instruction
measure-instruction:
bit-argument =
measure
qubit-argument
bit-argument:
bit-variable
bit-index
bit-variable:
identifier
bit-index:
index
qubit-argument:
qubit-variable
qubit-index
qubit-variable:
identifier
qubit-index:
index
Note
The measure instruction accepts SGMQ notation, similar to gates.
The following code snippet shows how the measure instruction might be used in context.
On the last line of this simple cQASM program, the respective states of both qubits in the qubit register are measured along the standard/computational basis.