Skip to content

Quantum Superposition Primer

Objective

SAS is advancing a quantum computing initiative to bring quantum capabilities to SAS Viya. The goal is to make quantum computing more intuitive, efficient, and cost-effective, reducing the barriers to adoption and accelerating the path from experimentation to business value. This document provides a high-level introduction to the phenomenon of superposition in quantum physics and its use in quantum computing.

Quantum Superposition

Quantum superposition is a core phenomenon in quantum physics that quantum computers use to perform calculations. But what exactly is superposition? Paul Dirac described it this way:

The general principle of superposition of quantum mechanics applies to states [that are theoretically possible without mutual interference or contradiction] of any one dynamical system. It requires us to assume that between these states there exist peculiar relationships such that whenever the system is definitely in one state, we can consider it as being partly in each of two or more other states. The original state must be regarded as the result of a kind of superposition of the two or more new states, in a way that cannot be conceived on classical ideas. Any state may be considered as the result of a superposition of two or more other states, and indeed in an infinite number of ways. Conversely, any two or more states may be superposed to give a new state.

In simpler terms, if a system can be in state A or state B, superposition allows it to exist in a combination of both. Measurement then produces a probabilistic outcome of either A or B.

Many Worlds

From a philosophical perspective, any discussion of quantum superposition quickly leads to the Many Worlds Interpretation (MWI), often credited to Hugh Everett in the mid-1950s. Everett, however, was apparently unaware that Erwin Schrödinger had proposed a similar idea a decade earlier. Both approaches aimed to avoid the idea of a collapsing wave function. Schrödinger's wave equations contain no collapse; that concept was introduced by Niels Bohr to explain why observers see only one outcome rather than a mixture of possibilities. By definition, collapse destroys the superposition. Everett and Schrödinger argued that detecting only one outcome does not mean the alternatives cease to exist. Schrödinger called collapse "patently absurd" in a 1952 paper, emphasizing the "ridiculousness of expecting a quantum superposition to collapse just because it was observed."

This brings us to Schrödinger's Cat. In the thought experiment, a cat, a flask of poison, and a radioactive source are sealed in a box. If a detector senses radioactive decay, the flask breaks, releasing the poison and killing the cat. From outside the box, the observer cannot know whether the cat is alive or dead until the box is opened. In Bohr's collapse view, the cat remains in a superposition of alive and dead until observation collapses the wave function into one result. In Schrödinger's view, there are two parallel worlds: in one, the cat lives; in the other, the cat dies. When the box is opened, each world observes its own outcome. The two worlds were identical until the device determined the cat's fate. These outcomes are not alternatives; they occur simultaneously. The theory gained wider attention only much later.

Hugh Everett later developed his own version of MWI, replacing parallel universes with the idea of "splitting universes." In Everett's model, the cat begins in a single universe in a superposition of alive and dead. When observed, that universe splits into one where the cat is alive and another where the cat is dead. Every quantum "decision" point creates additional universes.

In the 1970s, David Deutsch revived Schrödinger's version of MWI. In the Deutsch-Schrödinger view, an infinite number of universes — the multiverse — corresponds to all possible solutions to the wave function. Returning to the cat example, many identical universes contain identical researchers running the same experiment. These universes remain identical until the device is triggered; in some, the cat dies, and in others, it lives, after which their histories diverge. Deutsch also argued that universes can briefly interact or interfere before that interaction is suppressed as they evolve, producing observable effects in experiments such as the double-slit experiment.

Whether framed as parallel worlds, splitting universes, or Deutsch's interacting multiverse, each interpretation shares the same central claim: in superposition, multiple outcomes genuinely coexist until measurement. Quantum computers are designed to exploit that principle.

Superposition in Quantum Computing

Quantum computation is… a distinctively new way of harnessing nature… It will be the first technology that allows useful tasks to be performed in collaboration between parallel universes. ~ David Deutsch

