- Last Modified: July 14, 2022

Logic gates are a necessity for any kind of computational hardware and are the fundamental components that allow state changes from, say 01001001 to 10110110 (inversion). Classical logic gates are built using transistors, and this technology has existed for a very long time. Quantum logic has been known about in a mathematical form for quite a while, developed by Paul Dirac in the form of Bra-Ket algebra, which turned out to be exceedingly useful for computation and logic, though it’s hard to explain how the logic really works. The magic is in the large arrays of 1’s, 0’s and *i’s *that represent the gates and their functions. Let’s look at some examples.

As you can see in this illustration, two transistors act as gates. When both are on, the signal output is also on– otherwise, it is off. This example of a C-Gate is called an “AND-gate”. It doesn’t take much imagination to find a use for even *just *this gate.

Q-Logic gates, by comparison, act on a state superposition (see “What is a Quantum Computer and Why Can’t I Have One?!”) using what are called “quantum operators”. These operators usually take the form of arrays of ones and zeros, often multiplied by 1/sqrt(2) (we can see why later). They operate on state vectors which are columns of numbers representing the state.

Two or more qubits can be combined by their tensor product which really just combines them into vectors with 2^n entries for each possibility of the N qubits. So for just two qubits, you get 2^2=4 possible states, which you can think of as on and off, namely |00>, |01>, |10>, and |11> and each of these states is in some superposition with the others where their total sum of amplitude is * ALWAYS *exactly 1. You can see below what happens when you combine three ket vectors, in this case we can call them |x’>, |y’>, and |z’>.

You can see that the final result is all of the possible combinations of x, y, and z being either 1 or 0, and each successive step gives twice as many states. It would take a rather long time to write all this out for a large number of qubits, as even a 10-qubit system has 2^10=1024 states when you take the tensor product. Without getting too technical, this just creates an array.

Measurements collapse the array down to a specific state, let’s say |10010010>, but it’s not always useful to think of a state in the original |1> and |0> basis. The Hadamard Gate switches between this basis and the |+>/|-> basis which in terms of the Bloch Sphere represents a rotation of the sphere in space so that the +/- basis is facing up and down.

So what we end up with is a set of states that have some combination of the 1/0 basis out of just the |1> and |0> base kets. Other gates like the Pauli gates simply rotate the sphere in either the x, y, or z axis by some amount.

It can also be useful to change the outcome of a 2-or-more-qubit state and this can be done with other gates. An example is the controlled-NOT gate, which is much different from the classical NOT gate. The NOT gate is simply an inversion operator, as mentioned at the beginning. The CNOT works more like the Reversible-OR (XOR) operator and it has the effect of flipping the second bit if the first bit is |1>. They have the same truth tables.

So really, Q-gates have the effects of flipping, rotating, forming superpositions in various bases in three dimensions based on the degrees of freedom of particle spin. These are essentially represented by the 0, 1, and i directions like so:

In a future article, I will explain what I’ve learned so far about actually making these sorts of gates, since it’s all good and well to know the algebra of the gates themselves, but building the machinery that will perform the computations using physical systems is much more involved. So far, I’ve learned that this is mostly done by superconductor coupling junctions called Josephson Junctions.

As I study more on the hardware involved in making Q-Computers and qubit architectures, I will roll out more articles explaining some of the physical/quantum-mechanical effects that are manipulated. For now, this has been a closer look at some of the mathematical logic that goes into the computation using qubit systems.