Skip to content

Commit 1d99221

Browse files
authored
Update README (#6)
1 parent f40652b commit 1d99221

File tree

4 files changed

+214
-1
lines changed

4 files changed

+214
-1
lines changed

CODE_OF_CONDUCT.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Code of Conduct
2+
3+
All members of this project agree to adhere to Qiskit's [code of conduct](https://github.com/Qiskit/qiskit/blob/main/CODE_OF_CONDUCT.md).

CONTRIBUTING.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Developer guide
2+
3+
Development of the `qiskit-addon-aqc-tensor` package takes place [on GitHub](https://github.com/Qiskit/qiskit-addon-aqc-tensor).
4+
The [Contributing to Qiskit](https://github.com/Qiskit/qiskit/blob/main/CONTRIBUTING.md) guide may serve as a
5+
useful starting point, as this package builds on [Qiskit].
6+
7+
This package is written in [Python] and uses [tox] as a testing framework. A description of the available
8+
`tox` test environments is located at [`test/README.md`](test/README.md). These environments are used in the
9+
CI workflows, which are described at [`.github/workflows/README.md`](.github/workflows/README.md).
10+
11+
Project configuration, including information about dependencies, is stored in [`pyproject.toml`](pyproject.toml).
12+
13+
We use [Sphinx] for documentation and [reno] for release notes.
14+
We use [Google style docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html),
15+
except we omit the type of each argument, as type information is redundant with Python
16+
[type hints](https://docs.python.org/3/library/typing.html).
17+
18+
We require 100% coverage in all new code.
19+
In rare cases where it is not possible to test a code block, we mark it with ``# pragma: no cover`` so that
20+
the ``coverage`` tests will pass.
21+
22+
[Qiskit]: https://www.ibm.com/quantum/qiskit
23+
[Python]: https://www.python.org/
24+
[tox]: https://github.com/tox-dev/tox
25+
[Sphinx]: https://www.sphinx-doc.org/
26+
[reno]: https://docs.openstack.org/reno/

README.md

+81-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,31 @@
1+
[![Release](https://img.shields.io/pypi/v/qiskit-addon-aqc-tensor.svg?label=Release)](https://github.com/Qiskit/qiskit-addon-aqc-tensor/releases)
12
![Platform](https://img.shields.io/badge/%F0%9F%92%BB%20Platform-Linux%20%7C%20macOS%20%7C%20Windows-informational)
3+
[![Python](https://img.shields.io/pypi/pyversions/qiskit-addon-aqc-tensor?label=Python&logo=python)](https://www.python.org/)
24
[![Qiskit](https://img.shields.io/badge/Qiskit-%E2%89%A5%201.2%20-%20%236133BD?logo=Qiskit)](https://github.com/Qiskit/qiskit)
5+
<br />
6+
[![Docs (stable)](https://img.shields.io/badge/%F0%9F%93%84%20Docs-stable-blue.svg)](https://qiskit.github.io/qiskit-addon-aqc-tensor/)
7+
[![License](https://img.shields.io/github/license/Qiskit/qiskit-addon-aqc-tensor?label=License)](LICENSE.txt)
8+
[![Downloads](https://img.shields.io/pypi/dm/qiskit-addon-aqc-tensor.svg?label=Downloads)](https://pypi.org/project/qiskit-addon-aqc-tensor/)
9+
[![Tests](https://github.com/Qiskit/qiskit-addon-aqc-tensor/actions/workflows/test_latest_versions.yml/badge.svg)](https://github.com/Qiskit/qiskit-addon-aqc-tensor/actions/workflows/test_latest_versions.yml)
10+
[![Coverage](https://coveralls.io/repos/github/Qiskit/qiskit-addon-aqc-tensor/badge.svg?branch=main)](https://coveralls.io/github/Qiskit/qiskit-addon-aqc-tensor?branch=main)
311

4-
# AQC-Tensor Qiskit addon
12+
# Qiskit addon: approximate quantum compilation with tensor networks (AQC-Tensor)
13+
14+
### Table of contents
15+
16+
* [About](#about)
17+
* [Documentation](#documentation)
18+
* [Installation](#installation)
19+
* [Deprecation Policy](#deprecation-policy)
20+
* [Contributing](#contributing)
21+
* [Citation](#citation)
22+
* [License](#license)
23+
24+
----------------------------------------------------------------------------------------------------
25+
26+
### About
27+
28+
[Qiskit addons](https://docs.quantum.ibm.com/guides/addons) are a collection of modular tools for building utility-scale workloads powered by Qiskit.
529

630
This addon enables a Qiskit user to perform approximate quantum compilation using tensor networks,
731
a technique that was introduced in [arXiv:2301.08609](https://arxiv.org/abs/2301.08609).
@@ -16,3 +40,59 @@ It has been tested primarily on Trotter circuits to date. It may, however, be a
1640
![Compression of initial portion of circuit with AQC](docs/images/aqc-compression.png)
1741

1842
(Figure is taken from [arXiv:2301.08609](https://arxiv.org/abs/2301.08609).)
43+
44+
----------------------------------------------------------------------------------------------------
45+
46+
### Documentation
47+
48+
All documentation is available at https://qiskit.github.io/qiskit-addon-aqc-tensor/.
49+
50+
----------------------------------------------------------------------------------------------------
51+
52+
### Installation
53+
54+
We encourage installing this package via `pip`, when possible.
55+
56+
To be useful, this package requires at least one tensor-network backend. The following command installs the [Qiskit Aer](https://github.com/Qiskit/qiskit-aer) backend, as well as the [quimb](https://github.com/jcmgray/quimb) backend with automatic differentiation support from [JAX](https://github.com/jax-ml/jax):
57+
58+
```bash
59+
pip install 'qiskit-addon-aqc-tensor[aer,quimb-jax]'
60+
```
61+
62+
For more installation information refer to these [installation instructions](INSTALL.rst).
63+
64+
----------------------------------------------------------------------------------------------------
65+
66+
### Deprecation Policy
67+
68+
We follow [semantic versioning](https://semver.org/) and are guided by the principles in
69+
[Qiskit's deprecation policy](https://github.com/Qiskit/qiskit/blob/main/DEPRECATION.md).
70+
We may occasionally make breaking changes in order to improve the user experience.
71+
When possible, we will keep old interfaces and mark them as deprecated, as long as they can co-exist with the
72+
new ones.
73+
Each substantial improvement, breaking change, or deprecation will be documented in the
74+
[release notes](https://qiskit.github.io/qiskit-addon-aqc-tensor/release-notes.html).
75+
76+
----------------------------------------------------------------------------------------------------
77+
78+
### Contributing
79+
80+
The source code is available [on GitHub](https://github.com/Qiskit/qiskit-addon-aqc-tensor).
81+
82+
The developer guide is located at [CONTRIBUTING.md](https://github.com/Qiskit/qiskit-addon-aqc-tensor/blob/main/CONTRIBUTING.md)
83+
in the root of this project's repository.
84+
By participating, you are expected to uphold Qiskit's [code of conduct](https://github.com/Qiskit/qiskit/blob/main/CODE_OF_CONDUCT.md).
85+
86+
We use [GitHub issues](https://github.com/Qiskit/qiskit-addon-aqc-tensor/issues/new/choose) for tracking requests and bugs.
87+
88+
----------------------------------------------------------------------------------------------------
89+
90+
### Citation
91+
92+
If you use this package in your research, please cite it according to the [CITATION.bib](https://github.com/Qiskit/qiskit-addon-aqc-tensor/blob/main/CITATION.bib) file.
93+
94+
----------------------------------------------------------------------------------------------------
95+
96+
### License
97+
98+
[Apache License 2.0](LICENSE.txt)

test/README.md

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Test environments
2+
3+
This repository's tests and development automation tasks are organized using [tox], a command-line CI frontend for Python projects. tox is typically used during local development and is also invoked from this repository's GitHub Actions [workflows](../.github/workflows/).
4+
5+
tox can be installed by running `pip install tox`.
6+
7+
tox is organized around various "environments," each of which is described below. To run _all_ test environments, run `tox` without any arguments:
8+
9+
```sh
10+
$ tox
11+
```
12+
13+
Environments for this repository are configured in [`tox.ini`] as described below.
14+
15+
## Lint environment
16+
17+
The `lint` environment ensures that the code meets basic coding standards, including
18+
19+
- [_Black_] formatting style
20+
- Style checking with [ruff], [autoflake], and [pydocstyle]
21+
- [mypy] type annotation checker, as configured by [`.mypy.ini`]
22+
23+
The _Black_ and mypy passes are applied also to [Jupyter] notebooks (via [nbqa]).
24+
25+
To run:
26+
27+
```sh
28+
$ tox -e lint
29+
```
30+
31+
## Style environment
32+
33+
The command `tox -e style` will apply automated style fixes. This includes:
34+
35+
- Automated fixes from [ruff] and [autoflake]
36+
- Reformatting of all files in the repository according to _Black_ style
37+
38+
## Test (py##) environments
39+
40+
The `py##` environments are the main test environments. tox defines one for each version of Python. For instance, the following command will run the tests on Python 3.10, Python 3.11, and Python 3.12:
41+
42+
```sh
43+
$ tox -e py310,py311,py312
44+
```
45+
46+
These environments execute all tests using [pytest], which supports its own simple style of tests, in addition to [unittest]-style tests.
47+
48+
## Notebook environments
49+
50+
The `notebook` and `py##-notebook` environments invoke [nbmake] to ensure that all Jupyter notebooks in the [`docs/`](/docs/) directory execute successfully.
51+
52+
```sh
53+
$ tox -e py310-notebook
54+
```
55+
56+
## Doctest environments
57+
58+
The `doctest` environments use [doctest] to execute the code snippets that are embedded into the documentation strings. The tests get run using [pytest].
59+
60+
```sh
61+
$ tox -e py310-doctest
62+
```
63+
64+
## Coverage environment
65+
66+
The `coverage` environment uses [Coverage.py] to ensure that the fraction of code tested by pytest is above some threshold (enforced to be 100% for new modules). A detailed, line-by-line coverage report can be viewed by navigating to `htmlcov/index.html` in a web browser.
67+
68+
To run:
69+
70+
```sh
71+
$ tox -e coverage
72+
```
73+
74+
## Documentation environment
75+
76+
The `docs` environment builds the [Sphinx] documentation locally.
77+
78+
For the documentation build to succeed, [pandoc](https://pandoc.org/) must be installed. Pandoc is not available via pip, so must be installed through some other means. Linux users are encouraged to install it through their package manager (e.g., `sudo apt-get install -y pandoc`), while macOS users are encouraged to install it via [Homebrew](https://brew.sh/) (`brew install pandoc`). Full instructions are available on [pandoc's installation page](https://pandoc.org/installing.html).
79+
80+
To run this environment:
81+
82+
```sh
83+
$ tox -e docs
84+
```
85+
86+
If the build succeeds, it can be viewed by navigating to `docs/_build/html/index.html` in a web browser.
87+
88+
[tox]: https://github.com/tox-dev/tox
89+
[`tox.ini`]: ../tox.ini
90+
[mypy]: https://mypy.readthedocs.io/en/stable/
91+
[`.mypy.ini`]: ../.mypy.ini
92+
[nbmake]: https://github.com/treebeardtech/nbmake
93+
[_Black_]: https://github.com/psf/black
94+
[ruff]: https://github.com/charliermarsh/ruff
95+
[autoflake]: https://github.com/PyCQA/autoflake
96+
[pydocstyle]: https://www.pydocstyle.org/en/stable/
97+
[pylint]: https://github.com/PyCQA/pylint
98+
[nbqa]: https://github.com/nbQA-dev/nbQA
99+
[Jupyter]: https://jupyter.org/
100+
[doctest]: https://docs.python.org/3/library/doctest.html
101+
[pytest]: https://docs.pytest.org/
102+
[unittest]: https://docs.python.org/3/library/unittest.html
103+
[Coverage.py]: https://coverage.readthedocs.io/
104+
[Sphinx]: https://www.sphinx-doc.org/

0 commit comments

Comments
 (0)