Module 4 - Multiple Qubit Gates Notes
Module 4 - Multiple Qubit Gates Notes
The qubit |A⟩ is called control qubit and the qubit |B⟩ is the target qubit.
The target qubit is altered only when the control qubit is |1⟩.
The control qubit remains unaltered during the transformations.
[ ]
1 0 0 0
0 1 0 0
U CN =
0 0 0 1
0 0 1 0
| A , B ⟩ ®∨ A , BÅA ⟩
Consider the operations of CNOT gate on the four inputs |00 ⟩ ,|01 ⟩ ,|10 ⟩∧|11 ⟩
Here in the inputs to the CNOT gate, the control qubit is |0 ⟩ . Hence, no change in the state of the
target qubit |0 ⟩ .
Here in the inputs to the CNOT gate, the control qubit is |0 ⟩ . Hence, no change in the state of the
target qubit |1 ⟩.
1
Here in the inputs to the CNOT gate, the control qubit is |1 ⟩. Hence, the state of the target qubit flips
from |0 ⟩ to |1 ⟩
Here in the inputs to the CNOT gate, the control qubit is |1 ⟩. Hence, the state of the target qubit flips
from |1 ⟩ to |0 ⟩
Input Output
|00⟩ |00⟩
|01⟩ |01⟩
|10⟩ |11⟩
|11⟩ |10⟩
Swap gate
The Swap gate is two-qubit operation. Expressed in basis state, the Swap gate swaps the state
of the two qubits involved in the operation.
The matrix representation of Swap gate is as follows
[ ]
1 0 0 0
0 0 1 0
U SWAP=
0 1 0 0
0 0 0 1
The Swap gate is a combined circuit of 3 CNOT gates and the overall effect is that two input qubits
are swapped at the output
2
Input Output
|00⟩ |00⟩
|01⟩ |10⟩
|10⟩ |01⟩
|11⟩ |11⟩
If the control qubit is |A⟩ = |1⟩ then only the Z gate transforms the target qubit |B⟩ as per the Pauli Z
operation.
The action of controlled Z gate could be specified by a matrix as follows
[ ]
1 0 0 0
0 1 0 0
U Z=
0 0 1 0
0 0 0 −1
Input Output
|00⟩ |00⟩
|01⟩ |01⟩
|10⟩ |10⟩
|11⟩ -|11⟩
Toffoli gate
Toffoli gate is also known as CCNOT gate (controlled-Controlled-NOT).
It has three inputs out of which two are control qubits and one is the target qubit.
The target qubit flips only when both the control qubits are |1⟩.
The two control qubits are not altered during the operation.
3
The matrix representation, gate circuit and truth table of the Toffoli gate are as follows:
[ ]
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 0
UT=
0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 1
0 0 0 0 0 0 1 0
Truth table
Inputs Outputs
a b c a¢ b¢ c¢
0 0 0 0 0 0
0 0 1 0 0 1
0 1 0 0 1 0
0 1 1 0 1 1
1 0 0 1 0 0
1 0 1 1 0 1
1 1 0 1 1 1
1 1 1 1 1 0
Fredkin gate
Fredkin gate, also called controlled-SWAP gate, is a computational circuit suitable for reversible
computing.
It is universal, which means that any logical or arithmetic operation can be constructed entirely of
Fredin gates.
The Fredkin gate is a circuit or device with three inputs and three outputs.
The matrix representation, gate circuit and truth table of the Fredkin gate are as follows:
4
[ ]
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 0
0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0
0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 1