qulacs/qulacs

Variational Quantum Circuit Simulator for Quantum Computation Research

Qulacs – Fast quantum‑circuit simulation library

What it is – Qulacs is an open‑source library (Python front‑end with a high‑performance C++ core) for simulating quantum circuits. It targets research on noisy‑intermediate‑scale quantum (NISQ) devices, variational algorithms, and any workload that needs to run many or large quantum circuits quickly.

Key capabilities

  • Speed – Parallelised C/C++ backend; optional SIMD, OpenMP and GPU acceleration. Benchmarks show it competes with other simulators on single‑ and multi‑threaded runs.
  • Noise modelling – Built‑in noisy gates let you emulate realistic NISQ hardware.
  • Parametric gates – Supports gates with tunable parameters, useful for variational quantum algorithms.
  • Circuit optimisation & compression – Reduces gate count before simulation for extra speed.
  • Cross‑language – Use from Python (pip install qulacs or qulacs-gpu for GPU) or directly link the static/shared C++ libraries.

Installation

  • Simple pip install for most users: pip install qulacs (pre‑built binary tuned for Intel Haswell CPUs).
  • For older CPUs, newer CPUs (better performance) or GPU support, install from source or use the qulacs-gpu package.
  • Building from source lets you enable AVX2, OpenMP, or CUDA via CMake.

Typical workflow (Python)

from qulacs import QuantumCircuit, QuantumState, Observable
from qulacs.gate import Y, CNOT, merge

state = QuantumState(3)
state.set_Haar_random_state()

circuit = QuantumCircuit(3)
circuit.add_X_gate(0)
circuit.add_gate(merge(CNOT(0,1), Y(1)))
circuit.add_RX_gate(1, 0.5)
circuit.update_quantum_state(state)

obs = Observable(3)
obs.add_operator(2.0, "X 2 Y 1 Z 0")
obs.add_operator(-3.0, "Z 2")
print(obs.get_expectation_value(state))

Replace QuantumState with QuantumStateGpu after installing qulacs-gpu to run on a CUDA‑enabled GPU.

Typical workflow (C++) – Include headers from include/ and link the static libraries (-lcppsim_static -lcsim_static …). Sample code mirrors the Python example.

Who uses it – Academic groups (e.g., QunaSys, Osaka University, NTT, Fujitsu) and anyone needing a fast, extensible simulator for algorithm development, benchmarking, or noise studies.

Where to learn more – Full tutorials, API docs, and examples are on the project site (e.g., docs.qulacs.org). The accompanying benchmark repo and the arXiv paper (arXiv:2011.13524) provide performance details.

License – MIT, so it can be freely used and incorporated into other software.

Related

  • Project
  • Project
  • Project
  • Project
  • Project