Skip to main content

No project description provided

Project description

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).

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

peropq-0.2.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

peropq-0.2.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file peropq-0.2.0.tar.gz.

File metadata

  • Download URL: peropq-0.2.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.10

File hashes

Hashes for peropq-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6b1d702ca13ff51ff8c9e54b9107384ad9e76ecba210353f632dd71b0fdf068c
MD5 f6ee8d72527f05a5417935088366d7a4
BLAKE2b-256 f709102b60cf5a75618a3e669412ecc79a8aa24ed8c26525ebdfce215f548b90

See more details on using hashes here.

File details

Details for the file peropq-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: peropq-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.10

File hashes

Hashes for peropq-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49757aa774779b73708867b366868657dc2c5db64e263a31a1a1e093ecfdfccc
MD5 da5882c948e7dcd86710c4330df0df1e
BLAKE2b-256 a835e838e1b26700d531c999ee7c1127800769af3c2ea14eed05afee729bc239

See more details on using hashes here.

Supported by

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