from qarp.blocks import SimpleBlock
from qarp.algorithms import Sampler
from qarp.engines import QarpEngine
bell = SimpleBlock(2, name="bell")
bell.h(0)
bell.cx(0, 1)
bell.measure([(q, q) for q in range(2)])
bell.build()
engine = QarpEngine(seed=42)
engine.build([Sampler(ket=bell, n_shots=4000)])
distribution = engine.run()[0]
Quantum applications,
built in layers.
OpenQARP is an open-source Python framework for quantum application research on a compiled C++ core. Blocks describe circuits, primitives describe what to extract, engines describe how they run.
Behind this text: 4,096 live amplitudes of a 12-qubit HEABlock. Hover a dot to read one.
Blocks describe circuits.
A circuit is an object. State preparations, ansätze, and readouts snap together and nest. Build once, compile once, reuse everywhere.
Primitives describe what to extract.
Samples, expectation values, overlaps, phases. A primitive names the quantity, not the procedure, so the same circuit serves any algorithm.
Engines describe how they run.
Exact state vectors, device noise, GPU. Swap the engine, keep the program. The layers meet only at small, stable interfaces.
Python on top.
C++ underneath.
Everything you touch is an ordinary Python object. Everything that costs
time runs on a compiled C++ core: a circuit intermediate representation,
DAG optimisation, SABRE routing, and multithreaded state-vector kernels.
It is bound with nanobind and built by pip install, so there
is no separate build step.
Method and full numbers
Measured 2026-09-13 and 2026-09-14 on an Apple M-series laptop, single
thread, medians of three, each row checked against an independent reference before it is
timed. The harness ships in the repository under benchmarks/. Every competitor
runs its fast engine with the gate fusion that engine measures fastest on this host. On raw
circuit execution OpenQARP is ahead of the dedicated simulators on all but a handful of
rows; the margins widen on operators, whole algorithms, and compilation.
Eleven lines
to a Bell state.
This is the first cell of the first tutorial, unedited. The output on the right is not a picture: the page draws the same 4,000 seeded shots the engine would.
Start with tutorial 00An applications library,
not a gate library.
Near-term and fault-tolerant algorithms, the blocks they are made of, and the frameworks they talk to. Every algorithm ships as a runnable notebook.
Point your agent at the repo.
The rules are already in it.
A guide at the root, a conventions document the code must follow, and a plan-first workflow a human signs off twice.
AGENTS.mdthe ground rules, and what to read before touching a given areaCLAUDE.mda symlink to it, so the guide belongs to the repo and not to one assistantdocs/contracts/qarp_conventions.mdendianness, angles, phase: the contract the code must followtests/test_conventions_gates.pythe same contract as tests, checked against a first-principles oracledocs/contributions/_template.mdthe plan every standard or structural change starts from.claude/skills/plan/SKILL.mdplan and plan-review as plain markdown, readable by any agentThe same gates hold whatever writes the code: an independent oracle behind every numerical feature, coverage floors on every pull request, and a named reviewer on the plan and on the result.
Run your first circuit
in the next five minutes.
Python 3.11 or newer, on Linux, macOS and Windows. Apache License 2.0.
Bring an algorithm, a workload, or a CV.
Doing a PhD?
Implement your algorithm in OpenQARP and write it up. The implementation ships in the library, the write-up carries your name, and both stay reproducible because the notebook runs in CI.
Have a workload to test?
If your organisation has a problem worth putting on quantum hardware, we scope it with you and build the application on the library benchmarked here. You keep running code.
Want to join the group?
We do application research and the software engineering behind it, in one team at Fujitsu Research of Europe. Tell us what you work on.