Qiskit, Cirq, PennyLane, CUDA-Q and Guppy: Small Honest Code Examples
One idea, many dialects
Every framework below lets you describe a circuit, simulate it and often send it to hardware. If you read the tools overview you know the landscape. Here we go smaller and show code. Treat the snippets as sketches for orientation: APIs change between releases, so check each project's current docs before copying anything. We verified install notes and structure on the projects' own pages, and wrote the short circuits in the standard style those docs use.
Qiskit (IBM)
Install is one line, inside a virtual environment:
pip install qiskit
IBM's guide covers the v2.x series, which supports only 64-bit platforms from v2.0.0. IBM's own Hello World builds a two-qubit Bell state and runs it through the Estimator or Sampler primitives. The Estimator returns expectation values, and for a Bell state the ZZ and XX correlations should be about 1 while single-qubit values sit near 0. The Sampler returns counts of bitstrings. The circuit itself is tiny:
from qiskit import QuantumCircuit qc = QuantumCircuit(2) qc.h(0) qc.cx(0, 1) qc.measure_all()
Best for: the largest community, IBM hardware access, and the clearest path from tutorial to real device.
Cirq (Google)
Cirq's install page shows python -m pip install cirq and says it supports Python 3.11 and later. Its front page describes it as a Python library for writing, manipulating and optimizing circuits, designed for noisy hardware where details matter. A minimal example in the same spirit as the one on its home page:
import cirq q = cirq.LineQubit(0) circuit = cirq.Circuit(cirq.X(q) ** 0.5, cirq.measure(q, key="m")) print(cirq.Simulator().run(circuit, repetitions=20))
Best for: people who want to think about qubit layouts and hardware constraints. See Google's hardware work for context.
PennyLane (Xanadu)
PennyLane is a Python library whose docs pitch training a quantum computer "the same way as a neural network," with plugins to run on different backends. A typical pattern defines a device and wraps a circuit function so you can differentiate it:
import pennylane as qml
dev = qml.device("default.qubit", wires=2)
@qml.qnode(dev)
def bell():
qml.Hadamard(wires=0)
qml.CNOT(wires=[0, 1])
return qml.probs(wires=[0, 1])
print(bell())
Best for: quantum machine learning and variational algorithms, plus its Codebook for learning (see free courses).
CUDA-Q (NVIDIA)
CUDA-Q is described in its docs as a programming model and toolchain for quantum acceleration in heterogeneous computing, meaning CPUs, GPUs and QPUs working together. It is available in C++ and Python. Listed backends include state vector simulation on CPU, single GPU and multi-GPU multi-node, tensor network simulation, noisy simulation and photonics. The Python API uses a kernel decorator. We did not find a short example on the landing page, so follow its "Building your first CUDA-Q Program" tutorial rather than trusting a snippet from memory. Context: NVIDIA and hybrid quantum AI.
Best for: fast GPU simulation of bigger circuits and hybrid quantum plus AI work.
Guppy (Quantinuum)
Guppy's repository calls it a quantum programming language fully embedded into Python, supporting hybrid programs with classical control flow and mid-circuit measurements. It installs with pip install guppylang and needs Python 3.12 or later. The repo's example is quantum teleportation, which entangles an ancilla, applies Hadamard and CNOT gates and uses measurement results to apply classical corrections. A decorated function with typed qubit arguments looks like this in outline:
from guppylang import guppy
from guppylang.std.quantum import qubit, h, cx, measure
@guppy
def bell_pair(a: qubit, b: qubit) -> None:
h(a)
cx(a, b)
The repo shows a check step on the decorated function to validate it. We did not confirm from that page which hardware or emulator you would run it on, so look at Quantinuum's current docs. Best for: learning how real-time classical decisions and error correction style programs are written, which suits trapped-ion machines.
Which should you learn first?
| Goal | Pick |
|---|---|
| Real hardware free, biggest community | Qiskit |
| Hardware-aware thinking | Cirq |
| Hybrid ML and optimization | PennyLane |
| Fast simulation on GPUs | CUDA-Q |
| Dynamic circuits, classical control | Guppy |
Do not agonize. Gates, measurement and circuits are the same everywhere, and how a program runs is similar across tools. Learning two frameworks is easy once you know one. Quantinuum Ltd made Guppy; the QNT memecoin is independent of it, and nothing here is financial advice.
Sources
- Install Qiskit (IBM Quantum docs)
- IBM Quantum Hello World
- Cirq overview
- Install Cirq
- PennyLane introduction
- CUDA-Q documentation
- Guppy (guppylang) repository
Reported as of 2026-10-09. Free tiers, course lists and programs change often, so confirm on the provider's own page before you plan around anything. Educational content only, not financial advice. The QNT memecoin is independent and is not linked to Quantinuum Ltd, any lab or any government.
Frequently asked questions
Which quantum framework should a beginner learn first?
Qiskit is a common first pick because of its community and IBM hardware access, but the core ideas transfer across all of them.
Does Cirq need a recent Python?
Its install page says Cirq supports Python 3.11 and later.
What is Guppy?
A quantum programming language embedded in Python, with classical control flow and mid-circuit measurement, per its repository. It needs Python 3.12 or later.
Are these snippets guaranteed to run?
They are short sketches. Versions change, so test against the current docs.
Keep reading
- Quantum Programming Tools and SDKs Explained
What tools do people use to program quantum computers? A general guide to open source SDKs like Qiskit and Cirq, simulators, cloud access and how to choose one. - Real Quantum Hardware from Your Laptop: Free Tiers Compared (2026)
What IBM Quantum, Amazon Braket and Azure Quantum actually give you in October 2026, with the free allowances and pricing structure we could verify. - How a Quantum Program Runs: Circuit to Result
What happens when you run a quantum program? Follow a circuit through compilation, native gates, hardware execution, shots, noise and the counts you get back. - Quantum Gates and Circuits Explained
What are quantum gates and circuits? A plain English guide to Hadamard, CNOT and how gates turn qubits into a working quantum program.
All Quantum computing guides | Back to top | Search the site
Main pages: Quantum computing explained | Quantum and crypto | Companies | Quantum news | Glossary