You’re Thinking So Classically
Getting started with Quantum Computing may seem intimidating and just plain puzzling if you looked online where start, you were probably lead to the same results I did when I first started getting into quantum computing. Everywhere I looked said, to get started, I need to have some good knowledge about quantum physics, quantum mechanics, and basic linear algebra. Once I did, I needed to learn how to use Qiskit (Python library to program quantum computers) or another programming tool to start building quantum circuits and implementing quantum algorithms! And don’t let me get started on needing to learn how quantum algorithms work!
Things got very complicated very fast, which can be quite discouraging! 😖
But…
What if I told you that you could start building quantum circuits, with only basic knowledge of basic quantum gates and without any kind of coding?
Yes 🤩
You read it correctly; we will build quantum circuits without using any code what so ever.
The way to do that is by using special tools called quantum circuit simulators. To use any of those tools, you only need to know the definition of the three basics of quantum computing, qubits, superposition and entanglement, and what some basic quantum gates do.
We will start with the basics of quantum computing:
- Qubits: The basic unit of data in quantum computing. A qubit can be either in state |0⟩ or state|1⟩ or a superposition of both states.
- Superposition: A term that refers to when a physical system exists in two states at the same time.
- Entanglement: When two or more qubits share a special connection.
You can find more in-depth information about qubits, superposition, and entanglement in my article "The Three Pillars of Quantum Computing."
Now that you know the fundamentals of quantum computing, we can start talking about basic quantum gates and then start building some circuits using them.
Quantum Gates

There are many quantum gates out there; you can even create your custom gates once you fully understand the basic ones. Quantum gates are the building blocks of quantum circuits. They are operators that perform a specific function on one qubit or more. They are the quantum equivalent to classical logic gates, which are used in all Technology today. However, unlike most classical logic gates, quantum gates are reversible, which means you can undo their effect by reapplying on the same qubits.
Mathematically, quantum gates are represented using unitary operations. Unitary operations simply are square matrices (matrices with an equal number of rows and columns). On the other hand, the state of qubits is represented as a vector. Vectors, geometrically speaking, usually have an amplitude and a phase the represents its 3D location in space. To find the results of applying a gate to a qubit in any state, we simply multiply the gate’s matrix by the qubit’s state vector.

We will start now talking about one-qubit quantum gates. Those are gates that operate on only one gate at a time. These gates can be extended to run on more qubits, as we will see shortly. In this article, we will cover the six fundamental quantum gates: the Identity gate, the Hadamard gate, Pauli (X, Y, and Z) gates, and the Controlled-not gate.
1- The Identity Gate
The Identity gate (has a symbol I) is a single qubit gate that leaves the state of the qubit unchanged. Which may seem useless, I mean, why would we have a gate that does nothing? The I gate is useful for two reasons:
- It is often used in mathematical calculations to prove the gates are reversible.
- It is useful when executing the gate on real hardware. It is a way of telling it precisely to do nothing or what is called a none operation.

2- The Not Gate
The Not gate (X) is a single qubit gate the flips the qubit it operates on. If we give it |0⟩, it returns a |1⟩, and if we give it|1⟩, it will return a |0⟩. In applications with many superposition states, this gate is used to isolate particular states from the overall states.

3- The Hadamard Gate
The Hadamard gate (H) is the magic gate 🌟 . It is the gate responsible for creating the superposition of states. This gate puts the qubit in 50/50 superposition of states |0⟩ and |1⟩ despite whether the input state was |0⟩ or|1⟩. The H gate is probably the most import quantum gate, and it is the fundamental building block of many quantum algorithms.

If the H gate is given |0⟩ as an input state, it will produce a superposition state that – quantum people – refer to as the plus state |+⟩. Wheres if we give the H gate a |1⟩ state, it will generate the minus state |–⟩.

4- The Y Gate
The Y gate, similar to the X gate, is also a flip gate. The difference between those gates, however, is that the Y gate flips the state |0⟩ and then multiplies the results by an imaginary number j (adds a phase to it). This additional phase change makes this gate very useful for the creation of specific constructive/deconstructive interferences that are used in some algorithms.

