In the previous chapter, we have seen that a photon in an interferometer can be a prototype for a qubit. Might there be any other prototypes for a qubit arising from other particles that we might know? In fact, an electron is another prototype for a qubit. An electron has many measurable properties such as energy, mass, momentum. But, for the purposes of creating a qubit, we want to focus on a property with only two measurable values. An electron has a two-state property which is called spin.
Classically, an electron’s spin can be visualized as a rotation about its own axis, like a spinning top or fidget spinner. You learned in high school physics that a moving charge creates a magnetic field according to the right-hand rule. By curling the fingers of your right hand in the direction of the electron’s rotation, your thumb points in the direction of the magnetic field created by the charge. Conceptually, an electron’s spin behaves somewhat like a tiny bar magnet. However, this classical picture is just an analogy. In reality, the quantum mechanical property we call “spin” is intrinsic to the electron (like its mass or charge). The property was called spin because it can be described mathematically just like orbital angular momentum, but spin does not actually correspond to the electron physically rotating.[1] Just like a lot of quantum phenomena, spin can be confusing at first. Exploring how the electron can be used as a qubit will provide further intuition into quantum phenomena such as quantum superposition, spin, and measurement.
4.1 Stern–Gerlach Apparatus¶
The original Stern–Gerlach experiment sent silver atoms through an inhomogeneous magnetic field and observed two distinct deflections. The apparatus provides a model for measuring a spin-½ particle: along any chosen axis, an electron’s spin measurement has two possible outcomes. This video[2] explains the experimental apparatus used to measure the electron’s spin. The key point here is that the vertically oriented apparatus (called the z-direction by convention) only measures the spin as either up or down, not randomly oriented at any angle. Since the spin of an electron has two measurable states, it can represent a qubit with as spin up and as spin down (Fig. Figure 1).

Figure 1:An electron can spin either up or down and produce a magnetic field.
Question 1 Open up the PhET Stern–Gerlach simulator[3] and try sending electrons of various initial spins into the Stern–Gerlach apparatus (SGA).
Are the results what you would expect? The “up” and “down” directions are defined by the orientation of the apparatus, as in Fig. Figure 2. There is nothing inherently special about the z-direction compared to the x- or y-direction. An SGA rotated horizontally would measure either spin left or spin right. An SGA rotated by 45° would measure the spin to be either diagonally up or diagonally down. What is particularly interesting is if we send a single spin up electron into a horizontally oriented SGA.

Figure 2:A cartoon picture of the Stern–Gerlach Apparatus. Electron spin produces a magnetic field either in the up or down direction.
Question 2 Where would you expect a spin up electron to land in Fig. Figure 3 after passing through a horizontal SGA?

Figure 3:Choices for Question 2.
Classically, vertically oriented bar magnets in a horizontal magnetic field would land at the center of the screen. However, recall that the spin can only be measured as left or right and cannot possibly land in the center. The way quantum mechanics solves this problem is to have the electron land either on the left or the right with 50% probability. Sound familiar? Before entering the horizontal SGA, a spin-up electron is already a superposition of left and right when expressed in the horizontal measurement basis. The apparatus yields one of those two outcomes.
The Stern–Gerlach results illustrate why the measurement basis matters when describing a spin qubit. More broadly, simulating quantum systems, including properties of molecules, is one proposed application of quantum computers.[4]
4.2 Measurement Basis¶
Spin in the vertical direction can be represented as a superposition of spins in the horizontal direction. As shown in the simulation, an electron with vertical spin has a 50% chance of being measured as right or left:
In more traditional qubit notation, spin along the + z and − z directions is written as and , while spin along the + x and − x directions is and :
The equations express the same state in two different measurement bases. Figure Figure 4 uses a coin as a mnemonic for changing viewpoint, but an ordinary coin does not acquire quantum coherence merely because it is viewed from another direction. A horizontal spin measurement on a vertically prepared electron gives two possible outcomes with equal probability.

