The Future of Computing: Quantum Gates

Alice Liu
13 min readNov 2, 2019

--

(an introduction to the appliance of postulATEs to quantum gATEs).

This is it, it’s almost here. The quantum era is finally approaching after a long and arduous journey. The gates have opened ever so slightly to reveal a small glimpse of the future of computing and its extremely large potential. Imagine being able to simulate physics, biology and chemistry in quantum systems for the discovery of new drugs, forming new materials, mapping proteins and the human mind. Limitless security will be created, new cryptographic systems will be made for the financial market. All with exponentially increasing computational speed.

The software of quantum computers

Processing simulations within the software would run in a quantum computer, which are sophisticated machines that harness the laws of quantum mechanics. QC’s biggest potential is solving particular problems at a high computational speed that can’t be solved or be processed efficiently by regular classical computers.

Quantum algorithms are what powers these computers. These algorithms are made specifically for quantum computers that take advantage of quantum effects and phenomena. For example, a well-known quantum algorithm includes Shor’s Factoring Algorithm. This algorithm is able to factor extremely large numbers in a matter of minutes compared to a classical computer, which can take several years.

These algorithms are made up of quantum circuits which consist of quantum gates. Within these quantum gates are qubits, the smallest unit of the system. Quantum gates consisting of qubits can be compared to classical logic gates consisting of bits in a classical computer.

Before we jump in to regular logic and quantum gates, it is required to address the basic mathematical postulates of quantum mechanics (there are five main ones but we will be addressing the first three). The supporting mathematics is the backbone of the different QC developments and is extremely crucial to develop a basic understanding of it (so let’s embrace it, face it, and chase it)!

Key Takeaways of this section:

  • The biggest potential of using Quantum Computers are solving problems with high computational speed
  • Quantum algorithms are what power these computers ex. Shor’s Factoring Algorithm
  • Structure of algorithms: Algorithms → quantum circuits → quantum gates → qubits

Mathematical Postulates of Quantum Mechanics

The Greek alphabet mixed into the English alphabet with a dash of random-looking symbols. Ah yes, that is the beauty of the math behind quantum mechanics. And that’s exactly what the equations appeared to look like to me at the first glance, which was quite overwhelming.

Before diving into the mathematics, let’s address the notation commonly used in quantum mechanics.

Bra-Ket Notation

The bra-ket notation is used to describe a quantum state in terms of vectors. Vectors and matrices are still applied in the same way as well as certain properties including “vector addition, matrix multiplication and inner product.” The only difference is how the variable is written down.

The ket notation is used when representing a quantum state with a vector v is written as “ket v” or |v⟩, denoting the column vectors on the right in Dirac form (|>)

On the other hand, the bra notation is the conjugate transpose of ket, with “bra v” written as ⟨v|, denoting the row vectors on the left in Dirac form (<|)

The column vectors on the left represent the bra notation while the column vectors on the right represents the ket notation. The 0 and 1 just represent the two different quantum states.

Postulate 1

The state of a quantum mechanical system is specified by a wave function, described by unit vectors within separate complex Hilbert spaces.

A Hilbert Space is a vector space V (collection of all complex vectors closed with vector addition and scalar multiplication) that is equipped with an inner product.

A quantum state is defined by a gathering of all physical properties of a quantum system, which includes four main properties, 1) position 2) momentum 3) spin and 4) polarization.

With the appliance of vectors, Heisenberg’s uncertainty principle and exclusive states comes into play. Heisenberg’s uncertainty principle states that within value pairs of quantum objects, for example momentum and position, they cannot be determined at the same time. If you measure one, you cannot measure the other. So if you measure the momentum of a quantum object, you will not be able to measure the position and vice-versa.

On the left, the present position is clear but the future direction is unclear. On the right, the present position is unclear but the future direction is clear

For example, imagine taking a photo of a ball (or a pear, according to the image above) thrown in the air where the shutter speed can be changed. A very fast shutter speed (no blur) can tell you the exact location or position the ball is in but it’s appearance is pinned on the photo so you can’t tell how fast the ball is moving and what direction it’s moving to. If you take another photo with a slow shutter speed, the blur is clear and you can tell how fast the ball is moving, but not it’s exact position during that instant.

This means the exact position of the measurement of the ball and the exact speed of the ball are mutually exclusive and are classified as being exclusive states.

Qubits can then be applied with 1) computational basis and 2) superposition. The computation basis states that because a qubit represents two exclusive states, the vector representing quantum-0 and quantum-1 is 2-dimensional.

The quantum superposition principle can then be introduced, stating that if a quantum system can be in the state of |0⟩ it can also be in the state of |1⟩

  • |ψ⟩ represents a quantum state which is in the superposition of |0⟩ or |1⟩(states 0 or 1)
  • a and b represent probability amplitudes

Key Takeaways of this section:

  • Bra-ket is a notation describing a quantum state in terms of vectors: ket is expressed as |v⟩ while bra (the conjugate transpose) is expressed as ⟨v|
  • Postulate 1: A quantum system’s state is specified by a wave function described by unit vectors within separate Hilbert spaces
  • Heisenberg’s uncertainty principle: the value pairs of quantum objects cannot be simultaneously determined (ex. momentum and position, which are both in exclusive states)
  • Appliance with qubits: 1) Computation Basis → the vector representing the two quantum states is two-dimensional 2) Quantum Superposition principle → if a system is in the state of quantum-0, it can also be in the state of quantum-1

