Qiskit: Quantum Gates

Like Classical Computing, Quantum Computing also has gates. To differentiate them from their classical counterparts, we will frequently refer to them as Quantum Gates. Quantum Gates are used for manipulating the state of a Qubit. A Quantum Gate applied on a Qubit in a particular state can change the state of a Qubit. Although in some cases, a particular gate might not change the state of a Qubit in a particular state. In this chapter of the Qiskit Tutorial, you will get a brief overview of the various Single Qubit Quantum Gates. The following chapters will discuss some important Single Qubit Quantum Gates in detail. Several Quantum Gates also act on multiple Qubits, these will be covered in a later chapter.

Quantum Gates

Quantum Gates can be represented by a matrix. This matrix can be used to determine the effect of the Quantum Gate on a particular state. The new state of the Qubit can be known by multiplying the matrix for the Quantum Gate by the state of the Qubit.

Example

In the following example, we calculate the new state of a Qubit after the application of X Gate on a Qubit in the state |0>. The new state ψ is calculated by multiplying the matrix for X Gate, represented by X with the state vector of the Qubit. The new state of the Qubit is |1>.

Applying X Gate on a Qubit and calculating in output state.

To summarize, the X Gate changed the state of the Qubit from |0> to |1>

Effect of Quantum Gates

Applying Quantum Gates on a Qubit can have an effect on the state of those Qubits. This change of state can be represented by the change in the state-vector of the Qubit or its representation on the Bloch Sphere.

Example

In the following example, we consider the effect of the application of the X Gate on its Bloch Sphere Representation. The original state of the Qubit is |0>. After the application of X Gate, the state of the Qubit changes to |1>. This change can be seen in the state-vector representation of the Qubit. In the original state |0>, the state-vector pointed along the positive Z-axis. In the final state |1>, the state-vector pointed along the negative Z-axis.

Effect of the application of Quantum Gates on the Bloch Sphere Representation of the state of Qubit
Effect of the application of Quantum Gates on the Bloch Sphere Representation of the state of Qubit

It’s alright if you don’t know what is X Gate. You will get to know about the X Gate and various other gates in the following chapters. It is sufficient to know for now that applying Quantum Gates on Qubits can change the state of the Qubit.

Table of Single Qubit Quantum Gates

The following table covers various Single Qubit Quantum Gates in brief.

Quantum GateSymbolEffect on the Bloch SphereComments
XXRotates the State vector by π radians about the X-axis in anti-clockwise direction.It is also known as NOT Gate and Bit flip gate because it reverses the probabilities of measuring 0 and 1 on measurement. Learn More
YYRotates the State vector by π radians about the Y-axis in anti-clockwise direction.It is also known as Bit and Phase flip gate because it performs both, phase flip like Z Gate and bit flip like X Gate. Learn More
ZZRotates the State vector by π radians about the Z-axis in anti-clockwise direction.It is also known as Phase flip gate because it flips the phase of a Qubit. Learn More
IdentityI or IdNo effect on State vector.It is useful when no operation is to be done on a Qubit. Learn More
HadamardHRotates the State vector by π radians about the XZ-axis in anti-clockwise direction.It maps X-axis to Z-axis and vice versa. Learn More
RXRXRotates the State vector by given radians about the X-axis in anti-clockwise direction.It is a parameterized Gate. It performs rotations about X-axis by different amounts depending on the parameter. Learn More
RYRYRotates the State vector by given radians about the Y-axis in anti-clockwise direction.It is a parameterized Gate. It performs rotations about Y-axis by different amounts depending on the parameter. Learn More
RZRZRotates the State vector by given radians about the Z-axis in anti-clockwise direction. *It is a parameterized Gate. It performs rotations about Z-axis by different amounts depending on the parameter. Learn More
PhasePRotates the State vector by given radians about the Z-axis in anti-clockwise direction. *It is a parameterized Gate. It performs rotations about Z-axis by different amounts depending on the parameter. Learn More
SSRotates the State vector by π/2 radians about the Z-axis in anti-clockwise direction.It is also known as the Square-root of Z Gate. This is because applying S Gate twice has the same effect as a Z Gate. Learn More
S DaggerSdg or S†Rotates the State vector by π/2 radians about the Z-axis in clockwise direction.It is the inverse of S Gate. Learn More
TTRotates the State vector by π/4 radians about the Z-axis in anti-clockwise direction.It is also known as the fourth-root of Z Gate. This is because applying S Gate four times has the same effect as a Z Gate. Learn More
T DaggerTdg or T†Rotates the State vector by π/4 radians about the Z-axis in clockwise direction.It is the inverse of T Gate. Learn More
SXSXRotates the State vector by π/2 radians about the X-axis in anti-clockwise direction.It is also known as the Square-root of X Gate. This is because applying SX Gate twice has the same effect as an X Gate. Learn More
SX DaggerSXdg or SX†Rotates the State vector by π/2 radians about the X-axis in clockwise direction.It is the inverse of SX Gate. Learn More

* The RZ and Phase Gates have the same effect on a Qubit when applied with the same parameter. The difference between them is that their multi-Qubit versions have different effects. For example, a CP Gate will have a different effect as compared to a CRZ Gate. You will learn more about this in later chapters.