Figure 4:Analogy for how a definite vertical spin is seen as a superposition in the horizontal direction.
Example Write the state in terms of and .
Solution Adding Eqs. ((3)) and ((4)) we find
Rearranging, we get
Similarly, by subtracting Eqs. ((3)) and ((4)), we find
These equations show that a horizontal spin is a superposition of spin up and spin down. As we saw in the beam splitter example, the minus sign encodes information about the original state of the particle before it is put in superposition. As described and visually shown in Sect. 2.3 Bloch Sphere, it is possible to choose other complex amplitudes that give the same probability, but the details are mathematically beyond our scope.
We reached the conclusion that spins in one direction can be written as a superposition of spins in another direction. Within the quantum computing field, the “z-basis” is composed of and , while and compose the “x-basis.” A basis is analogous to a coordinate system for quantum states. Any state can be written in terms of a different choice of basis, similarly to how any vector can be broken down into components along a different choice of axes.
In Fig. Figure 5, a box on a ramp is subject to a force. The vector decomposition of is shown for three different coordinate systems. All three coordinate systems are valid for describing the force, but only the first two are convenient to use in actual calculations. By choosing x–y to be perpendicular, you have made the components mutually exclusive: if a vector is horizontal, you know it’s definitely not vertical. The x- and y- directions can be treated as two independent problems. The mathematical term for expressing that the axes are independent is “orthogonal”. In quantum mechanics, there are an infinite number of possible choices for a basis. For the measurement bases used here, we choose states with two properties:[5]
The states span the possible spin states of the system.
The states are orthogonal, so the two outcomes are distinguishable in that measurement.

Figure 5:Rewriting quantum states in terms of a different basis is similar to decomposing a classical vector into a different choice of coordinate system.
Let us check these conditions for the z-basis, which consists of states and :
Because the Stern–Gerlach experiment shows that an electron is either spin up or spin down, the most general state of the electron would be a superposition of up and down:
A linear combination of and completely describes the electron’s state.
If you measure the spin as , it is definitely not ; therefore, and are orthogonal.
The same argument can be made for the x-basis or any other angle of the SGA (Fig. Figure 5).
4.3 Geometric Representation of a Basis¶
In this geometric representation of the z-basis and x-basis, the orthogonal states are drawn perpendicular to one another. If the electron is in a particular state in the z-basis, the state vector can be decomposed into in the x-basis. Physically turning the SGA from vertical to horizontal corresponds to changing the measurement from the z to the x-basis. Since , the same spin-up state has 50/50 outcome probabilities when measured with the horizontal apparatus. Rotating the apparatus changes the measurement basis, not the electron’s state before measurement.
Question 3 Use Fig. Figure 6 and trigonometry to show that .

Figure 6:Geometric representation of the z-basis and x-basis. The state of a spin up electron is shown.
Often, there is hidden information about the state that cannot be measured unless we change to a different basis. In the x-basis, there is no measurable difference between and . Both the qubit and the qubit would have measurement results of 50% left and 50% right in the x-basis. In the z-basis, would have 100% probability of being measured up in the Stern–Gerlach and 0% probability of being measured down, while would have 0% probability of being measured up and 100% probability of being measured down.
4.4 Effect of Measurement¶
You learned that measuring a qubit collapses its superposition state into one of two possibilities. A coin toss can illustrate uncertainty about the result, but the coin is not a quantum superposition. A qubit can be in a superposition before measurement and yields one definite result when measured. The photon is in a superposition state after passing through a beam splitter, but once it reaches the detectors, we know for sure whether it was reflected or transmitted. To appreciate the truly strange nature of quantum measurement, let’s see what happens when electrons are sent through multiple Stern–Gerlach devices in a row.
Question 4 Open the PhET Stern–Gerlach simulator[6] and send electrons with randomly oriented spins through a vertical SGA as in Fig. Figure 7. What is the spin of the electrons that pass through the hole?
(a) + z
(b) − z
(c) Superposition of + z and − z

Figure 7:The z-axis SGA lets through spin up electrons but blocks spin down electrons.
Question 5 Add a second SGA, oriented horizontally as in Fig. Figure 8. What is the spin of the electrons before entering the second SGA?
(a) + x
(b) − x
(c) Superposition of + x and − x

Figure 8:The z and x-axis SGA.
Question 6 What is the spin of the electrons after passing through the second SGA?
(a) + x
(b) − x
(c) Superposition of + x and − x
Question 7 What is the z-spin of the electron coming out of the second SGA? Design an experiment to confirm this in the simulation.
(a) + z
(b) − z
(c) Superposition of + z and − z
Given that only spin up electrons passed through the first SGA, one would expect that the electron is still spin up after the second SGA, no matter what is measured in x. However, if you measure the z-spin with a third SGA as in Fig. Figure 9, it has a 50% chance of being up or down!

