In Classical Computing, classical gates are used to perform operations on one or many bits. Similarly in Quantum Computing, Quantum Gates are used to perform a reversible operation on one or many Qubits. OpenQASM provides a few in-built Quantum Gates. In this chapter of the OpenQASM Tutorial, you will be learning in brief about the Quantum Gates in OpenQASM. In subsequent chapters of this OpenQASM tutorial, you will be learning in depth about using these Quantum Gates in OpenQASM.
There are various standard Quantum Gates in the field of Quantum Computing which are used for creating Quantum Algorithms. However, not all of these Quantum Gates are fundamental Quantum Gates. Fundamental Quantum Gates are Quantum Gates which can be used to create other Quantum Gates.
OpenQASM provides the following two in-built Quantum Gates-
- U Gate
- CX Gate
The U Gate is a Quantum Gate that can be used to change the state of a Qubit. The CX Gate is a Quantum Gate that is used to entangle the states of two Qubits. Both of these Quantum Gates are fundamental Quantum Gates. By using the U Gate and CX Gate, you can create any other Quantum Gates.
In fact, a standard OpenQASM 2 library qelib1.inc uses the U and CX fundamental Quantum Gates for creating the most commonly used and some less commonly used Quantum Gates.
In the subsequent chapters, you will be learning in detail about the U Gate and CX Gate.