Basic Logic gates(non quantum gates)
Single Input Gates
- NOT Gate

#Not gate inverse the output. If the input is "1" then the output is "0" and vice versa.
- FANOUT(copy gate) and ERASE gate.

#Fanout gate copies the input to two or more output.
#Erase gate simply erase or reset the gate to 0.
Two-input Gates
- AND gate
#If both the inputs are "1" then the output is "1", otherwise "0".
- OR gate

#If either one of the input is "1" or both the inputs are "1", then the output is "1", otherwise the output is "0".
- XOR Gate
#If both the inputs are same then the output is "0", otherwise the output is "1".
- NOR gate

#It inverse the output of OR gate. If both the inputs are "0", the output is "1" otherwise the output is "0".
- NAND gate
#It inverse the output of AND gate. If both the inputs are "1", the output is "0", otherwise the output is "1".
Quantum Gates
A quantum gate is basic building block of quantum circuit like the logic gate. In case of a quantum gate it is reversible, whereas conventional logic gates are not. Reversible means that if the measurements are not according to a circuit, a reversal of the quantum circuit will undo the operation. A quantum gate is represented by a unitary matrix.
The vector representation of a single qubit is:
The vectors v0 and v1 determine the probability of measuring a 0 or a 1, when measuring the state of the qubit.
The value zero is represented by
The value one is represented by
The combined state of two qubits is the tensor product of the two qubits. The tensor product is denoted by the symbol .
The vector representation of two qubits is:
The action of the gate on a specific quantum state is found by multiplying the vector which represents the state, by the matrix
representing the gate. The result is a new quantum state
.