Postulate 2

The probability of finding a particle at a given point is directly proportional to the magnitude of a particle’s wavefunction (located at that point) squared. The wavefunction collapses into one state immediately after the measurement.

Born’s Law is incorporated in the second postulate, which states how likely the possible outcomes are when measuring the quantum system.

If we wanted to find out the state of the quantum system, we find the probability with:

The probability of measuring the state is given by the dot product of the amplitude and state squared.

Let’s apply this equation to a common example: Schrödinger’s famous cat.

Here, inside a sealed box is a cat, flask of poison and a radioactive source. An internal monitor is also used by detecting radioactivity. When radioactivity is detected, the flask releases the poison, killing the cat.

If the situation is like this, the probability that the cat is alive is ½ while the probability that the cat is dead is also ½.

Source: Looking Glass Universe

The cat after a while is dead and alive at the same time, but when one looks into the box, it collapses into one state, where the cat is either dead or alive (but not both).

As a result, quantum measurement is classified when applying Born’s rule with the wave collapse as a result.

This only assumes that the coefficients used are real numbers. We are, however, allowed to also use complex numbers. For real numbers in a number line, they are only allowed to point to the left or to the right while complex numbers are able to point in any direction, even diagonally. Basically, in a very simplified version, the probability of that particular state would be the length squared.

The length of the arrow can be written as d + ei. Imagine a coordinate plane where the x axis represents real numbers and the y axis represents imaginary numbers. In a sense, the d is the x value while the ei is the y value.

Postulate 3

Quantum operations are represented by unitary operators on the Hilbert Space

A quantum operation is able to transform one quantum state to another quantum state. Any quantum operation can be represented by a unitary matrix.

A unitary matrix is defined as having an inverse that is equal to its conjugate transpose

The complex square matrix U is unitary if the Hermetian conjugate U† of a matrix is also it’s inverse. The I represents the identity matrix.

Unitary matrices are central in quantum mechanics because they are able to preserve norms (function assigning strictly positive length/size to each vector within a vector space), and therefore able to preserve probability amplitudes.

Essentially, the matrices are what make up basic quantum gates and the operations within being matrix multiplication.

Key takeaways of this section:

  • Postulate 2: the probability of finding a particle at a given point is proportional to the magnitude of a particle’s wavefunction squared
  • Born’s law: likeliness of possible outcomes when measuring a quantum system
  • Quantum measurement happens when Born’s law is applied and the wavefunction collapses
  • Schrödinger’s Cat example: the probability of a cat being alive is 1/2 and it being dead is also 1/2, until someone looks into the box, the cat is classified as being simultaneously dead and alive
  • Postulate 3: Unitary operations on the Hilbert Space represent the quantum operations
  • Unitary matrices are able to preserve norms and probability amplitudes, and are what make up quantum gates

Quantum Gates

Pauli Gates

The Pauli matrices are mostly used for calculating the changes to the spin of a single electron. The matrices are generally simple, as Pauli Gates act on only one qubit at a time, leading to 2 by 2 matrices with only 4 total elements.

The representation of a gate (Pauli-X Gate, Pauli-Y Gate and Pauli-Z Gate) is visually shown with a Bloch Sphere

Pauli X-Gate

The Pauli-X Gate is the quantum equivalent to a NOT Gate in classical computing, the only operation being used is negation. Generally speaking, the X-gate turns the spin-down state into a spin-up state and vice-versa (similar to turning a light switch on and off). The nature and function of this gate gives it the name of “bit-flip.”

The Pauli-X Gate represented by a Bloch sphere equates to a rotation around the X-axis by π radians.

It maps |0> to |1> and |1> to |0>

Pauli-Y Gate

The Pauli-Y Gate compared to the Pauli-X Gate has an i in place of the 1, with a negative sign on the first row, second column.

Represented by a Bloch sphere, it equates to a rotation around the Y-axis by π radians.

With mapping, it turns|0> to i|1> and |1> to -i|0>

Pauli-Z Gate

The Pauli-Z Gate is the mirror image of the Pauli-X gate but with a negative sign on the bottom right.

The mapping from |1> to -|1> while keeping the basis state of|0> the same gives the name of “phase-flip.”

In a Bloch sphere, it equates to a rotation around the Z-Axis by pi radians.

The Hadamard Gate

The Hadamard Gate, unlike the Pauli Gate has quantum characteristics that are able to transform a definite quantum state into a superposition of states, since the measurement has equal probabilities to become 0 or 1. For example, transforming a spin-down state into a state that is both spin-up and spin-down at the same time.

Notation of the Hadamard Gate

In terms of mapping, it maps basis state |0> to (|0> + |1>)/sqrt(2) and |1> to (|0> — |1>)/sqrt(2).

On the Bloch sphere, the first is a pi rotation about the Z-axis while the second rotation is a pi/2 rotation about the Y-axis.

