Quantum Computing Blog 5: Building blocks of quantum information processing: Quantum Gates – A teaser

This is the fifth in a series of blogs that I will be writing for everyone to get a basic understanding of this immensely important research field which is poised to become mainstream in a few years and significantly impact our daily lives.

In my previous blog, I gave a high-level view of why we need to use quantum computers at all in the first place, when there are so many powerful supercomputers available for use. In this blog, I will introduce the building blocks of quantum information processing, namely, quantum gates. There are some important mathematical concepts involved in the definition and functioning of quantum gates. I will be talking about those in forthcoming blogs.

Before I delve into quantum gates, let’s do a quick review of the well-known classical, digital or logic gates. As we all know, these are the fundamental building blocks of all smart digital devices including computers, mobile phone, tablets and so on that we use daily. All information processing in digital devices which use classical bits is done using gates. Gates are basically electronic circuits which have at least one input and exactly one output. The reason why they are also called as logic gates is because the input and output values can be taken as “True” or “False”. Conventionally, in computer architecture, True is given a numerical value 1 and False has a value 0. I had mentioned in my first blog, that 0 and 1 are the representation of the classical bits, which are the basic units for all information processing in classical computers and other digital devices. Continuing further, since a gate does not have memory, (that is, it does not retain any information that it received earlier) the value of the output depends solely on the inputs that are given to the gate. This helps in building a truth table which mathematically represents the functionality of the gate. In mathematics and mathematical logic, Boolean Algebra is that branch of algebra in which values of the variables are the truth values True and False denoted by 1 and 0 respectively [1].

The gate with one input and one output is called as the NOT gate. Its function is to reverse the value of the input given to it. That is, if a value 0 (or False) is given as input, the output returned is 1 (True) and vice versa. The truth table for the NOT gate is given in Table 1 below. The gate is represented diagrammatically in Fig 1.

                             Table 1                                                                                             

Input X Output Y
0 (False) 1 (True)
1 (True) 0 (False)

                            Figure 1

There are numerous gates with 2 inputs and 1 output. Some of the standard two input gates are AND, OR, XOR, NAND and NOR. As the name suggests, the AND gate returns a value of 1 (True) only when both inputs are 1 otherwise it returns 0. In case of an OR gate, the output is 1 when either one or both of the inputs is 1.  An XOR (also called as an exclusive OR) gate is a special case of the OR gate. The XOR gate returns a value 1 only when one of the inputs is 1. Otherwise it returns a value 0. There are other gates such as NAND and NOR gates which give outputs exactly the reverse of the AND and OR gates, respectively.  Another important aspect to be kept in mind is about universal gates. A universal gate is a gate using which one can implement any other gate. The NAND and NOR gates are universal gates. For more information on logic gates please refer to [Ref 2].

Now let’s come to quantum gates. In a quantum computer, in analogy to a classical computer, information is processed by using quantum gates. We have seen earlier, that a classical gate transforms one or more inputs (which are bits) to an output (which is again a bit), through a Boolean algebraic transformation. In a similar manner, at the fundamental level, quantum gates are used to transform qubits from one state to another. Mathematically what this means is that a quantum gate is a transformation operator which transforms a qubit from one quantum state to a different quantum state. One important difference to note in quantum gates in comparison to classical gates is that one can have more than one output in a quantum gate, unlike only one output in classical gates.


We saw above that the mathematical construct of classical gates is Boolean Algebra. For quantum gates the mathematical construct is matrix operations, specifically unitary operations. I will be giving the mathematical foundations of two-level quantum states, qubits and related mathematical constructs and matrix operations in my next blogs.


Before I leave you hanging with anticipation, let me mention some of the one, two and three qubit quantum gates. Examples of the one qubit gates are the Identity gate, X gate (also called the quantum NOT gate), Y gate, Z gate, and Hadamard gate. An example of a two qubit gates is the CNOT or the Controlled NOT gate. Examples of three qubit gates are Fredkin gate and Toffoli gate.


Look forward to sharing more interesting stuff in my later blogs…….



  1. https://en.wikipedia.org/wiki/Boolean_algebra
  2. https://en.wikipedia.org/wiki/Logic_gate