Skip to main content

High-performance quantum simulator for matrix-free Hamiltonian evolution

Project description

quantlop

High-performance quantum simulator for matrix-free Hamiltonian evolution

quantlop quantlop

Build and test PyPI version Python 3.11+ License

Introduction

quantlop is a high-performance simulator for the time evolution of quantum systems whose Hamiltonians can be written as sparse sums of Pauli words. It integrates with PennyLane, so Hamiltonians can be defined with familiar Python operators while the compute-intensive work runs in C++.

Rather than constructing the full Hamiltonian matrix, quantlop applies each Pauli word as a linear operator directly to the state vector. It then uses a Krylov method to numerically approximate the action of the matrix exponential. This matrix-free approach dramatically reduces memory usage and avoids costly dense-matrix operations, making larger simulations more practical.

Installation

The project requires Python 3.11 or later and a C++20-compatible compiler.

pip install quantlop

On macOS, install the OpenMP runtime before installing quantlop:

brew install libomp
pip install quantlop

Usage example

import numpy as np
import pennylane as qp
import quantlop

# set number of qubits
nq = 3

# define Hamiltonian in Pauli basis
op = 0.5 * qp.Z(0) @ qp.Z(1) + 0.2 * qp.Y(0) @ qp.X(2)
ham = quantlop.Hamiltonian.from_pennylane(op, nq)

# prepare initial state vector
psi = np.zeros(2**nq, dtype=complex)
psi[0] = 1.0

# evolve state vector
evolved_psi = quantlop.evolve(ham, psi)

Multi-threading

Evolution is serial by default. Set num_threads to a positive integer to use that many OpenMP threads, or to "auto" to use the CPU count reported by the operating system:

evolved_psi = quantlop.evolve(ham, psi, num_threads="auto")

Development

The Python package is built with scikit-build-core, while the numerical C++ code is kept in the standalone quantlop_core CMake target.

Run the Python test suite with:

python -m pip install -e .[dev]
python -m pytest -v

Run the native C++ test suite with:

cmake -S . -B build
cmake --build build
ctest --test-dir build --output-on-failure

Install the pre-commit hook to format Python and C++ files automatically:

pre-commit install

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quantlop-0.0.2.tar.gz (269.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

quantlop-0.0.2-cp314-cp314-win_amd64.whl (380.4 kB view details)

Uploaded CPython 3.14Windows x86-64

quantlop-0.0.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (196.5 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

quantlop-0.0.2-cp314-cp314-macosx_15_0_arm64.whl (311.9 kB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

quantlop-0.0.2-cp313-cp313-win_amd64.whl (368.5 kB view details)

Uploaded CPython 3.13Windows x86-64

quantlop-0.0.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (196.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

quantlop-0.0.2-cp313-cp313-macosx_15_0_arm64.whl (311.8 kB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

quantlop-0.0.2-cp312-cp312-win_amd64.whl (368.6 kB view details)

Uploaded CPython 3.12Windows x86-64

quantlop-0.0.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (196.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

quantlop-0.0.2-cp312-cp312-macosx_15_0_arm64.whl (311.9 kB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

quantlop-0.0.2-cp311-cp311-win_amd64.whl (369.5 kB view details)

Uploaded CPython 3.11Windows x86-64

quantlop-0.0.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (197.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

quantlop-0.0.2-cp311-cp311-macosx_15_0_arm64.whl (313.0 kB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

File details

Details for the file quantlop-0.0.2.tar.gz.

File metadata

  • Download URL: quantlop-0.0.2.tar.gz
  • Upload date:
  • Size: 269.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quantlop-0.0.2.tar.gz
Algorithm Hash digest
SHA256 ef56df4ef30fe77c7458435d457578c0c96d3d44a1b9453fd3167414df85acbe
MD5 5f2f0fe7207e314e2e07965f24d205bb
BLAKE2b-256 db22f030f666a7fb551fcd5d29f61c44064920595067bd8ff92df5dcae59d8a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantlop-0.0.2.tar.gz:

Publisher: pypi.yml on SimoneGasperini/quantlop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantlop-0.0.2-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: quantlop-0.0.2-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 380.4 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quantlop-0.0.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 1450e41e2df122b306dbdefa15a3dfddd612e1267b884085191389b5fa2b24fe
MD5 d6d2c1b7c9171bf2afdf65e1cd723939
BLAKE2b-256 75cf0b7f4707091acae716835b1d782d8fdb36daeb09f2e13ed74be43218286a

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantlop-0.0.2-cp314-cp314-win_amd64.whl:

Publisher: pypi.yml on SimoneGasperini/quantlop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantlop-0.0.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for quantlop-0.0.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d82241a72ed6711b0966ac0970b96234ffc5eeca4fdf10a12ef6e2a5cabbf557
MD5 2fb0bfc1ee7d52f01f1aba5c4cd1058d
BLAKE2b-256 3fe52dec8d67e0bba43071cb3d44480bd515a3f7763ac560dc37d83c6309c83f

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantlop-0.0.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi.yml on SimoneGasperini/quantlop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantlop-0.0.2-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for quantlop-0.0.2-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 325b86a70773425bc892e397545d2e3974756bb8a2a64c5080b0c785b059c312
MD5 5e4dfc47bcf19c1ffa55a09ddc1bd9ba
BLAKE2b-256 b98568dec235c0a1d968013cc11c16c2b3e4b54ae37dc02efb5b0565f1131911

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantlop-0.0.2-cp314-cp314-macosx_15_0_arm64.whl:

Publisher: pypi.yml on SimoneGasperini/quantlop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantlop-0.0.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: quantlop-0.0.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 368.5 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quantlop-0.0.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7c47d41abd939259b75cd9f18a0e4d171fdf12519e03b73290c1e072119fa289
MD5 8b02a0b3c9d51ca4e01db9c4e0a411cc
BLAKE2b-256 54c9c1705b506d17d4d23cd83efbaa88679387171fcc2d0f1f91ab1f3c3c4a8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantlop-0.0.2-cp313-cp313-win_amd64.whl:

Publisher: pypi.yml on SimoneGasperini/quantlop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantlop-0.0.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for quantlop-0.0.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d18990cefbcb939487b8e6c2ddd19e82ed74279841569a2252f2b3abb9e1da83
MD5 9eb7d99b3ce1c4cc9d9c04762a959613
BLAKE2b-256 79860d75f0159995cdfaf6951fa660a3842ed38cef6cf5122f674ab4065ba397

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantlop-0.0.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi.yml on SimoneGasperini/quantlop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantlop-0.0.2-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for quantlop-0.0.2-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 2b06cdf4bbe91bdd5afc9498778ce45092d4373429149f643065b4015b71da55
MD5 a86a3a8eae2bb5054e1c5f8f2336d190
BLAKE2b-256 460fc1871fc2cbca6ae3f8c0dc563eaaf7847dc7f716d8086a7f041950392234

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantlop-0.0.2-cp313-cp313-macosx_15_0_arm64.whl:

Publisher: pypi.yml on SimoneGasperini/quantlop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantlop-0.0.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: quantlop-0.0.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 368.6 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quantlop-0.0.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 dd8461c124129ab1750690d5fe10fbffaf4aad04976cb0f6bbf4e554dfb7b2e5
MD5 f2e3a74b0c8e25fb1b1dc9532f829017
BLAKE2b-256 0c23a4a27b6532b7c1ae5c907228d6ce743b8259b22c09d90fc392c6b50d7827

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantlop-0.0.2-cp312-cp312-win_amd64.whl:

Publisher: pypi.yml on SimoneGasperini/quantlop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantlop-0.0.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for quantlop-0.0.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 25f940216b8707ab761c90291bc2f57a2daa4b58c0c93b54e1988e80d6103248
MD5 98a37c9a7373e828b3f6e761f98eee80
BLAKE2b-256 89cd19796eb9d4b57b873a1598a132a760174583213d7f15130937611ff58a4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantlop-0.0.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi.yml on SimoneGasperini/quantlop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantlop-0.0.2-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for quantlop-0.0.2-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7ddacdbbb70ed87b318400c8997d02a6b867d930681bb9f379ae2373285f1ed2
MD5 88c87751151bfa40ab26b515c82822b9
BLAKE2b-256 adc3506ebccb2ca1e089b687a0076b843b6a5b43799f57c29de7cf0f1bc2fae0

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantlop-0.0.2-cp312-cp312-macosx_15_0_arm64.whl:

Publisher: pypi.yml on SimoneGasperini/quantlop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantlop-0.0.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: quantlop-0.0.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 369.5 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quantlop-0.0.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7b70bccbd99c7133fb2906905acac51333ed15275740d6d74b0301f2a69c6709
MD5 ef7989378308e646c92c9c857c9d856b
BLAKE2b-256 4b87f70f9498ca43aae4bdeecc9440b3ebe11e8b7767c7cf2defc7d242af3ab7

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantlop-0.0.2-cp311-cp311-win_amd64.whl:

Publisher: pypi.yml on SimoneGasperini/quantlop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantlop-0.0.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for quantlop-0.0.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 18dffed1b8c1c10ef58f4513a8204e6c27f4db3f348765e3682ddf275f7faa39
MD5 ad834251376346be29dbf5003054322d
BLAKE2b-256 d8278a9380596e4058b715058cce6c0877deeffaab7b523229f4fc051690b650

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantlop-0.0.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi.yml on SimoneGasperini/quantlop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantlop-0.0.2-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for quantlop-0.0.2-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 305651f21ee497deb50fb961e87ce6c78db0ad08840657e62dcf057f472ec5a5
MD5 f9dc50c6e7221c04afe61fc7bc4f9a13
BLAKE2b-256 cb9019789270a757d0dfb25ca86cc5de68221c798f02558adfec6e4f7c5df17f

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantlop-0.0.2-cp311-cp311-macosx_15_0_arm64.whl:

Publisher: pypi.yml on SimoneGasperini/quantlop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page