Quantum (logic) gate is a [quantum computing](quantum.md) equivalent of a traditional [logic gate](logic_gate.md). A quantum gate takes as an input *N* [qubits](qubit.md) and transforms their states to new states (this is different from classical logical gates that may potentially have a different number of input and output values).
Quantum gates are represented by [complex](complex_number.md) [matrices](matrix.md) that transform the qubit states (which can be seen as points in multidimensional space, see Bloch sphere). A gate operating on *N* qubits is represented by a *2^N*x*2^N* matrix. These matrices have to be **unitary**. Operations performed by quantum gates may be reversed, unlike those of classical logic gates.
We normally represent a single qubit state with a **column** [vector](vector.md) *|a> = a0 * |0> + a1 * |1> => [a0, a1]* (look up bra-ket notation). Multiple qubit states are represented as a [tensor product](tensor_product.md) of the individual state, e.g. *|a,b> = [a0 * b0, a0 * b1, a1 * b0, a1 * b1]*. Applying a quantum gate *G* to such a qubit vector *q* is performed by simple matrix multiplication: *G * v*.