Most articles on quantum computing introduce superposition by comparing bits and qubits: a classical bit is either 0 or 1, while a qubit can be in a superposition of both. The key consequence is that each added qubit doubles the number of states the system can represent at once. This growth is exponential, not linear. Three qubits, for example, can represent \(2^3\), or eight, states simultaneously: 000, 001, 010, 011, 100, 101, 110, and 111. That exponential scaling is where the power begins: 10 qubits can represent \(2^{10}\), or 1,024, states at once, and 300 qubits could represent more simultaneous states than there are atoms in the known universe.

Deutsch theorized that quantum computations run simultaneously on identical quantum computers across the parallel universes associated with superposition. In the three-qubit example, that corresponds to eight versions of quantum scientists working on the same problem across eight parallel universes.

Perspective

Dr. Spyridon Michalakis has talked about these multiple universes as being accessible through changes in perspective. For example, consider the following illustration. In the 1st universe, \(|1\rangle\) is pointing up and \(|0\rangle\) is horizontal with a superposition at a 45° angle between the two. If we change our perspective 45° now the superposition is vertical, and the 45° angle is \(|1\rangle\) or \(|0\rangle\). By rotating the perspective, you are in a sense changing from one universe to another (creating new ones or collapsing into one).

Changing of Perspectives

We can show this also mathematically. Our first example uses Dirac notation. Let's start with a single qubit \(|0\rangle\) and we change the perspective,

\[|0\rangle \rightarrow \frac{|0\rangle + |1\rangle}{\sqrt{2}}.\]

We divide by the \(\sqrt{2}\) to show the 50%–50% probability. We can add another qubit \({|0\rangle}_{1} \otimes {|0\rangle}_{2}\) and then change the perspective again,

\[ {|0\rangle}_{1} \otimes {|0\rangle}_{2} \rightarrow \frac{(|0\rangle + |1\rangle)_{1} \otimes (|0\rangle + |1\rangle)_{2}}{2}. \]

We can then expand this tensoring out and we get

\[ \frac{(|0\rangle + |1\rangle)_{1} \otimes (|0\rangle + |1\rangle)_{2}}{2} = \frac{|0\rangle_{1} \otimes |0\rangle_{2} + |0\rangle_{1} \otimes |1\rangle_{2} + |1\rangle_{1} \otimes |0\rangle_{2} + |1\rangle_{1} \otimes |1\rangle_{2}}{2} \]

or written clearer as a superposition of

\[ \frac{|0_{1}0_{2}\rangle + |0_{1}1_{2}\rangle + |1_{1}0_{2}\rangle + |1_{1}1_{2}\rangle}{2} \]

with 4 simultaneous quantum states 00, 01, 10, 11 from a 2 qubit superposition.

To further illustrate we can use vectors and matrices. Recall from an earlier blog that the vector representation of an initialized qubit is \(|0\rangle = \begin{bmatrix} 1 \\ 0 \end{bmatrix}\), meaning 100% \(|0\rangle\) and 0% \(|1\rangle\). A Hadamard gate is used to create a superposition of the qubit and its unitary matrix is \(\frac{1}{\sqrt{2}}\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}\). If we apply the Hadamard gate to each qubit we would perform

\[ \frac{1}{\sqrt{2}}\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}\begin{bmatrix} 1 \\ 0 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix} \]

twice, once for each qubit. We start off with a qubit 100% in the \(|0\rangle\) and end with a qubit 50% in \(|0\rangle\) and 50% \(|1\rangle\). Now if we were to tensor these two together we get

\[ \begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix} \otimes \begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix} = \frac{1}{2}\begin{bmatrix} 1 \\ 1 \\ 1 \\ 1 \end{bmatrix}, \]

where the 1st entry in the column vector corresponds to 00, the 2nd 01, the 3rd 10 and the 4th 11. We can also do this the opposite way by tensoring the two Hadamard gates together, then tensoring the two qubits together and finally multiplying the combined gates and qubits. Tensoring the Hadamard gate together we arrive at

