PerOpQ
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 pylintmypy: run type checks using mypytests: run the unit testsdocs-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)
| File | Size | Uploaded | |
|---|---|---|---|
| peropq-0.2.0.tar.gz | 18.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|