Quantum Operations
Part of Womanium Quantum + AI 2024 program
Representation
A quantum operation can be represented as a matrix
Thus, unlike classical operations, all quantum operations must be reversible.
Multiple Qubits
As we did in classical bits, we can represent multiple qubits as a tensor product of their vectors.
Example:
This can also be seen when using other representations, such as:
A classical computer can efficiently simulate a quantum system as long as it's guaranteed that the system will always be in a decomposable state, meaning we can represent the system state as the tensor product of multiple states, that's done by storing one amplitude of each qubit.
Quantum Gates and Operations
Hadamard Gate
The Hadamard gate is used to put a qubit in superposition, it transforms a qubit in the 0 or 1 state to an equal superposition of both 0 and 1.
It can also be defined as a reflection on the unit circle around the line
such that
Hadamard Basis:
X Gate (Pauli-X Gate)
The X gate acts like a NOT gate, swapping the
Z Gate
The Z gate flips the local phase of a qubit, adding
CNOT Gate (CX)
Controlled-NOT gate is a 2-bit gate, control bit and target bit , it applies an X gate to the target bit if the control bit is in the
CNOT gate is part of a class of gates called controlled gates, where the application of a gate relies on the state of one or more control bits. Another example is the Controlled-Z gate.
RY Gate
The RY gate is a rotation operator along the y axis.
When rotating a real-valued qubit by
Reflection Operator
An arbitrary reflection can be done around a line. Let
Notice that
The reflection operator can be represented as the following sequence of gates
Unitary Evolution
Applying a quantum operations on a quantum device is called unitary evolution, and will result in changing the system state from
to
Multiple-Control Construction
We can construct a gate (such as the CNOT gate) to be controlled with multiple control bits and even have the control active in state
C0NOT Gate
To create a C0NOT gate, we can simply "move" the X gate matrix entries in the
Alternatively we can apply an X operator on the control bit before the CNOT gate then apply another X operator on the control to return it back to it's original state.
CCNOT Gate (Toffoli Gate)
In a Controlled-Controlled-NOT Operator, the NOT gate applies when both of the control bits are in the
The matrix of the CCNOT gate is as follows:
The matrix only flips the state of the target in the last section, i.e. when both of the control bits are in the
A
Similarly a gate with
Classical Operations as Quantum Operations
We must ensure that we are able to transfer our classical experience and knowledge to quantum computing, therefore we need to be able to implement classical gates as quantum operations.
This is not a straight forward task, since all quantum gates must be reversible, and that's not the case with classical gates.
Applying a classical AND gate to two bits results in one bit that can not be reversed back to the original two bits.
We do this by changing the model of the gate so that, instead of the output being only the result of applying the gate, we output all the input bits in addition to the result bit. This way, we ensure that we are not losing any information after applying the gate.
This concept can be used to implement all classical gates. In fact, it can be used to implement any irreversible gate.
As shown in the figure we feed the gate
This operations is reversible by applying