What's all this then? |
Sample Circuits
## Help!

### tl;dr

### Features

#### Amplitude Indicators

#### Observations

#### Editable Circuits

#### Transition Diagrams

This is a quantum circuit simulation intended to help learn how quantum circuits work and develop intuition for them. Explaining quantum computing from scratch is out of scope here, but perhaps this simulator can be helpful as a supplement.

Drag the circle/vertical-bar to move time forwards and backwards. Click on the input kets to change the value of the input qubits. Double-click the time-bar-handle (the circle) to show transition diagrams for the current gate.

The primary thing I wanted to experiment with when building this was the usage of a circular clock-like display to show the complex amplitudes that make up the quantum state at a given point in time. I found this to be a helpful way of visualizing quantum states for basic circuits internally, and hoped that building a simulator with the feature would be even more helpful.

Complex amplitudes are displayed with a circular indicator (representing the unit circle in the complex plane) containing an arrow, which is a polar representation of the complex number. An inner shaded circle represents the square of the absolute value of the amplitude.

When observation gates are included in the circuit, the simulator will choose a random observation based on the amplitudes. The observation can be reset so that the user can see the effect of repeated runs of the circuit.

The app supports creating your own circuits as well as permalinks to circuits.

To aid in understanding the effect of a particular gate, you can double-click the drag handle while the time-bar is over the gate of interest, and it will show a diagram with the effect of the gate on each component of the state.

- Basic Entanglement
The circuit entangles two qubits such that they have the same non-deterministic value, then observes both of them. Note that until the qubits are observed, they do not have a determined value, despite the fact that their values are guaranteed to match.

Changing the second qubit's input to 1 gives a circuit where the qubits are still entangled but their values are guaranteed to be opposite.

- Double Hadamard with and without observation
This is the simplest example of an observation changing the state of the system. Two Hadamard gates in row will cancel each other out if there is no observation in between.

If there is an observation, then the state collapses and the second Hadamard leaves the qubit in superposition.

- Quantum Teleportation
Alice and Bob are assumed to share an entangled pair of qubits (the second and third wires). Alice has a qubit (the first wire) she wishes to send to Bob.

The first two sections of the circuit are setup. The first section puts Alice's qubit into a non-trivial state (you can change these gates to do whatever you want to the first qubit). The second section creates the entangled pair.

The rest of the circuit is the actual teleportation. Alice entangles the qubit she wants to send with her half of the entangled pair, then observes both of them (yielding two classical bits). She sends these classical bits to Bob, who performs up to two transformations on his qubit based on the values from Alice. At this point his qubit is in the same state that Alice's was when the computation started.

- The 3/8 thing
This circuit is a counterexample to the assumption that probabilities in quantum circuits are alway binary fractions. After the final observation, the state of the four qubits is either a superposition of three or five possibilities, each with a one-third probability or one-fifth probability, respectively.