PROGRAMMING

Getting Started with Qiskit: Your First Quantum Circuit

A hands-on guide to building and running your first quantum circuit using IBM's Qiskit framework, from installation to execution on a real quantum computer.

T

TQ Editors

Feb 24, 2026 · 8 min read

Getting Started with Qiskit: Your First Quantum Circuit

Why Qiskit?

Qiskit has emerged as one of the most popular open-source frameworks for quantum computing, and for good reason. Backed by IBM, it provides a comprehensive toolkit that takes you from building simple quantum circuits all the way to running experiments on real quantum hardware. Unlike some other frameworks that focus purely on simulation, Qiskit gives you direct access to IBM's fleet of quantum processors through the cloud.

The framework is built on Python, making it immediately accessible to the vast majority of developers and data scientists. If you can write Python, you can write quantum programs — the conceptual leap is in understanding quantum mechanics, not in learning a new programming language.

Setting Up Your Environment

Getting started is straightforward. You'll need Python 3.8 or later and pip. Create a virtual environment and install Qiskit:

python -m venv quantum-env
source quantum-env/bin/activate
pip install qiskit qiskit-aer qiskit-ibm-runtime

The qiskit package gives you the core circuit-building tools, qiskit-aer provides high-performance simulators for local testing, and qiskit-ibm-runtime connects you to IBM's cloud quantum computers.

Building Your First Circuit

Let's build a circuit that creates a Bell state — the simplest example of quantum entanglement. This two-qubit state is fundamental to quantum computing and demonstrates two key quantum operations: superposition and entanglement.

from qiskit import QuantumCircuit
from qiskit_aer import AerSimulator
from qiskit.visualization import plot_histogram

# Create a circuit with 2 qubits and 2 classical bits
qc = QuantumCircuit(2, 2)

# Apply Hadamard gate to qubit 0 (creates superposition)
qc.h(0)

# Apply CNOT gate with qubit 0 as control, qubit 1 as target
qc.cx(0, 1)

# Measure both qubits
qc.measure([0, 1], [0, 1])

print(qc.draw())

This circuit does something remarkable. The Hadamard gate puts qubit 0 into a superposition of |0⟩ and |1⟩. The CNOT gate then entangles it with qubit 1, creating the Bell state (|00⟩ + |11⟩)/√2. When you measure, you'll always get either "00" or "11" — never "01" or "10". The qubits are correlated in a way that has no classical explanation.

Running on a Simulator

Before using real hardware, test your circuit on a local simulator:

simulator = AerSimulator()
result = simulator.run(qc, shots=1024).result()
counts = result.get_counts()
print(counts)
# Output: {'00': 512, '11': 512} (approximately)

The results confirm our Bell state — roughly equal counts of "00" and "11", with no "01" or "10" outcomes. The slight variations from exactly 512 each are due to the probabilistic nature of quantum measurement, which the simulator faithfully reproduces.

What's Next

This simple circuit is your entry point into a vast landscape. From here, you can explore quantum teleportation protocols, implement Grover's search algorithm, or experiment with variational quantum eigensolvers for chemistry simulations. The Qiskit textbook at learning.quantum.ibm.com is an excellent next step, offering interactive tutorials that build on these foundations with increasing complexity.

The key insight for classical programmers entering quantum computing is this: forget everything you know about deterministic computation. Quantum programs are inherently probabilistic, and learning to think in terms of amplitudes and interference patterns is the real challenge — not the code syntax.

T

Written by

TQ Editors

The editorial team at Towards Quantum.