Skip to main content

NWQLib: Northwest Quantum Library

PyPI Python License Documentation DOI

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.

Documentation: https://pnnl.github.io/NWQLib/

Installation

NWQLib requires Python 3.12 or later. Install the package with the local Aer simulator:

python -m pip install "nwqlib[aer]"

The base package, python -m pip install nwqlib, supports metadata, admitted inputs, default LCHS planning and the classical methods. Native preparation and execution need the extra of the selected backend (aer, ibm, ionq, nexus). The framework page lists every optional group, and the backends guide explains what each backend supports. For development, install an editable checkout with python -m pip install -e ".[dev,aer]".

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.

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. Other planning paths follow their Method's input and conversion requirements, and the 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.

Citation

If you use NWQLib in your work, please cite it through its Zenodo record, which resolves to the latest version:

@software{nwqlib,
  author  = {Zheng, Muqing and Liu, Chenxu and Song, Zhixin and Wu, Zeguan and Li, Xiangyu and Li, Mingze and Bauman, Nicholas P. and Stein, Samuel A. and M{\"u}lmenst{\"a}dt, Johannes and Chen, Yousu and Wiebe, Nathan and Li, Ang and Kowalski, Karol},
  title   = {NWQLib},
  year    = {2026},
  version = {1.0.0},
  doi     = {10.5281/zenodo.23074265},
  url     = {https://github.com/pnnl/NWQLib}
}

The references page lists the papers behind each algorithm and subroutine, with the equations NWQLib implements.

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.

NWQLib is released under the BSD 2-Clause License; see LICENSE. Information release number PNNL-SA-227989.

Metadata

Release files for nwqlib 1.0.0.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nwqlib 1.0.0.post1
File Size Uploaded
nwqlib-1.0.0.post1.tar.gz 5.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for nwqlib 1.0.0.post1
File Interpreter ABI Platform
nwqlib-1.0.0.post1-py3-none-any.whl Python 3 none any Details

Total release size: 7.9 MB

Release files / nwqlib-1.0.0.post1.tar.gz

Download URL nwqlib-1.0.0.post1.tar.gz
Size 5.8 MB
Tags Source
SHA-256 checksum
How to use checksums
00520ae66f3f157070249a26e006482524cb13ed5d4dfb3d6eb41d42b39ed5d4
BLAKE2b-256 checksum
How to use checksums
4b95bb78f9e9000adc883dcc4248edfde3ad9cf63cc7d841f34693997e5b4247
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

Release files / nwqlib-1.0.0.post1-py3-none-any.whl

Download URL nwqlib-1.0.0.post1-py3-none-any.whl
Size 2.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a0c881686be9f9629602f7626ad11f2079e411fc7aca806f557a12f48f5a9a98
BLAKE2b-256 checksum
How to use checksums
0321ec826039d5cc3569367a07857f2766ee0419b9966ac86910419bba711cfc
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

Release history Release notifications | RSS feed

This release

1.0.0.post1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page