Skip to main content

High-performance quantum simulator for matrix-free Hamiltonian evolution

Project description

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

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)

The function quantlop.evolve returns a new state vector corresponding to

\lvert \psi(t) \rangle = e^{-iH}\lvert \psi(0) \rangle.

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.1.tar.gz (49.7 kB view details)

Uploaded Source

Built Distribution

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

quantlop-0.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (114.5 kB view details)

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

File details

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

File metadata

  • Download URL: quantlop-0.0.1.tar.gz
  • Upload date:
  • Size: 49.7 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.1.tar.gz
Algorithm Hash digest
SHA256 99fbb1056d1a0158db6cd029d1dfc247b99d6fd272954e7bbe6d4025344a9291
MD5 760f538ee38cf561ff5d4c976e0409f1
BLAKE2b-256 cc09c3864d42ed97d72ba38a925c02657a9caadc34878583a46fe188e1d09a9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantlop-0.0.1.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.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for quantlop-0.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ee7ca019142c642a2194ec92a505c6c0db8f4405d6404e58b23fa32348dbafcc
MD5 dcf7c6fa351d2bb4b82ac7f9792ca6d6
BLAKE2b-256 6139067694a91187a71300d09154a8586ec9a49b1c26588a405592c27e78bfac

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantlop-0.0.1-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.

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