Ket vis

Pure states visualized with BraKetVue

Piotr Migdał (Quantum Flytrap) , Klem Jankiewicz (Quantum Flytrap)

Ket states for qubits

We start with a 3-qubit state:

Now, let’s apply Hadamard gate to the first qubit. Here is the resulting sta

Now, let’s apply CNOT gate to the first two qubits:

Finally, we apply Toffoli gate to all three qubits:

Ket list

Or, if you prefer to have all operations in one place:


And if you wonder, JavaScript code to make the computation is as simple as:

const { Circuit } = QuantumTensors;

const circuitHistory = [];
  .CNOT(0, 1)
  .TOFFOLI(0, 1, 2)

Full documentation is in For quantum circuits, see:


If you’ve ever wondered how does the Hadamard matrix look like, here’s one:

If we have three qubits, the operator acting on them is \(H \otimes I \otimes I\), that is: