ZKSF logo, a neon quantum brainZKSF
← All articles

Qiskit, Cirq or PennyLane? Choosing a Quantum Programming Framework

· 12 min read · ZKSF team

Anyone starting quantum software development meets the same question within an hour: Qiskit, Cirq or PennyLane. The question is usually posed as though it were a permanent commitment, in the way that choosing between TensorFlow and PyTorch once was. It is not, and understanding why changes how the decision should be made.

What each one is, and who built it

Qiskit is IBM's quantum software development kit, and it is the default in the field by a wide margin. It carries the largest ecosystem, the most tutorials, the most university course material, and direct access to IBM's own superconducting hardware. Its circuit object, `QuantumCircuit`, has become the informal lingua franca that other tools convert to and from. If a quantum computing paper published in the last five years includes code, it is more likely to be Qiskit than everything else combined.

Cirq is Google's framework, and its design reflects the hardware it was written for. It exposes qubits as objects with a physical location, `cirq.GridQubit(row, col)`, because Google's superconducting processors are two-dimensional lattices with nearest-neighbour connectivity, and pretending otherwise leads to circuits that cannot be executed. Cirq is more explicit than Qiskit about scheduling and moments, which makes it verbose for simple work and precise for hardware-aware work.

PennyLane is Xanadu's framework, and it is built around a different premise: that a quantum circuit is a differentiable function. Its central abstraction is the `QNode`, which wraps a circuit so that gradients flow through it into PyTorch, TensorFlow or JAX. If the goal is variational work, quantum machine learning, or anything requiring an optimiser, PennyLane is designed for that and the others are not.

What actually distinguishes them

The gate sets are broadly equivalent. All three express Hadamards, rotations, CNOTs and measurement, and a circuit written in one can be written in the others without difficulty. The genuine differences sit elsewhere.

                    Qiskit              Cirq                PennyLane
Origin              IBM                 Google              Xanadu
Built for           general use         hardware-aware      differentiable
                                        circuits            circuits
Qubit model         indexed register    positional grid     wires
Autodiff            add-on              no                  native
Ecosystem size      largest             moderate            focused
Native hardware     IBM                 Google              multiple, via
                                                            plugins

Automatic differentiation is the sharpest divide. Computing a gradient of an expectation value with respect to circuit parameters is the core operation in variational quantum eigensolvers and quantum machine learning. PennyLane treats this as a first-class concern and implements the parameter-shift rule so that gradients are exact rather than finite-difference approximations. Doing the same in Qiskit is entirely possible and requires more assembly.

The qubit model matters more than it sounds. Qiskit's indexed register is convenient and quietly hides connectivity. Cirq's positional qubits make the hardware topology visible in the source, so a two-qubit gate between distant qubits looks wrong when you write it rather than becoming a surprise after transpilation. That difference is a matter of taste until a circuit's depth triples during routing, at which point Cirq's verbosity looks like foresight. The mechanism is described in Transmon or trapped ion.

The question is less binding than it looks

Frameworks are authoring tools. What reaches a simulator or a quantum processor is not a Python object but a serialised circuit, and in practice that means OpenQASM, the assembly-level representation that every major platform reads and writes.

This has a consequence worth stating plainly: the framework decision is reversible, and cross-framework work is routine. Converting between them is a solved problem, handled by transpilers such as qBraid's, which map circuits from Cirq, PennyLane, pyQuil or Braket into Qiskit and onward to OpenQASM.

Our own software development kit takes exactly this approach. A Qiskit circuit passes straight through and is serialised directly. A Cirq, PennyLane, pyQuil or Braket circuit is converted first, then serialised the same way:

import qsim_sdk
client = qsim_sdk.Client(token=TOKEN)

# Qiskit: passes straight through
result = client.run(qiskit_circuit, shots=1024)

# Cirq, PennyLane, pyQuil, Braket: converted, then run identically
# pip install qsim-sdk[multiframework]
result = client.run(cirq_circuit, shots=1024)

The engine underneath neither knows nor cares which framework produced the circuit. Choosing PennyLane for its gradients does not exclude you from a simulator, and choosing Cirq for its topology awareness does not exclude you from hardware built by anyone other than Google.

Where the abstraction leaks

Two limitations deserve stating, because articles of this kind usually omit them.

OpenQASM 2 cannot carry an unbound parameter. A parameterised circuit, the kind every variational algorithm builds, has no representation in the format until its parameters are given values. Any system serialising through OpenQASM 2 must therefore bind parameters before submission, which means a variational loop sends a fresh concrete circuit each iteration rather than one template. This is invisible until you try to submit a symbolic circuit and it is rejected. Other reasons a circuit is refused are collected in Why your circuit was rejected.

Conversion is not always lossless. Framework-specific constructs, custom gate definitions and pulse-level instructions have no universal equivalent. A circuit built from standard gates converts cleanly. A circuit relying on one framework's particular extension may not, and the failure is better discovered locally than after a queue wait.

A practical recommendation

  • Learning quantum computing, or unsure: Qiskit. The ecosystem advantage is real, the tutorials are the best available, and almost every example you find will run.
  • Quantum machine learning, variational algorithms, anything needing gradients: PennyLane. The autodiff integration is the reason it exists and it will save you writing a parameter-shift implementation. Related material is in Quantum machine learning simulators.
  • Targeting Google hardware, or working close to device topology: Cirq. Its explicitness is an advantage when connectivity constrains the circuit.
  • Working across several: use whichever suits each task and convert. This is normal practice rather than an exotic workflow.

The framework is the least consequential decision in a quantum computing project. What determines whether the work is sound is the choice of simulation method, whether the result carries a stated accuracy, and whether hardware was necessary at all. Those questions are addressed in CPU, GPU or QPU and Error bars for quantum computing.

Run your own 100-qubit circuit, with an error bar.

Share this articleLink copied