Qubits Mod Blocks

Qubit Block

The qubit block is the most important block in the mod, as all other blocks connect to it. The qubit block represents one quantum switch, which can be on, off or a combination of the two. The number on the block shows the probability that it will be on when measured (rounded to the nearest 10%).

Maths

There is a lot more to a qubitโ€™s state than just itโ€™s probability however. Each qubit on its own is stored with two numbers. (It gets even more complicated when qubits interact with each other.) If you square the top number, you get the probability that when measured, this qubit will be on. If you square the bottom number, you get the probability that when measured, this qubit will be off. These numbers can also be negative or complex. (If it is complex, the magnitude squared is the probability.)

Quantum Tendril

Quantum tendrils act as an extension to the qubit block, allowing gates to be connected to it. Qubit blocks cannot be connected together with tendrils.
Quantum tendrils cannot currently go up or down, so must lie on a flat plane.

Not Gate

Not gate blocks act on the qubit block they are connected to. Not gates swap the probabilities of being on and off. They are activated by redstone.

Maths

The not gate (and most other gates) can be represented by a matrix. When you apply the gate, you multiply the matrix for the gate by the vector for the qubit.

Hadamard Gate

Hadamard gate blocks act on the qubit block they are connected to. hadamard gates create/cancel basic superpositions. They are activated by redstone. If a qubit is originally 100% off, then the hadamard gate will make it 50/50. Applying the hadamard gate again will get the qubit back to 100% off.
If a qubit is 100% on, then the hadamard gate will make it 50/50. Applying the hadamard gate again will make the qubit 100% on again.

Maths

The hadamard gate (and most other gates) can be represented by a matrix. When you apply the gate, you multiply the matrix for the gate by the vector for the qubit.
Notice if you apply a hadamard gate to (โˆš0.5 ๐‘‚๐น๐น+ โˆš0.5 ๐‘‚๐‘), the ๐‘‚๐‘s cancel, making the qubit 100% off.
Notice also that applying the hadamard gate twice will always do nothing.

Gate Control

Gate controls must be placed next to another gate (but not next to a measurement). The attached gate will now only act when the qubit block the control is attached to is on.
controlled nots can be used to entangle two qubits: In this setup, first, a hadamard gate is applied to the bottom qubit, this creates a superposition of ON + OFF in the bottom qubit. A controlled not is then applied to the two qubits, and since the top qubit only changes when the bottom qubit is ON, the two qubits are now ON, ON or OFF, OFF. This is entanglement, where the two states arenโ€™t independent of each other.

Maths

When there are two qubits involved instead of each being represented by a 2d vector we represent both in one 4d vector. Thus a controlled not gate can be written using the following matrix:

Measurement

A measurement may be used to measure a qubit block and get a redstone output from a qubit. The measurement is updated when the redstone input is on, and the output of the measurement can be obtained using a comparator.