pytket-aqt


Namepytket-aqt JSON
Version 0.36.0 PyPI version JSON
download
home_pagehttps://github.com/CQCL/pytket-aqt
SummaryExtension for pytket, providing access to AQT backends
upload_time2024-11-22 15:59:33
maintainerNone
docs_urlNone
authorTKET development team
requires_python<3.13,>=3.10
licenseApache 2
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pytket-aqt

[Pytket](https://tket.quantinuum.com/api-docs/index.html) is a python module for interfacing
with tket, a quantum computing toolkit and optimising compiler developed by Quantinuum.

`pytket-aqt` is an extension to `pytket` that allows `pytket` circuits to be
executed on AQT's ([Alpine Quantum Technologies'](https://www.aqt.eu/)) quantum devices and simulators.

See [extension documentation](https://cqcl.github.io/pytket-aqt/api/index.html) for more.

## Getting started

`pytket-aqt` is available for Python 3.10, 3.11 and 3.12, on Linux, MacOS
and Windows. To install, run:

```shell
pip install pytket-aqt
```

This will install `pytket` if it isn't already installed, and add new classes
and methods into the `pytket.extensions` namespace.

## Available devices

`pytket-aqt` offers offline simulators for aqt devices that do not require special access.
Access to remote simulators and machines can be configured by providing an AQT access token.

To see which devices are available to you, use the `AQTBackend.print_device_table` method.
This method will prompt for an access token if none has been configured. Providing a token at the
prompt will store it in memory for further API use. Skip the prompt to see the available offline
simulators. It is also possible to store and use your access token across sessions using
`config.set_aqt_config`.

## Ion Shuttling

The `AQTMultiZoneBackend` supports routing of a circuit to a particular segmented ion-trap architecture before submission. This feature is experimental and not necessary for any currently available AQT devices. In order to use the graph partitioning based algorithms within this context, a manual installation of the [mt-kahypar](https://github.com/kahypar/mt-kahypar) package is necessary. See the instructions there for details.

## Bugs, support and feature requests

Please file bugs and feature requests on the Github
[issue tracker](https://github.com/CQCL/pytket-aqt/issues).

There is also a Slack channel for discussion and support. Click [here](https://tketusers.slack.com/join/shared_invite/zt-18qmsamj9-UqQFVdkRzxnXCcKtcarLRA#/shared-invite/email) to join.

## 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

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

### Local development without Nox

To install the local package, its dependencies and various development dependencies run:

```shell
poetry install --with tests,docs,mypy,pre-commit
```

This will install the dependencies within an isolated virtual environment managed by Poetry. To activate that environment run:

```shell
poetry shell
```

Within this environment, the following commands can be used:

```shell
# run tests
pytest tests
# run mypy
mypy --explicit-package-bases pytket tests docs/conf.py docs/build-docs
# run pre-commit checks
pre-commit run --all-files --show-diff-on-failure
# build documentation
./docs/build-docs
```

To exit the Poetry environment, run:

```shell
exit
```

## Contributing

Pull requests are welcome. To make a PR, first fork the repo, make your proposed
changes on the `main` branch, and open a PR from your fork. If it passes
tests and is accepted after review, it will be merged in.

### Code style

#### Formatting and Linting

All code will be checked on the CI with [black](https://black.readthedocs.io/en/stable/) and [pylint](https://pypi.org/project/pylint/)
as configured within the `pre-commit` checks. These checks should be
run locally before any pull request submission using the corresponding `nox` session or `pre-commit` directly (see above).
The used versions of the formatting ad linting tools is specified in the [pyproject.toml](pyproject.toml).

#### Type annotation

On the CI, [mypy](https://mypy.readthedocs.io/en/stable/) is used as a static
type checker and all submissions must pass its checks. You should therefore run
`mypy` locally on any changed files before submitting a PR. This should be done using the method
described under Local development [with Nox](#local-development-with-nox-recommended) or [without Nox](#local-development-without-nox).

### Adding Tests

When adding a new feature, please add appropriate tests for it within the [tests](tests) directory. When fixing a bug, please
add a test that demonstrates the fix.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/CQCL/pytket-aqt",
    "name": "pytket-aqt",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "TKET development team",
    "author_email": "tket-support@quantinuum.com",
    "download_url": null,
    "platform": null,
    "description": "# pytket-aqt\n\n[Pytket](https://tket.quantinuum.com/api-docs/index.html) is a python module for interfacing\nwith tket, a quantum computing toolkit and optimising compiler developed by Quantinuum.\n\n`pytket-aqt` is an extension to `pytket` that allows `pytket` circuits to be\nexecuted on AQT's ([Alpine Quantum Technologies'](https://www.aqt.eu/)) quantum devices and simulators.\n\nSee [extension documentation](https://cqcl.github.io/pytket-aqt/api/index.html) for more.\n\n## Getting started\n\n`pytket-aqt` is available for Python 3.10, 3.11 and 3.12, on Linux, MacOS\nand Windows. To install, run:\n\n```shell\npip install pytket-aqt\n```\n\nThis will install `pytket` if it isn't already installed, and add new classes\nand methods into the `pytket.extensions` namespace.\n\n## Available devices\n\n`pytket-aqt` offers offline simulators for aqt devices that do not require special access.\nAccess to remote simulators and machines can be configured by providing an AQT access token.\n\nTo see which devices are available to you, use the `AQTBackend.print_device_table` method.\nThis method will prompt for an access token if none has been configured. Providing a token at the\nprompt will store it in memory for further API use. Skip the prompt to see the available offline\nsimulators. It is also possible to store and use your access token across sessions using\n`config.set_aqt_config`.\n\n## Ion Shuttling\n\nThe `AQTMultiZoneBackend` supports routing of a circuit to a particular segmented ion-trap architecture before submission. This feature is experimental and not necessary for any currently available AQT devices. In order to use the graph partitioning based algorithms within this context, a manual installation of the [mt-kahypar](https://github.com/kahypar/mt-kahypar) package is necessary. See the instructions there for details.\n\n## Bugs, support and feature requests\n\nPlease file bugs and feature requests on the Github\n[issue tracker](https://github.com/CQCL/pytket-aqt/issues).\n\nThere is also a Slack channel for discussion and support. Click [here](https://tketusers.slack.com/join/shared_invite/zt-18qmsamj9-UqQFVdkRzxnXCcKtcarLRA#/shared-invite/email) to join.\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\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### Local development without Nox\n\nTo install the local package, its dependencies and various development dependencies run:\n\n```shell\npoetry install --with tests,docs,mypy,pre-commit\n```\n\nThis will install the dependencies within an isolated virtual environment managed by Poetry. To activate that environment run:\n\n```shell\npoetry shell\n```\n\nWithin this environment, the following commands can be used:\n\n```shell\n# run tests\npytest tests\n# run mypy\nmypy --explicit-package-bases pytket tests docs/conf.py docs/build-docs\n# run pre-commit checks\npre-commit run --all-files --show-diff-on-failure\n# build documentation\n./docs/build-docs\n```\n\nTo exit the Poetry environment, run:\n\n```shell\nexit\n```\n\n## Contributing\n\nPull requests are welcome. To make a PR, first fork the repo, make your proposed\nchanges on the `main` branch, and open a PR from your fork. If it passes\ntests and is accepted after review, it will be merged in.\n\n### Code style\n\n#### Formatting and Linting\n\nAll code will be checked on the CI with [black](https://black.readthedocs.io/en/stable/) and [pylint](https://pypi.org/project/pylint/)\nas configured within the `pre-commit` checks. These checks should be\nrun locally before any pull request submission using the corresponding `nox` session or `pre-commit` directly (see above).\nThe used versions of the formatting ad linting tools is specified in the [pyproject.toml](pyproject.toml).\n\n#### Type annotation\n\nOn the CI, [mypy](https://mypy.readthedocs.io/en/stable/) is used as a static\ntype checker and all submissions must pass its checks. You should therefore run\n`mypy` locally on any changed files before submitting a PR. This should be done using the method\ndescribed under Local development [with Nox](#local-development-with-nox-recommended) or [without Nox](#local-development-without-nox).\n\n### Adding Tests\n\nWhen adding a new feature, please add appropriate tests for it within the [tests](tests) directory. When fixing a bug, please\nadd a test that demonstrates the fix.\n\n",
    "bugtrack_url": null,
    "license": "Apache 2",
    "summary": "Extension for pytket, providing access to AQT backends",
    "version": "0.36.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/CQCL/pytket-aqt/issues",
        "Documentation": "https://cqcl.github.io/pytket-aqt/api/index.html",
        "Homepage": "https://github.com/CQCL/pytket-aqt",
        "Repository": "https://github.com/CQCL/pytket-aqt"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3adfbfb5170e9d56e42f1b89dede7d40b7ab9d8662546c5587b0286507ee0192",
                "md5": "5a07d522e3bd4945be09174f47dc05d4",
                "sha256": "ab2e8cb90a1e2954c91f70f3d201f9aabdf9aa9cdc946e81120c633dcc56e558"
            },
            "downloads": -1,
            "filename": "pytket_aqt-0.36.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5a07d522e3bd4945be09174f47dc05d4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.10",
            "size": 59008,
            "upload_time": "2024-11-22T15:59:33",
            "upload_time_iso_8601": "2024-11-22T15:59:33.040942Z",
            "url": "https://files.pythonhosted.org/packages/3a/df/bfb5170e9d56e42f1b89dede7d40b7ab9d8662546c5587b0286507ee0192/pytket_aqt-0.36.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-22 15:59:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "CQCL",
    "github_project": "pytket-aqt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pytket-aqt"
}
        
Elapsed time: 0.75036s