# Visualizations¶

Circuit Composer lets you see how quantum circuits affect the state of a collection of qubits through three types of visualizations. Each type of visualization is explained in detail below.

Table of contents

## View visualizations¶

You can view the visualizations by selecting the **Visualizations tab** to the
left of the editor.

## Download visualizations¶

You can download a visualization by selecting the three stacked lines to the upper right of a visualization. You can download visualizations as an SVG, a PNG, or a CSV of the underlying data.

## Statevector view¶

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:

The circuit puts a qubit in the state . The computational basis states are and . The magnitudes of the amplitudes are both . The phases of the amplitudes are and for and , respectively.

## Density matrix view¶

This view visualizes the density matrix as a pair of heatmaps. The real and imaginary parts of the density matrix are each shown in their own heatmap. The horizontal and vertical axes label the computational basis states. The color of each cell represents the value of the real or imaginary part of the density matrix.

Consider the following quantum circuit and its density matrix view:

The circuit puts a qubit in the state . The computational basis states are and . The density matrix is

## Measurement probabilities view¶

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 are related to the amplitudes of the computational basis states according to .

Consider the following quantum circuit and its measurement probabilities view:

The circuit puts a qubit in the state . The measurement probabilities are

## Q-sphere view¶

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 ball is placed at each point. Each ball’s radius is proportional to the magnitude of its basis state’s amplitude. Each ball’s color marks the phase angle of its basis state’s amplitude.

The balls are laid out on the q-sphere so that the basis state with all zeros (e.g., is at its north pole and the basis state with all ones (e.g., ) 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., ). 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:

The circuit puts a qubit in the state prior to measurement. The basis state is associated with the ball at the north pole of the q-sphere. The basis state is associated with the ball at the south pole of the q-sphere. The two amplitudes have the same magnitude, so the balls have equal radii. The color of each ball marks 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.