Multi Qubit state representation using Q Sphere

What is a Q sphere ?

Shashanka B R
4 min readAug 5, 2020
Fig 1 Q-Sphere Representation

“It’s a sphere ideally used for multi-qubit representation. “ It’s designed as shown in Fig 1 to represent the state of a system of qubits by relating there computational basis state on its surface using tiny ball’s. The color of the ball represents the phase angle of its basis state’s amplitude. The colored ball’s radius is proportional to the magnitude of the basis state’s amplitude.”

To simply put it’s used to observe the amplitude and phase information.The number of rings in the qsphere is N-1 where N is the no of qubits.

The color map of the phase angles are represented in Fig 2

Fig 2 phase angles color representation

Difference between a Bloch sphere and Q sphere

Blotch sphere

A Blotch vector is a unit vector who’s coordinates in space are given as follows.

(1)

Blotch sphere maps the 2D complex state-vector onto a real 3D space, its a geometric representation of a pure state. The function qiskit offers to plot blotch sphere is plot_bloch_vector(). Each sphere represents a single qubit orientation, ie if there are 2 qubits we have 2 bloch plots for 3 qubits we have 3 bloch plots and so on. Single qubit representation on Y axis is shown in Fig 3.

Fig 3 Bloch sphere representing[0,1,0]

It’s only able to represent separable qbits, when it comes to general multi-qubit states like entangled state it not able to plot any more as shown in Fig 4

Fig 4

Q sphere

The Q-sphere offers a complete visualization of multi qubit and single qubit states along with their phase and amplitudes,The function qiskit offers to plot blotch sphere is plot_state_qsphere(),as shown in the example Fig 5.

Fig 5

As shown in Fig 5 qsphere is able to represent both the states |00> and |10> with a phase of 0 degrees and the amplitude remains same as the red blob size are equal.

Fig 6 Bloch unable to represent entangled state.

Coming to where the Q sphere really shines.

lets analyse the phase changes and observe some samples.

Fig 7 Phase change 3 qbit operation
Fig 7 Phase change 4 qubit operation

How are the positions of sphere decided on the ring ?

The basis states are equally distributed on the points of the q-sphere 0^n in the north end, 1^n in the south end, all the other states are arranged on the parallel ring in decreasing order on the no of 1’s ie, in Fig 7, 0001 occupies the top most ring followed by -0011 on the second ring and 1101 on the third finally -1111 in the south end.

Finally to observe the amplitude change. We will be seeing different stages of two qubit Grover's search of state 00 on the qsphere.

Fig 8 Stages of Grover's search

First qsphere in Fig 8 represents the state initialization, second represents the phase shift performed by the oracle and finally the reflection increases the amplitude.

For a hands on experience try the qiskit library.

--

--