### What are quantum logic gates?

With classical computing, different logic gates are used to perform operations on bits. Some of the common gates in classical computing are: AND, XOR, OR, CNOT, NOT, NAND, etc. These gates are at the base of how a system is able to manipulate 1s and 0s to perform useful calculations. Some of the gates are known to be reversable, meaning that you can take the result and derive what the original was, and non-reversable, which is when it is impossible to use the result to determine what the past inputs were. Here is an example of an AND gate (non reversable)

This has a unique consequence with quantum computation. These gates are put together to form circuits. With quantum computing, the same basic concept is needed; however, the way in which those concepts are fulfilled is a bit different as compared to the classical counterpart.

**Quantum Gates/Operators**

In order to manipulate the qubits, there needs to be a way to manipulate them. With quantum gates, this becomes possible, although it is not very straight forward. Some examples of quantum gates are:

One interesting issue that occurs with quantum gates, is that unlike the classical gates, all quantum gates must be reversible. Remember the AND gate? Since it is not reversible, it would not work in quantum computing.

In a previous article that talked about the basics of superposition and entanglement, the CNOT gate was mentioned. The reason that this particular gate is important is that it takes 2 qubits and entangles them and of course, entanglement is the effect that makes a quantum computer superior with very large complicated calculations. Here is a diagram of what this gate looks like:

When this gate or operator is used, it will do nothing if the qubit is q0 == |0> as it will simply pass through. If q0 == |1>, we pass through and perform a paulX swap on q1, reversing the identity matrix going through the top left wire

The result is an entangled state, also known as a bell state. The terms used for the input vs output bits are control and target qubit.

As can be seen in this very basic explanation, there are obvious differences between quantum and classical computing logic gates and how they are used. There are other things to take into consideration, for example the no cloning rule, must be reversible and so forth. Future articles will take a deeper dive into quantum computing, demonstrating the mathematics behind it and including the code to demonstrate the concept.