\[ \frac{1}{\sqrt{2}}\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} \otimes \frac{1}{\sqrt{2}}\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} = \frac{1}{2}\begin{bmatrix} 1 & 1 & 1 & 1 \\ 1 & -1 & 1 & -1 \\ 1 & 1 & -1 & -1 \\ 1 & -1 & -1 & 1 \end{bmatrix}. \]

Then tensoring the two qubits results in

\[ \begin{bmatrix} 1 \\ 0 \end{bmatrix} \otimes \begin{bmatrix} 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix}, \]

notice that 100% is for \(|00\rangle\) because we have not applied the Hadamard gate yet. When we multiply the tensored Hadamard gates with the tensored qubits we get

\[ \frac{1}{2}\begin{bmatrix} 1 & 1 & 1 & 1 \\ 1 & -1 & 1 & -1 \\ 1 & 1 & -1 & -1 \\ 1 & -1 & -1 & 1 \end{bmatrix}\begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} = \frac{1}{2}\begin{bmatrix} 1 \\ 1 \\ 1 \\ 1 \end{bmatrix}, \]

same as above. The multiplier of \(\frac{1}{2}\) is computed as \(\frac{1}{2} = \frac{1}{2^{\frac{n}{2}}} = \frac{1}{2^{\frac{2}{2}}}\), where n is the number of qubits. For this example n=2 qubits. Our possible values are \(|00\rangle + |01\rangle + |10\rangle + |11\rangle\) and converted to decimal \(|0\rangle + |1\rangle + |2\rangle + |3\rangle\), which will be important further on in this post when we perform some quantum calculations.

With the math out of the way, let's illustrate some real qubits. When you place an initialized qubit into superposition this changing of perspective is what happens. When we initialize a qubit it's typically initialized in the \(|0\rangle\) state which is also on the z-axis of the Bloch Sphere and this basis is called the computational basis, north is \(|0\rangle\) and south is \(|1\rangle\). Bloch Spheres are important tools used to visualize a qubit. We create a superposition by applying a Hadamard gate to the qubit. This changes the basis from the computational basis to the Hadamard basis (\(|+\rangle\) and \(|-\rangle\)) with an equal probability of the computational basis being \(0.707|0\rangle + 0.707|1\rangle\) which is the same as \(\frac{1}{\sqrt{2}}|0\rangle + \frac{1}{\sqrt{2}}|1\rangle\), which is the same as \(\frac{|0\rangle + |1\rangle}{\sqrt{2}}\). You square \(0.707^2 = 0.50\) or \(\left(\frac{1}{\sqrt{2}}\right)^{2} = \frac{1}{2}\). Because the qubit is measuring complex amplitudes the amplitudes are normalized and squared in order to get the probabilities. The images below are the visual representations of the qubits using the Bloch Spheres. The qubit on the left is initialized to \(|0\rangle\). The qubit on the right has applied a Hadamard gate to change basis and end up in the \(|+\rangle\) state with an equal superposition on the computational basis. Notice how we have changed the frame references from the z-axis or computational basis to the x-axis or the Hadamard basis.

Bloch sphere of a qubit initialized to |0⟩, pointing to the north pole Bloch sphere after a Hadamard gate, pointing along the x-axis into the |+⟩ state

Many Worlds Example

Now that we have gone through a good explanation of what superposition is, some theories, a little math, and a visualization let's take a look at actually using it. For this example I created a linear equation and solved it in parallel across superposition states. According to the Deutsch-Schrödinger MWI the linear equation is run in parallel across multiple universes. The linear equation to be solved is very simply \(y = x^{2} + 1\), because the difficulty of the equation isn't the point here, what matters is that it's solved across superposition. We use a quantum variable \(|x\rangle\) that will be in a superposition of all the numbers between 0 and 7. Therefore, the equation will be solved for all values of x between 0 and 7, not sequentially one at a time as conventional computers do, but across quantum superpositional states. We can then think of the quantum variable actually being \(|x\rangle = \frac{1}{\sqrt{8}}(|0\rangle + |1\rangle + ... + |7\rangle)\). The expected output is \(|x\rangle|y\rangle = |x\rangle|x^{2} + 1\rangle\) where \(|x\rangle\) is entangled with \(|y\rangle\). Three is the minimum number of qubits to compute with 8 numbers (0–7) in binary: ceiling(log₂(8)) = 3. Then we apply a Hadamard gate to all 3 qubits to create superpositions. Finally, we define the equation to solve and initialize the quantum variable y to the equation.

