Visualizations

The visualizations in Circuit Composer show you different views of how quantum circuits affect the state of a collection of qubits. Each type of visualization is explained in detail below.

Note

The visualizations come from a single-shot statevector simulator, which is different from the backend specified in the Run settings and the Run button. The visualizations do not reflect any measurement operations in your circuit. Sign in and click the Run button to run your circuit on the specified backend instead.

View visualizations

The visualizations are shown in windows at the bottom of the Composer workspace (except the phase disk, which appears at the end of each qubit wire). You can choose any combination of statevector, measurement probabilities, and q-sphere visualizations to appear at the bottom of the workspace. Select or unselect visualizations in the View menu.

Download visualizations

Download one of the visualizations at the bottom of the Composer workspace by clicking the More options menu in the visualization window. You can download visualizations as an SVG, a PNG, or a CSV of the underlying data. You can also download the visualization images of the measurement probabilities and statevector histograms as a PDF.

Statevector view

6-qubit limit

This view visualizes the statevector as a histogram. The horizontal axis labels the computational basis states. The vertical axis measures the magnitude of the amplitudes associated with each computational basis state. The color of each bar represents the phase angle of each amplitude.

Consider the following quantum circuit and its statevector view:

a quantum circuit statevector view

A quantum circuit and its statevector view.

phase colormap

The color wheel maps phase angle to color. The output state is expressed as a list of complex numbers.

The circuit puts a qubit in the state |\psi\rangle = (|0\rangle + i |1\rangle) / \sqrt{2} . The computational basis states are |0\rangle and |1\rangle . The magnitudes of the amplitudes are both 1/\sqrt{2} . The phases of the amplitudes are 0 and \pi/2 for |0\rangle and |1\rangle , respectively.

Measurement probabilities view

8-qubit limit

This view visualizes the measurement probabilities as a histogram. The vertical axis labels the computational basis states. The data labels to the right of the horizontal bars label the measurement probabilities of each computational basis state in terms of percentages. The probabilities P_i are related to the amplitudes \alpha_i of the computational basis states |i\rangle according to P_i = |\alpha_i|^2 .

Consider the following quantum circuit and its measurement probabilities view:

a quantum circuit measurement probabilities view

A quantum circuit and its measurement probabilities view.

The circuit puts a qubit in the state |\psi\rangle = (|0\rangle + i |1\rangle) / \sqrt{2} . The measurement probabilities are

P_0 = |\langle 0 | \psi \rangle|^2 = |1/\sqrt{2}|^2 = 1/2 = 50\% ,
P_1 = |\langle 1 | \psi \rangle|^2 = |i/\sqrt{2}|^2 = 1/2 = 50\% .

Q-sphere view

5-qubit limit

The q-sphere represents the state of a system of qubits by associating each computational basis state with a point on the surface of a sphere. A node is visible at each point. Each node’s radius is proportional to the magnitude of its basis state’s amplitude. Each node’s color indicates the phase angle of its basis state’s amplitude.

The nodes are laid out on the q-sphere so that the basis state with all zeros (e.g., |000\rangle) is at its north pole, and the basis state with all ones (e.g., |111\rangle ) is at its south pole. Basis states with the same number of zeros (or ones) lie on a shared latitude of the q-sphere (e.g., |001\rangle, |010\rangle, |100\rangle ). Beginning at the north pole of the q-sphere and progressing southward, each successive latitude has basis states with a greater number of ones.

Note

The q-sphere of a single-qubit system is not a Bloch sphere.

Consider the following quantum circuit and its q-sphere:

a quantum circuit q-sphere view

A quantum circuit and the q-sphere representing the state the circuit creates.

The circuit puts a qubit in the state |\psi\rangle = (|0\rangle + i |1\rangle) / \sqrt{2} prior to measurement. The basis state |0\rangle is associated with the node at the north pole of the q-sphere. The basis state |1\rangle is associated with the node at the south pole of the q-sphere. The two amplitudes have the same magnitude, so the nodes have equal radii. The color of each node signifies the phase angle, as labeled by the color wheel below the q-sphere.

You can select, hold, and drag to rotate the q-sphere. To return the q-sphere to its default orientation, select the rewind-arrow button to the top right of the q-sphere.

a q-sphere, rotated

The q-sphere described above, rotated.

Phase disk

15-qubit limit

The phase disk at the terminus of each qubit in Circuit Composer gives the local state of each qubit at the end of the computation. The three components of the phase disk are described below.

Phase

The phase of the qubit state vector in the complex plane is given by the line that extends from the center of the diagram to the edge of the gray disk (which rotates counterclockwise around the center point).

phase of the local qubit state

Probability the qubit is in the |1\rangle state

The probability that the qubit is in the |1\rangle state is represented by the blue disk fill.

probability the qubit is in the 1 state

Reduced purity of the qubit state

The radius of the black ring represents the reduced purity of the qubit state, which for qubit j in an N -qubit state |\psi\rangle is given by \mathrm{Tr}\left[\mathrm{Tr}_{i\in [0, N-1], i\neq j}\left|\psi\rangle\langle\psi\right|\right]^{2} . The reduced purity for a single qubit is in the range [0.5, 1] ; a value of one indicates that the qubit is not entangled with the other N-1 qubits. In contrast, a reduced purity of 0.5 shows that the qubit is left in the completely mixed state, and is thus maximally entangled with the other qubits in the state.

purity of the qubit state

Example: phase disks for two different qubits

phase disk examples

Two examples of the phase disk visualization.