Skip to main content

PerOpQ

Read the Docs

PerOpQ is an implementation of Perturbative Optimization for Hamiltonian Simulation, based on the ideas presented in arXiv:2306.07208. The goal of the library is to provide optimized circuits to perform Hamiltonian simulations with less error than with naive Trotter decompositions. The basic idea is to evaluate the error of an ansatz unitary (decomposed into a set of one-qubit and two-qubit gates) by applying recursively the Baker–Campbell–Hausdorff (BCH) formula and truncating the resulting series at a given order. PerOpQ takes a model defined by a list of Pauli strings, a final time and a circuit depth as inputs and returns an optimized circuit as a result.

Development

This project uses Poetry for packaging and dependency management and Nox for task automation.

Recommended development setup

It is recommended to do these steps in a fresh python virtual environment

Install development tools:

pip install -r dev-tool-requirements.txt

Local development with Nox (recommended)

Nox can be used to automate various development tasks running in isolated python environments. The following Nox sessions are provided:

  • pre-commit: run the configured pre-commit hooks within .pre-commit-config.yaml, this includes linting with black and pylint
  • mypy: run type checks using mypy
  • tests: run the unit tests
  • docs-build: build the documentation

To run a session use:

nox -s <session_name>

To save time, reuse the session virtual environment using the -r option, i.e. nox -rs <session_name> (may cause errors after a dependency update).

Pre-commit can be used to run the pre-commit hooks before each commit. This is recommended. To set up the pre-commit hooks to run automatically on each commit run:

nox -s pre-commit -- install

Afterward, the pre-configured hooks will run on all changed files in a commit and the commit will be rejected if the hooks find errors. Some hooks will correct formatting issues automatically (but will still reject the commit, so that the git commit command will need to be repeated).

Metadata

Release files for PerOpQ 0.2.0

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

Source distribution (sdist)

Source distribution for PerOpQ 0.2.0
File Size Uploaded
peropq-0.2.0.tar.gz 18.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PerOpQ 0.2.0
File Interpreter ABI Platform
peropq-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.8 kB

Release files / peropq-0.2.0.tar.gz

Download URL peropq-0.2.0.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6b1d702ca13ff51ff8c9e54b9107384ad9e76ecba210353f632dd71b0fdf068c
BLAKE2b-256 checksum
How to use checksums
f709102b60cf5a75618a3e669412ecc79a8aa24ed8c26525ebdfce215f548b90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.10

Release files / peropq-0.2.0-py3-none-any.whl

Download URL peropq-0.2.0-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49757aa774779b73708867b366868657dc2c5db64e263a31a1a1e093ecfdfccc
BLAKE2b-256 checksum
How to use checksums
a835e838e1b26700d531c999ee7c1127800769af3c2ea14eed05afee729bc239
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.10

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

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