Additionally, it transforms initialized qubits back in their natural state, the Hadamard gate commonly performing the first computation in a quantum program.

Key Points of this section:

  • Pauli Gates: contain matrices used for calculating changes to the spin of an electron and are relatively simple
  • Types of Pauli Gates: Pauli X-Gate, Pauli Y-Gate, Pauli Z-Gate
  • Hadamard Gate: transforms a quantum state into a superposition of multiple states

Reversible Gates

The next three gates are all examples of reversible gates. Regular classical computers that run irreversible logic gates often have the side effect of unwanted, extra heat produced based on the chip design. A solution to this are reversible gates, containing a unique input that is associated with a unique output. This way, reversible gates cannot erase any information while acting. In addition, energy can be recovered in a way that a computation is run forward to get an answer and once that answer is copied, the whole computation can be reversed or undone to recover all the energy from copying the answer at the mid-way point.

Controlled Not-Gate

The CNOT Gate Matrix compared to a regular NOT Gate

A controlled Not-Gate or CNOT gate is acted on 2 qubits. It’s role is to perform the to flip the bit value of the second bit only if the first bit is set to 1.

The remaining value is left unchanged if not applicable. The name of “controlled” comes from how the decision to negate the second bit is dependent or controlled by the value of the first bit.

Controlled Not-Gates have the potential to be used to entangle and disentangle EPR states.

SWAP Gate

Matrix for SWAP Gate

The SWAP Gate is a 2-input 2-output gate. Expressed in basis states, the SWAP gate swaps the state of the two qubits involved in the operation.

The SWAP gate simply exchanges the bit values it is handed.

The icons for a SWAP gate are represented using circuits

On the left, the SWAP gate conveys the idea of crossing the wires where the bits are located in order to swap the two bits. In addition, this gate can also be obtained by a sequence of three CNOT gates which is displayed on the right.

FREDKIN/TOFFOLI

There are two main gates used for classical reversible computing, the smallest of these gates with the characteristics of reversible and universal need three input and three outputs.

The Toffoli gate is represented with its unitary matrix and icon (which is both reversible and universal)

The first gate is the TOFFOLI or the Controlled-Controlled-Not gate. Here, the third input bit is flipped only if the first two input bits are the value of 1. The third input bit is affected based on the controlling of the first two bits, if the first two bits are in the state of |1>it applies a Pauli-X (NOT) on the third bit. The TOFFOLI gate turns universal when combined with a single-qubit Hadamard gate.

The Fredkin Gate represented with its unitary matrix and icon (also both reversible and universal)

The second gate is the FREDKIN or the Controlled-SWAP gate, It only swaps the values of the second and third bits only if the first bit is set to 1.

Truth tables for the Toffoli and Fredkin Gate. For both tables, the A, B and C represent input values while the X, Y and Z represent output values.

These are a few common gates that we reviewed with their notation and matrix:

This is only the beginning however, and there are plenty of other quantum gates you may come across. These ones may operate on a few qubits at a time and with complex-number elements which can be a lot more complicated.

Other common quantum gates include:

  • Square root of NOT Gate
  • Square root of SWAP Gate
  • Phase Shift Gate
  • Ising Coupling Gates
  • Deutsch Gate

Key Points of this section:

  • Reversible gates are efficient in a way that energy from computations run on a computer are recovered
  • Examples of reversible gates are the controlled Not-Gate, SWAP Gate, and Fredkin/ToffoliGates
  • Their complexity is determined by the number of qubits they act on at at time

The Problem with Quantum Computers

Ok, great. We seem to have a basic understanding of the software of quantum computers, how quantum gates and their circuits work, and even a few quantum-computer exclusive algorithms were created.

The concept of quantum computing did reach back into the 1980s when it was first proposed by physicist Paul Benioff, which was almost 40 years ago.

Quantum computers are able to contain many, many, many more logic gates compared to regular classical computers and in addition to it, and have the potential to calculate and solve problems in speeds much faster than the computers we used today.

So with all that time and potential, where is my quantum computer?

The reason is because of loss of quantum coherence, better known as decoherence, from errors, which is what makes these computers hard to engineer and program. Decoherence is caused by temperature change, electromagnetic waves, interactions with an outer environment, vibrations, and basically any other small disruption which destroys the quantum properties of the computer. Because of this decoherence issue, current quantum computers have difficulty running to completion and returning correct answers which makes it hardly any better than a classical computer.

However, with developments including more qubits (from 64 to 1024), greater connectivity with fewer restrictions, a lower error rate and a greater circuit depth are continuing to be made. Progress is continuing to be made, even reflecting back on history with transistors. Think about it, if the first transistor was made in 1947, the first integrated circuit coming along in 1958 and the first microprocessor (having 2,500 transistors) arriving in 1971, these huge achievements each only a decade apart. Quantum computing may just be around the corner, waiting, with availability coming in the next 10–15 years. At this point, the making and progress can only accelerate.

If you liked this article, add a clap and stay in tuned for more articles coming soon!

Reach out to me at aliceliu2004@gmail.com or on LinkedIn

--

--