Name | PerOpQ JSON |
Version |
0.1.1
JSON |
| download |
home_page | |
Summary | |
upload_time | 2024-02-07 16:50:54 |
maintainer | |
docs_url | None |
author | Travis Thompson |
requires_python | >=3.10,<4.0 |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# PerOpQ
[![Read the Docs](https://readthedocs.org/projects/peropq/badge/)](https://peropq.readthedocs.io/)
PerOpQ is an implementation of Perturbative Optimization for Hamiltonian Simulation, based on the ideas presented in [arXiv:2306.07208](https://arxiv.org/abs/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](https://python-poetry.org/) for packaging and dependency management and
[Nox](https://nox.thea.codes/en/stable/) for task automation.
### Recommended development setup
It is recommended to do these steps in a fresh python virtual environment
Install development tools:
```shell
pip install -r dev-tool-requirements.txt
```
### Local development with Nox (recommended)
[Nox](https://nox.thea.codes/en/stable/) 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](.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:
```shell
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](https://pre-commit.com/) 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:
```shell
nox -s pre-commit -- install
```
Afterward, the [pre-configured hooks](.pre-commit-config.yaml) 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).
<!-- github-only -->
Raw data
{
"_id": null,
"home_page": "",
"name": "PerOpQ",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Travis Thompson",
"author_email": "travis.thompson@quantinuum.com",
"download_url": "https://files.pythonhosted.org/packages/5c/a9/00783f1817d728a06c3201c40fa783ed44f19820a065e1264d59ca87a1a9/peropq-0.1.1.tar.gz",
"platform": null,
"description": "# PerOpQ\n\n[![Read the Docs](https://readthedocs.org/projects/peropq/badge/)](https://peropq.readthedocs.io/)\n\nPerOpQ is an implementation of Perturbative Optimization for Hamiltonian Simulation, based on the ideas presented in [arXiv:2306.07208](https://arxiv.org/abs/2306.07208).\nThe goal of the library is to provide optimized circuits to perform Hamiltonian simulations with less error than with naive Trotter decompositions.\nThe 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\nthe Baker\u2013Campbell\u2013Hausdorff (BCH) formula and truncating the resulting series at a given order.\nPerOpQ 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.\n\n## Development\n\nThis project uses [Poetry](https://python-poetry.org/) for packaging and dependency management and\n[Nox](https://nox.thea.codes/en/stable/) for task automation.\n\n### Recommended development setup\n\nIt is recommended to do these steps in a fresh python virtual environment\n\nInstall development tools:\n\n```shell\npip install -r dev-tool-requirements.txt\n```\n\n### Local development with Nox (recommended)\n\n[Nox](https://nox.thea.codes/en/stable/) can be used to automate various development tasks running in isolated python environments.\nThe following Nox sessions are provided:\n\n- `pre-commit`: run the configured pre-commit hooks within [.pre-commit-config.yaml](.pre-commit-config.yaml), this includes linting with black and pylint\n- `mypy`: run type checks using mypy\n- `tests`: run the unit tests\n- `docs-build`: build the documentation\n\nTo run a session use:\n\n```shell\nnox -s <session_name>\n```\n\nTo save time, reuse the session virtual environment using the `-r` option, i.e. `nox -rs <session_name>` (may cause errors after a dependency update).\n\n[Pre-commit](https://pre-commit.com/) can be used to run the pre-commit hooks before each commit. This is recommended.\nTo set up the pre-commit hooks to run automatically on each commit run:\n\n```shell\nnox -s pre-commit -- install\n```\n\nAfterward, the [pre-configured hooks](.pre-commit-config.yaml) will run on all changed files in a commit and the commit will be\nrejected if the hooks find errors. Some hooks will correct formatting issues automatically (but will still reject the commit, so that\nthe `git commit` command will need to be repeated).\n\n<!-- github-only -->\n\n",
"bugtrack_url": null,
"license": "",
"summary": "",
"version": "0.1.1",
"project_urls": {
"Documentation": "https://peropq.readthedocs.io"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "434ea1eed63e1081737917af1e996ea6433efaef55dc52534b5659e1facd1a8a",
"md5": "4cef212c2cbee7379b7bf48287cfa90f",
"sha256": "c58891b9c920c55c0f45216c871bd405e9dc9ed7ed4ad17306594e6da35b2f28"
},
"downloads": -1,
"filename": "peropq-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4cef212c2cbee7379b7bf48287cfa90f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 13823,
"upload_time": "2024-02-07T16:50:53",
"upload_time_iso_8601": "2024-02-07T16:50:53.050484Z",
"url": "https://files.pythonhosted.org/packages/43/4e/a1eed63e1081737917af1e996ea6433efaef55dc52534b5659e1facd1a8a/peropq-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5ca900783f1817d728a06c3201c40fa783ed44f19820a065e1264d59ca87a1a9",
"md5": "ad83d3c15ef300ec0959a967e89c1199",
"sha256": "b9d1da39a5139a95e645fa40484e13a10008f3c4cd12260306a29d66f658960c"
},
"downloads": -1,
"filename": "peropq-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "ad83d3c15ef300ec0959a967e89c1199",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 13215,
"upload_time": "2024-02-07T16:50:54",
"upload_time_iso_8601": "2024-02-07T16:50:54.966081Z",
"url": "https://files.pythonhosted.org/packages/5c/a9/00783f1817d728a06c3201c40fa783ed44f19820a065e1264d59ca87a1a9/peropq-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-07 16:50:54",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "peropq"
}