Figure 9:The first SGA selects for + z spin and the second SGA selects for − x. The third SGA shows that by measuring the − x spin in the z-basis, the electron is in a superposition of + z and − z.
By measuring the electron, we fundamentally changed its state. Measuring the x-spin of the qubit puts it into a superposition of up and down, even when it started as up to begin with. When you measure the length of an object with a ruler, you don’t expect the object’s length to change after you measure it!
Quantum measurement collapse is used in many quantum applications such as cryptography, where one could detect if a message has been intercepted. This will be discussed in further detail in Chap. 5. Quantum Cryptography. An arbitrary unknown qubit state also cannot be copied perfectly while retaining the original. This is the no-cloning theorem: no single quantum operation can duplicate every possible input state. Measurement cannot evade the limit, because it reveals only one outcome and generally changes the state. Classical information such as text can still be copied; the theorem concerns unknown quantum states, not ordinary files stored on a quantum computer. However, for certain applications, the information in superposition states allows information processing beyond what is possible in a classical computer. This will be explored more in Chap. 9. Quantum Algorithms.
4.5 Big Ideas¶
An electron has an intrinsic property called spin. A measurement of its spin along a chosen axis has two possible outcomes, often called spin-up and spin-down.
The measurement basis is important when interpreting results from experiments on quantum states. Two common bases are the z-basis (|0〉 and |1〉) and the x-basis (|+〉 and |−〉).
Stern–Gerlach apparatuses can prepare and measure electron-spin states in different bases. The electron can be used as a qubit, and the SGA as a way to operate on this qubit. Together, they are a simple model of a quantum computer.
4.6 Activities¶
Polarizer Demo in Worksheet 10.2 Polarizer Demo
Measurement Basis Lab in Worksheet 10.6 Measurement Basis Lab
Superposition vs. Mixed States Lab in Worksheet 10.5 Superposition vs. Mixed States Lab
4.7 Check Your Understanding¶
The Stern–Gerlach apparatus is rotated by 90° so that the magnetic field is in the x-direction as shown in Fig. Figure 10. If electrons from a random source are sent through the apparatus, what pattern would be formed on the screen?

Figure 10:Stern–Gerlach apparatus.
Would and together satisfy the criteria for a valid basis?
An electron is in a superposition state shown in the geometric representation in Fig. Figure 11.

Figure 11:Superposition state of the electron.
(a) What is the state of the electron in the z-basis? That is, find α and β in
(b) What is the probability of measuring spin up?
(c) What is the state of the electron in the x-basis? i.e., find α and β in .
(d) What is the probability of measuring the spin in the direction?
To measure the difference between an electron in a spin state and one in , one could use:
(a) I only
(b) II only
(c) I or III
(d) II or III
(e) I, II, or III
An electron with random spin is sent through two vertical SGAs as shown in Fig. Figure 12. What would be the output of the second SGA?

Figure 12:SGA setup for Problem 5.
An electron with random spin is sent through two vertical SGAs, where the second SGA is rotated upside down, or 180°.
(a) If the second + z port is blocked as in Fig. Figure 13, what would be the output of the second SGA?

Figure 13:SGA setup for Problem 6a.
(b) If both ports on the second SGA are open as in Fig. Figure 14, what would you see at the output?

Figure 14:SGA setup for Problem 6b.
An electron with random spin is sent through a horizontal SGA followed by a vertical SGA as in Fig. Figure 15. What would be the output of the second SGA?

Figure 15:SGA setup for Problem 7.
An electron with random spin is sent through three SGAs as shown in Fig. Figure 16. What would be the output of the third SGA?

Figure 16:SGA setup for Problem 8.
An electron with random spin is sent through three SGAs as shown in Fig. Figure 17. What would be the output of the third SGA?

Figure 17:SGA setup for Problem 9.
An electron with random spin is sent through four SGAs as shown in Fig. Figure 18. What would be the output of the fourth SGA?

Figure 18:SGA setup for Problem 10.
See Spin (physics) for more details.
These two properties can also be used to form a basis in a classical system, where states should be swapped for vectors.