5- The Z Gate
The Z gate is also a flip gate; however, this gate doesn’t flip the value of the state; it instead flips its phase. This gate leaves the state|0⟩ amplitude’s unchanged while multiplying the phase of state|1⟩ by -1.
The Z gate’s power comes from the fact that it only affects the |1⟩ state while leaving the |0⟩ untouched. This gate is frequently used for highlighting some states in the system while leaving others unaltered.

All the single gate qubits we just walked through can be extended to controlled gates by adding control and target qubits. An example of how that might work is the controlled-not gate.
6- The Controlled-not Gate
The controlled-not (CX or as shown in the GIF) gate is our first gate that operates on two qubits. This gate is a conditional gate that performs an X gate on the second qubit (called target), if and only if the state of the first qubit (control qubit) is |1⟩. In combination with other gates, the CX gate will allow us to construct all kinds of multi-qubit operations.

Okay, now that we got the basics down, let’s talk about how to use these gate – and more – to build a quantum circuit. We will do so using a quantum circuit simulator.
Quantum Circuit Simulators

Quantum circuit simulators are special tools that allow you to build and simulate quantum circuits without needing to write any code or perform any mathematical tricks! Since quantum computing is an ongoing research field, new tools are developed frequently to help people get familiar with quantum gates and quantum circuits and prepare them to when the Quantum Era arrives. The best and easiest browser-based (no installation needed😁 ) quantum circuit simulators, in my opinion, are:
- IBMQ Experience: IBM offers a drag-and-drop circuit composer that allows you to build your circuits and see the results.
- Quirk: Quirk is a drag-and-drop quantum circuit simulator that runs in your browser. This tool was built by Craig Gidney, who works as a software engineer at Google.
- QUI: QUI is a programming and simulation environment designed to allow users to visualize and understand the inner workings of quantum algorithms.
For the rest of this article, I will use the IBMQ circuit composer to simulate two simple circuits. Nevertheless, you can use any of the above simulators to experiment with quantum circuits.
Getting Familiar with IBMQ Circuit Composer
Once you open the IBMQ Circuit Composer, you will see this screen:

You can apply gates to specific qubits by simply dragging and dropping them. If you need more qubits, you can click on the small + sign under the last qubit, which will add one more qubit to the circuit. You can remove a qubit by clicking on the qubit and pressing the DELETE key on the keyboard. On the right-hand side, you can see a bar chart showing the resulting state of the circuit. An empty circuit has a state |0000⟩. Every time you add a gate, the resulting state will change accordingly.
Our First Quantum Circuit
We are now ready to build our first quantum circuit! Let’s start with an easy one.
Assume we want to create a circuit that flips the last qubit of any given state only if it was 1. For example, the state |1011⟩ would become |1010⟩ because the last bit was 1. However, if the input state is |1100⟩, the circuit won’t make any changes and will return the same state. How can I achieve that?
Initially, all qubits are set to the |0⟩ state, so we need to create the starting state, ex, state |1011⟩ first, and then apply some gates to flip the last digit of that state.
Before we start, the way states are usually read is from right to left, which in the composer goes from top to bottom.

Step 1: Create the starting|1011⟩ state
To create |1011⟩ state, we need to apply the X gate to qubits q[0], q[2], and q[3], as shown in the video below.

Step 2: Flip the last qubit.
To flip the last bit, we will add one more qubit to the circuit. This additional qubit will act as a control qubit. First, I need that qubit to be in state |1⟩ only if the last qubit of the circuit is 1; otherwise, it will be in state |0⟩. This can be achieved by using a CX gate on q[3] and q[4].

As you can see, the resulting state now is |10111⟩; we can ignore the last one since it’s an additional qubit we just added to help us achieve our goal. Which means our state is still unchanged. Next, we will use q[4] as a control in another CX gate and use that to flips q[3].

Now, our resulting state is |10101⟩, without q[4], it will be |1010⟩, which is the result we wanted! Yay!
But, what if I input a state with the last qubit equal to 0? Let’s see what is going to happen! If we input the state |1000⟩ to the circuit, the resulting state will be the same as our input state.

Yay! You just built your first quantum circuit without getting into quantum mechanics or writing in code! 👏
You can build any circuit if you know how it is supposed to work using circuit simulators, and once you get comfortable enough, you can start using code to create your circuits as you go deeper into the quantum realm.
References
[1] Brylinski, J. L., & Brylinski, R. (2002). Universal quantum gates. Mathematics of quantum computation.