This simple device emulates a single Clifford qubit. Three buttons allow for π/2 rotations in x, y and z, while three more buttons allow the state of the qubit to be projected along these axes. A dual color LED serves as the projection readout. In a single Clifford qubit, the qubit is confined to the six states which point along the three orthogonal axes in the Bloch sphere. Clifford states are the quantum computing equivalent to digital states. The device can be thought of as a single spin 1/2 particle, whose spin points either up or down along one of the three spatial axes. The emulator ignores effects like relaxation and decoherence which plague any real qubit.

Playing with the device is an easy way to demonstrate some simple aspects quantum mechanics in a two level system. You don't know the state of the qubit until you read in a particular direction. At that point the state of the qubit is only defined in that one direction, leaving the other states undefined. If the qubit is read out in a different direction, now only that direction is defined, and the qubit completely forgets about the previous state. Trying to readout in multiple directions is forbidden, and trying to rotate the qubit while reading out its position is forbidden.

When the device is first turned on, the state of the qubit is completely random. As soon as one of the three readout buttons are pressed, the qubit will be projected onto that axis, and the LED will illuminate either red or green. For example, if the x readout button is pressed and the LED shows green, then our qubit now points in the "green" direction of x (where we may arbitrarily define green to be the 0 or 1 state, or the up or down state of a spin 1/2 particle, and red would represent the opposite state). Any subsequent presses of the x readout will always display green until either the qubit is rotated to another state, or a different readout button is pressed. If we now decide to readout in y, it will be completely random whether the LED displays red or green, as the y axis is orthogonal to x (and similarly for z).

If our qubit in the "green" state of x is rotated by π/2 in the y direction, this will put our qubit in the "red" state of z. After applying this rotation, we will with certainty get a red LED when we press the z readout button (and the other readout buttons will display something completely random).

Randomness in the device is produced by continuously toggling a register bit, then reading out this bit when a button is pressed. Due to the mechanical imprecision of the buttons and because the toggling runs very quickly, the random outputs of the device are truly random. I doubt that even a precisely timed robot pressing the buttons could show any correlations (and it also helps that I am using an internal MCU clock which is not ultra precise).


Click to enlarge:

Electrically the device is very simple. Attached to a microcontroller there are push buttons for input, a speaker to let the user know a button has been pressed or when they performed an invalid operation (like trying to rotate while reading out), and a dual color LED to display the qubit state.

Source Code:


Description Qty Price (USD) Part Number Supplier
PIC Microcontroller (Microchip) 1 $3.04 PIC16F648A-I/P-ND (MFG PIC16F648A-I/P) Digi-Key
18 pin DIP socket (Mill-Max Manufacturing Corp) 1 $2.77 ED56183-ND (MFG 110-13-318-41-001000) Digi-Key
5 volt regulator (National Semiconductor) 1 $0.80 LM78L05ACZNS-ND (MFG LM78L05ACZ/NOPB) Digi-Key
Red/green dual 5mm LED (Kingbright Corp) 1 $0.27 754-1235-ND (MFG WP59SRSGW/CC) Digi-Key
5mm LED mounting clip (Lumex Opto/Components Inc) 1 $1.80 67-1332-ND (MFG SSH-LX5091) Digi-Key
100 Ohm 15W speaker(PUI Audio, Inc) 1 $3.20 668-1138-ND (MFG AST-030C0MR-R) Digi-Key
10 kOhm 9 resistor network (Bourns Inc) 1 $0.39 4610X-1-103LF-ND (MFG 4610X-101-103LF) Digi-Key
180 Ohm resistor (Yageo) 2 $0.41 180QBK-ND (MFG CFR-25JB-180R) Digi-Key
4.7uF 50V electrolytic capacitor (Panasonic) 1 $0.20 P5177-ND (MFG ECA-1HM4R7) Digi-Key
1uF 35V tantalum capacitor (AVX Corp) 1 $0.46 478-1835-ND (MFG TAP105K035SCS) Digi-Key
0.33uF 50V ceramic capacitor (Kemet) 2 $0.48 399-4299-ND (MFG C320C334M5U5TA) Digi-Key
Red SPST NO pushbutton (E-Switch) 3 $1.96 EG2045-ND (MFG PS1057ARED) Digi-Key
Black SPST NO pushbutton (E-Switch) 3 $1.96 EG2041-ND (MFG PS1057ABLK) Digi-Key
SPST rocker switch (Cherry) 1 $1.79 CH865-ND (MFG PRK22J5DBBNN) Digi-Key
9-volt battery clip (Bud Industries) 1 $1.20 377-1549-ND (MFG HH-3449) Digi-Key
4x5" FR4 perforated board (Twin Industries) 1 $14.31 438-1052-ND (MFG 8100-45-LF) Digi-Key
Plastic enclosure (Serpac) 1 $5.36 SR222-IB-ND (MFG 222I,BK) Digi-Key


To cut holes in the box for the switches and LED, a template was drawn, then taped to the box. Rectangular holes were first drilled through, then filed until they met the lines in the template. A scan of the layout template may be downloaded here: qubit_emulator_layout_template.tif.

Once the holes are cut, the switches and LED are installed in the box.

The prototyping board then needs to be cut to size, at which point the electronics may be assembled.

The completed device is shown below: