Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add measurement information #1988

Merged
merged 13 commits into from
Oct 4, 2024
8 changes: 4 additions & 4 deletions docs/guides/measure-qubits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ To get information about a qubit's state, you can _measure_ it onto a [classical

$$
|q\rangle \xrightarrow{measure}\begin{cases}
|0\rangle (\text{outcome}+1), \text{with probability } p_0=|\langle q|0\rangle|^{2}\text{,} \\
|1\rangle (\text{outcome}-1), \text{with probability } p_1=|\langle q|1\rangle|^{2}\text{.}
0 (\text{outcome}+1), \text{with probability } p_0=|\langle q|0\rangle|^{2}\text{,} \\
1 (\text{outcome}-1), \text{with probability } p_1=|\langle q|1\rangle|^{2}\text{.}
\end{cases}
$$

## Apply a measurement to a circuit

There are several ways to apply measurement to a circuit:

### `QuantumCircuit.measure` method
### `measure` method
beckykd marked this conversation as resolved.
Show resolved Hide resolved

Use the [`measure`](/api/qiskit/qiskit.circuit.QuantumCircuit#measure) method to measure a [`QuantumCircuit`](/api/qiskit/qiskit.circuit.QuantumCircuit#quantumcircuit-class).

Expand Down Expand Up @@ -74,7 +74,7 @@ from qiskit import QuantumCircuit

qc = QuantumCircuit(3, 1)
qc.x([0, 2])
qc.measure_active() # Measure qubits that are not idle.
qc.measure_active() # Measure qubits that are not idle, i.e., qubits 0 and 2.
```


Expand Down