Below is the quantum circuit that solves this linear equation. Notice, the Hadamard gate applied to qubits 0–2 to put them into superposition, with the rest of the circuit acting on these superpositions and creating entanglements. In addition to the three qubits storing the x values, there are 6 additional auxiliary qubits used for the various calculations such as \(x^2\) and \(y = x^2 + 1\). There are a total of 9 qubits & 9 classic bits needed to solve this problem. The classical bits are what store the measured quantum information.

Quantum circuit with Hadamard gates on qubits 0–2 followed by the arithmetic block, using 9 qubits total

Finally, the circuit is executed to run as a quantum job 1,024 times. Remember all quantum processes need to run multiple times due to the results being probabilistic.

Histogram of measurement results showing eight roughly equal bars for x = 0…7 over 1,024 runs

Each bar represents the solution y for each value of x. For the 1st bar x=0, the 2nd x=1, and so on until x=7. Notice that when we hover over the bar we see both the value of x and y. Recall the binary-to-decimal conversion from earlier — the representation for variable x is \(|x\rangle = \frac{1}{\sqrt{8}}(|0\rangle + |1\rangle + ... + |7\rangle)\), and this is simply that conversion. It can also be thought of in binary as \(|x\rangle = \frac{1}{\sqrt{8}}(|000\rangle + |001\rangle + ... + |111\rangle)\), hence, all the possible states of 3 qubits; 000, 001, 010, 011, 100, 101, 110, 111. When we add the entanglement with y it becomes a quantum system Ψ. Considering both x and y, the fully expanded final state for the equation becomes

\[ |\psi\rangle = \frac{1}{\sqrt{8}}\big(|0\rangle|1\rangle + |1\rangle|2\rangle + |2\rangle|5\rangle + |3\rangle|10\rangle + |4\rangle|17\rangle + |5\rangle|26\rangle + |6\rangle|37\rangle + |7\rangle|50\rangle\big) \]

in decimal, or if you want to look at it as binary,

\[ |\psi\rangle = \frac{1}{\sqrt{8}}\big(|000\rangle|000001\rangle + |001\rangle|000010\rangle + |010\rangle|000101\rangle + |011\rangle|001010\rangle + |100\rangle|010001\rangle + |101\rangle|011010\rangle + |110\rangle|100101\rangle + |111\rangle|110010\rangle\big). \]
x (binary) y = x²+1 y (6-bit binary) amplitude
0 (000) 1 000001 \(1/\sqrt{8}\)
1 (001) 2 000010 \(1/\sqrt{8}\)
2 (010) 5 000101 \(1/\sqrt{8}\)
3 (011) 10 001010 \(1/\sqrt{8}\)
4 (100) 17 010001 \(1/\sqrt{8}\)
5 (101) 26 011010 \(1/\sqrt{8}\)
6 (110) 37 100101 \(1/\sqrt{8}\)
7 (111) 50 110010 \(1/\sqrt{8}\)

Conclusion

Quantum superposition is one of the key phenomena that gives quantum computers their potential power. Whether explained through the multiverse, splitting universes, or another interpretation, superposition allows quantum computers to represent and evaluate many possible solutions at once. Whatever the underlying explanation, its computational impact is undeniable.

It is important to note that this example did not solve the equation sequentially for each value of x, as a conventional computer would. Instead, it used three qubits in superposition to evaluate all eight values from 0 to 7 in parallel across superpositional states or, from the MWI perspective, across \(2^3\), or eight, universes.

Additional Resource