py-ste

A Python package for evolving states under the Schrödinger equation using first-order Suzuki-Trotter and computing switching functions.

https://github.com/christopher-k-long/pyste

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.8%) to scientific vocabulary

Keywords

evolution evolver integration integrator quantum simulation suzuki trotter unitary
Last synced: 6 months ago · JSON representation ·

Repository

A Python package for evolving states under the Schrödinger equation using first-order Suzuki-Trotter and computing switching functions.

Basic Info
  • Host: GitHub
  • Owner: Christopher-K-Long
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage: https://PySTE.readthedocs.io
  • Size: 2.92 MB
Statistics
  • Stars: 5
  • Watchers: 0
  • Forks: 1
  • Open Issues: 0
  • Releases: 1
Topics
evolution evolver integration integrator quantum simulation suzuki trotter unitary
Created 8 months ago · Last pushed 8 months ago
Metadata Files
Readme Changelog License Citation

README.md

PySTE

A Python package for evolving states under the Schrödinger equation using first-order Suzuki-Trotter and computing switching functions.

Unit Tests

PySTE stands for Python Suzuki-Trotter-Evolver and is a Python interface to the C++ header-only library https://github.com/Christopher-K-Long/Suzuki-Trotter-Evolver.

While PySTE has limited functionality in comparison to more fleshed out quantum simulation packages such as QuTiP, it is faster at some tasks:

benchmark PySTE vs QuTiP

More detailed benchmarks can be found here: https://PySTE.readthedocs.io/en/latest/benchmarks/index.html

Installation

PySTE can be installed as follows:

bash pip install py-ste

However, the package should be imported as:

python import py_ste

Support

Current support:

|                    | macOS Intel | macOS Apple Silicon | Windows 64bit | Windows 32bit | Windows Arm64 | manylinux
musllinux x86_64 | Other Linux | |--------------------|-----|-----|-----|------|-----|-----|-----| | CPython 3.8        | ✅ | ✅  | ✅  | ✅  | Build from source | ✅ | Build from source | | CPython 3.9        | ✅ | ✅  | ✅  | ✅  | Build from source | ✅ | Build from source | | CPython 3.10       | ✅ | ✅  | ✅  | ✅  | Build from source | ✅ | Build from source | | CPython 3.11       | ✅ | ✅  | ✅  | ✅  | Build from source | ✅ | Build from source | | CPython 3.12       | ✅ | ✅  | ✅  | ✅  | Build from source | ✅ | Build from source | | CPython 3.13       | ✅ | ✅  | ✅  | ✅  | Build from source | ✅ | Build from source |

Currently, the pre-built wheels only include the dynamic evolvers. For the faster static evolvers please build from source.

Requirements

Requires: - NumPy

Note that Suzuki-Trotter-Evolver and Eigen3 are packaged with PySTE and so do not need to be installed separately.

If on Linux and using a conda environment you may encounter an error version `GLIBCXX_...' not found to fix this you also need to execute: bash conda install -c conda-forge libstdcxx-ng

Additional requirements for testing

Additional requirements for benchmarking

Build from source

There are several flags that can be passed which will rebuild PySTE from source using various optimisations. The flags are: - --config-setting="cmake.define.NCTRL_FIXED_SIZES=RANGE"\ Defines the strategy used to compile evolvers with a fixed number of controls. The options are: - OFF: There will only be evolvers with a dynamic number of controls. - SINGLE: There will only be a single evolver with a fixed number of controls specified by --config-setting="cmake.define.NCTRL=...". - RANGE (default option): There will be evolvers with a fixed number of controls in the range $[1,$ MAX_NCTRL$]$ where MAX_NCTRL can be set with --config-setting="cmake.define.MAX_NCTRL=..." - POWER: The evolvers with a fixed number of controls will have a number of controls given by powers in the range $[1,$ MAX_POWER_NCTRL$]$ of the base BASE_NCTRL where MAX_POWER_NCTRL can be set with --config-setting="cmake.define.MAX_POWER_NCTRL=..." and BASE_NCTRL with --config-setting="cmake.define.BASE_NCTRL=..." - --config-setting="cmake.define.NCTRL=1"\ The number of controls when using --config-setting="cmake.define.NCTRL_FIXED_SIZES=SINGLE". A positive integer, by default 1. - --config-setting="cmake.define.MAX_NCTRL=14"\ The maximum number of controls when using --config-setting="cmake.define.NCTRL_FIXED_SIZES=RANGE". A positive integer, by default 14. - --config-setting="cmake.define.MAX_POWER_NCTRL=3"\ The maximum power when using --config-setting="cmake.define.NCTRL_FIXED_SIZES=POWER". A positive integer, by default 3. - --config-setting="cmake.define.BASE_NCTRL=2"\ The base of the powers when using --config-setting="cmake.define.NCTRL_FIXED_SIZES=POWER". A positive integer, by default 2. - --config-setting="cmake.define.DIM_FIXED_SIZES=RANGE"\ Defines the strategy used to compile evolvers with a fixed vector space dimension. The options are: - OFF: There will only be evolvers with a dynamic vector space dimension. - SINGLE: There will only be a single evolver with a fixed vector space dimension specified by --config-setting="cmake.define.DIM=...". - RANGE (default option): There will be evolvers with a fixed vector space dimension in the range $[1,$ MAX_DIM$]$ where MAX_DIM can be set with --config-setting="cmake.define.MAX_DIM=..." - POWER: The evolvers with a fixed vector space dimension will have a vector space dimension given by powers in the range $[1,$ MAX_POWER_DIM$]$ of the base BASE_DIM where MAX_POWER_DIM can be set with --config-setting="cmake.define.MAX_POWER_DIM=..." and BASE_DIM with --config-setting="cmake.define.BASE_DIM=..." - --config-setting="cmake.define.DIM=2"\ The vector space dimension when using --config-setting="cmake.define.DIM_FIXED_SIZES=SINGLE". A positive integer, by default 2. - --config-setting="cmake.define.MAX_DIM=16"\ The maximum vector space dimension when using --config-setting="cmake.define.DIM_FIXED_SIZES=RANGE". A positive integer, by default 16. - --config-setting="cmake.define.MAX_POWER_DIM=4"\ The maximum power when using --config-setting="cmake.define.DIM_FIXED_SIZES=POWER". A positive integer, by default 4. - --config-setting="cmake.define.BASE_DIM=2"\ The base of the powers when using --config-setting="cmake.define.DIM_FIXED_SIZES=POWER". A positive integer, by default 2.

For example, bash pip install py-ste \ --config-setting="cmake.define.NCTRL_FIXED_SIZES=SINGLE" \ --config-setting="cmake.define.NCTRL=2" \ --config-setting="cmake.define.DIM_FIXED_SIZES=POWER" \ --config-setting="cmake.define.MAX_POWER_DIM=3" \ --verbose will build PySTE from source and optimises evolvers at compile time with 2 control Hamiltonians acting on a vector space of dimensions 2, 4, and 8. Increasing the number of optimised evolvers increases the compile time. The --verbose flag allows the progress of the build to be seen. This is useful as the builds can often take a long time.

Note building from source requires approximately 16GB of RAM.

Cloning the repository

PySTE uses git submodules and so should be cloned with the flag --recurse-submodules as follows:

bash git clone --recurse-submodules https://github.com/Christopher-K-Long/PySTE

Alternatively, you can clone the repository normally and then initialise the submodules as follows bash git clone https://github.com/Christopher-K-Long/PySTE git submodule update --init --recursive

Documentation

Documentation including worked examples can be found at: https://PySTE.readthedocs.io

Source Code

Source code can be found at: https://github.com/Christopher-K-Long/PySTE

Version and Changes

The current version is 1.0.1. Please see the Change Log for more details. PySTE uses semantic versioning.

Acknowledgements

CKL would like to thank Chris Hall for useful discussions on the structure of the package.

Owner

  • Name: Christopher K. Long
  • Login: Christopher-K-Long
  • Kind: user
  • Company: The University of Cambridge

PhD candidate at the University of Cambridge working on quantum algorithms.

Citation (CITATION.cff)

cff-version: 1.2.0
title: PySTE
message: >-
  If you use Suzuki-Trotter-Evolver please cite the accompanying paper:

    Long, C. K., Mayhall, N. J., Economou, S. E., Barnes, E., Barnes, C. H. W.,
    Martins, F., … Mertig, N. (2024). Minimal evolution times for fast,
    pulse-based state preparation in silicon spin qubits. arXiv [Quant-Ph].
    Retrieved from http://arxiv.org/abs/2406.10913

  Additionally, you can reference this code base using this CFF file.
type: software
authors:
  - given-names: Christopher K.
    family-names: Long
    email: ckl45@cam.ac.uk
    affiliation: University of Cambridge and Hitachi Cambridge Laboratory
    orcid: 'https://orcid.org/0009-0001-3230-942X'
  - given-names: Crispin H. W.
    family-names: Barnes
    affiliation: University of Cambridge
    orcid: 'https://orcid.org/0000-0001-7337-7245'
  - given-names: Normann
    family-names: Metrig
    affiliation: Hitachi Cambridge Laboratory
    orcid: 'https://orcid.org/0000-0003-3025-7141'
repository-code: 'https://github.com/Christopher-K-Long/PySTE'
url: 'https://github.com/Christopher-K-Long/PySTE'
abstract: >-
  A Python package for evolving states under the Schrödinger equation using
  first-order Suzuki-Trotter and computing switching functions.
keywords:
  - evolver
  - evolution
  - suzuki
  - trotter
  - simulation
  - integrator
  - integration
  - unitary
  - quantum
license: Apache-2.0
version: 1.0.1
date-released: '2025-06-15'

GitHub Events

Total
  • Release event: 2
  • Watch event: 5
  • Delete event: 1
  • Push event: 11
  • Fork event: 1
  • Create event: 3
Last Year
  • Release event: 2
  • Watch event: 5
  • Delete event: 1
  • Push event: 11
  • Fork event: 1
  • Create event: 3

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 2,851 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
pypi.org: py-ste

A Python package for evolving states under the Schrödinger equation using first-order Suzuki-Trotter and computing switching functions.

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 2,851 Last month
Rankings
Dependent packages count: 9.0%
Average: 29.8%
Dependent repos count: 50.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/publish-to-test-pypi.yml actions
  • actions/checkout v4 composite
  • actions/download-artifact v4 composite
  • actions/setup-python v5 composite
  • actions/upload-artifact v4 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/release-and-publish-to-pypi.yml actions
  • actions/checkout v4 composite
  • actions/download-artifact v4 composite
  • actions/setup-python v5 composite
  • actions/upload-artifact v4 composite
  • pypa/gh-action-pypi-publish release/v1 composite
  • sigstore/gh-action-sigstore-python v3.0.0 composite
.github/workflows/test-python-package.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
benchmarks/requirements.txt pypi
  • pyperf *
  • pyste ==1.0.0
docs/requirements.txt pypi
  • cffconvert *
  • furo *
  • myst-parser *
  • pyste ==1.0.0
  • sphinx-codeautolink *
  • sphinx_math_dollar *
  • sphinx_tabs *
pyproject.toml pypi
  • numpy *
requirements.txt pypi
tests/requirements.txt pypi
  • pyyaml * test
  • toml * test