NWQLib: Northwest Quantum Library
Documentation: https://pnnl.github.io/NWQLib/
NWQLib applies quantum algorithms to scientific problems. A workflow connects your inputs and requested output to a selected method, execution and a report of the result, evidence and resources. Native circuit execution uses Qiskit and an explicitly selected backend.
IR# PNNL-SA-227989
Start here
The example notebooks solve complete scientific problems from input to result, error and circuit cost, and the examples guide points you to the one that matches your problem. The mathematics page states the bounds, resource laws and error budgets that NWQLib uses, each with its proof or source and the code that implements it.
From a source checkout, install the package with the local Aer executor:
python -m pip install -e ".[aer]"
To solve du/dt = -A u with a small physical input:
from nwqlib import LinearDynamics, solve
from nwqlib.algorithms import LCHS
problem = LinearDynamics(
A=[[0.4, 0.15], [0.05, 0.25]],
initial_state=[1.0, 0.0],
time=0.1,
)
result = solve(problem, method=LCHS())
print(result.solution)
The default returns the physical solution approximation using nine total qubits. The quickstart compares it with an independent reference and shows how to change the approximation. The base install, python -m pip install -e ., supports metadata, admitted inputs, default LCHS planning and supported classical methods. Other planning paths follow their Method's input/conversion requirements; native preparation and execution require the selected backend extra. Method guides describe these boundaries.
The notebooks in examples/ apply NWQLib to molecular ground-state energy, a linear system, linear dynamics and optimization, and one estimates the resources of a linear system, heat flow, two spin chains, a GCiM trial basis and a QHD optimization step at up to 100 qubits. The examples guide describes the work each notebook performs.
Choose a task
| Task | Read |
|---|---|
| Learn the Python workflow | Quickstart, examples |
| Compare NWQLib with other quantum packages | Why NWQLib |
| Discover methods or use the command line | CLI guide |
| Compare methods and inspect results | Scientist workflow |
| Supply operators and states | Input access |
| Estimate resources and assess a device | Resource estimates, device profiles |
| Run locally or submit to a provider | Prepared execution, backends |
| Save results or continue a workflow | Saved evidence, run archives |
| Look up a signature | API reference |
| Check known defects in Qiskit and other dependencies, and how NWQLib handles them | Dependency issues |
| Extend or maintain NWQLib | Run your own circuit, Contributing, code tour, maintenance |
| Trace code to its paper, equation and reason | Code tour, references |
| Find the bound, resource law or error budget behind a result, its proof or source, and its code | Mathematics |
Algorithms
| Scientific task | Methods |
|---|---|
| Normalized expectation of a finite real Pauli sum | Expectation |
| Energy estimates from moments or a selected subspace | Chebyshev Lanczos, fixed and adaptive GCiM |
| Phase or energy estimation | QPE: QCELS, RWPE, SPE and RFE |
| Time-independent linear dynamics | LCHS |
| Linear systems | QLS: QSVT inverse polynomial (qsvt_inverse, the default) and the Dalzell kernel shortcut (shortcut_native_svp, shortcut_dilation) |
| Box-constrained optimization | QHD |
| Optimization over a box with equality or inequality constraints | QHD augmented Lagrangian |
Methods report the quantity actually obtained and any unresolved accuracy conditions. A projected energy, local statistical interval or completed simulation does not by itself establish the full requested scientific claim. The roadmap records current limitations and open work. Reusable state preparation, block encoding, LCU, QSP/QSVT and evolution primitives have their own API references.
Backend support
Aer supports local execution. NWQ-Sim CPU execution and process-exit continuation have been exercised on macOS and Linux with the qualified build described in the backend guide. IBM Runtime, IonQ and Nexus have offline SDK and injected-result qualification. Live provider accounts, queues and QPUs remain unqualified. Slurm and GPU/site support have their documented offline qualification boundaries.
The Nexus guide documents its pandas dependency exception and missing per-request timeout. See Slurm for explicit site configuration. Each method/backend/readout combination must satisfy its own capability checks.
Authors and Developers
For questions, bug reports or collaboration, contact Muqing Zheng (muqing.zheng@pnnl.gov).
Affiliations are those at the time of contribution.
- Muqing Zheng, Pacific Northwest National Laboratory
- Chenxu Liu, Pacific Northwest National Laboratory
- Zhixin Song, Pacific Northwest National Laboratory and Georgia Institute of Technology
- Zeguan Wu, Pacific Northwest National Laboratory and University of Pittsburgh
- Xiangyu Li, Pacific Northwest National Laboratory
- Mingze Li, Pacific Northwest National Laboratory
- Nicholas P. Bauman, Pacific Northwest National Laboratory
- Samuel A. Stein, Pacific Northwest National Laboratory
- Johannes Mülmenstädt, Pacific Northwest National Laboratory
- Yousu Chen, Pacific Northwest National Laboratory
- Nathan Wiebe, Pacific Northwest National Laboratory and University of Toronto
- Ang Li, Pacific Northwest National Laboratory and University of Washington
- Karol Kowalski, Pacific Northwest National Laboratory
Acknowledgements
This work was supported by Pacific Northwest National Laboratory's Quantum Algorithms and Architecture for Domain Science (QuAADS) Laboratory Directed Research and Development (LDRD) Initiative. This material is based upon work supported by the U.S. Department of Energy, Office of Science, National Quantum Information Science Research Centers, Quantum Science Center (QSC). The Pacific Northwest National Laboratory is operated by Battelle for the U.S. Department of Energy under Contract DE-AC05-76RL01830.
Algorithm and subroutine references.
NWQLib is released under the BSD 2-Clause License; see LICENSE.
Metadata
Release files for nwqlib 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nwqlib-1.0.0.tar.gz | 5.8 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nwqlib-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.9 MB
Release files / nwqlib-1.0.0.tar.gz
| Download URL | nwqlib-1.0.0.tar.gz |
|---|---|
| Size | 5.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39ed0d829baae831f630a982a172390667f83a40b07d866b8cc637728a37e148
|
|
BLAKE2b-256 checksum How to use checksums |
d552870362c995e81a71cf1fb25aa2e183e4d7540807410dca2c69c9573bda60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / nwqlib-1.0.0-py3-none-any.whl
| Download URL | nwqlib-1.0.0-py3-none-any.whl |
|---|---|
| Size | 2.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2df8c0f4ebd243c8e15532e0f0b357aa03abe0f3c0abab0b9699e0766d04714f
|
|
BLAKE2b-256 checksum How to use checksums |
6462b1d8e4f0b88cde125daa6d4bf3c0b58f5536ddda5171050d1dc7b8ebbe22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency log