Skip to content

Commit

Permalink
Update README (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrison authored Nov 1, 2024
1 parent f40652b commit 1d99221
Show file tree
Hide file tree
Showing 4 changed files with 214 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Code of Conduct

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).
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Developer guide

Development of the `qiskit-addon-aqc-tensor` package takes place [on GitHub](https://github.com/Qiskit/qiskit-addon-aqc-tensor).
The [Contributing to Qiskit](https://github.com/Qiskit/qiskit/blob/main/CONTRIBUTING.md) guide may serve as a
useful starting point, as this package builds on [Qiskit].

This package is written in [Python] and uses [tox] as a testing framework. A description of the available
`tox` test environments is located at [`test/README.md`](test/README.md). These environments are used in the
CI workflows, which are described at [`.github/workflows/README.md`](.github/workflows/README.md).

Project configuration, including information about dependencies, is stored in [`pyproject.toml`](pyproject.toml).

We use [Sphinx] for documentation and [reno] for release notes.
We use [Google style docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html),
except we omit the type of each argument, as type information is redundant with Python
[type hints](https://docs.python.org/3/library/typing.html).

We require 100% coverage in all new code.
In rare cases where it is not possible to test a code block, we mark it with ``# pragma: no cover`` so that
the ``coverage`` tests will pass.

[Qiskit]: https://www.ibm.com/quantum/qiskit
[Python]: https://www.python.org/
[tox]: https://github.com/tox-dev/tox
[Sphinx]: https://www.sphinx-doc.org/
[reno]: https://docs.openstack.org/reno/
82 changes: 81 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
[![Release](https://img.shields.io/pypi/v/qiskit-addon-aqc-tensor.svg?label=Release)](https://github.com/Qiskit/qiskit-addon-aqc-tensor/releases)
![Platform](https://img.shields.io/badge/%F0%9F%92%BB%20Platform-Linux%20%7C%20macOS%20%7C%20Windows-informational)
[![Python](https://img.shields.io/pypi/pyversions/qiskit-addon-aqc-tensor?label=Python&logo=python)](https://www.python.org/)
[![Qiskit](https://img.shields.io/badge/Qiskit-%E2%89%A5%201.2%20-%20%236133BD?logo=Qiskit)](https://github.com/Qiskit/qiskit)
<br />
[![Docs (stable)](https://img.shields.io/badge/%F0%9F%93%84%20Docs-stable-blue.svg)](https://qiskit.github.io/qiskit-addon-aqc-tensor/)
[![License](https://img.shields.io/github/license/Qiskit/qiskit-addon-aqc-tensor?label=License)](LICENSE.txt)
[![Downloads](https://img.shields.io/pypi/dm/qiskit-addon-aqc-tensor.svg?label=Downloads)](https://pypi.org/project/qiskit-addon-aqc-tensor/)
[![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)
[![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)

# AQC-Tensor Qiskit addon
# Qiskit addon: approximate quantum compilation with tensor networks (AQC-Tensor)

### Table of contents

* [About](#about)
* [Documentation](#documentation)
* [Installation](#installation)
* [Deprecation Policy](#deprecation-policy)
* [Contributing](#contributing)
* [Citation](#citation)
* [License](#license)

----------------------------------------------------------------------------------------------------

### About

[Qiskit addons](https://docs.quantum.ibm.com/guides/addons) are a collection of modular tools for building utility-scale workloads powered by Qiskit.

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

(Figure is taken from [arXiv:2301.08609](https://arxiv.org/abs/2301.08609).)

----------------------------------------------------------------------------------------------------

### Documentation

All documentation is available at https://qiskit.github.io/qiskit-addon-aqc-tensor/.

----------------------------------------------------------------------------------------------------

### Installation

We encourage installing this package via `pip`, when possible.

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

```bash
pip install 'qiskit-addon-aqc-tensor[aer,quimb-jax]'
```

For more installation information refer to these [installation instructions](INSTALL.rst).

----------------------------------------------------------------------------------------------------

### Deprecation Policy

We follow [semantic versioning](https://semver.org/) and are guided by the principles in
[Qiskit's deprecation policy](https://github.com/Qiskit/qiskit/blob/main/DEPRECATION.md).
We may occasionally make breaking changes in order to improve the user experience.
When possible, we will keep old interfaces and mark them as deprecated, as long as they can co-exist with the
new ones.
Each substantial improvement, breaking change, or deprecation will be documented in the
[release notes](https://qiskit.github.io/qiskit-addon-aqc-tensor/release-notes.html).

----------------------------------------------------------------------------------------------------

### Contributing

The source code is available [on GitHub](https://github.com/Qiskit/qiskit-addon-aqc-tensor).

The developer guide is located at [CONTRIBUTING.md](https://github.com/Qiskit/qiskit-addon-aqc-tensor/blob/main/CONTRIBUTING.md)
in the root of this project's repository.
By participating, you are expected to uphold Qiskit's [code of conduct](https://github.com/Qiskit/qiskit/blob/main/CODE_OF_CONDUCT.md).

We use [GitHub issues](https://github.com/Qiskit/qiskit-addon-aqc-tensor/issues/new/choose) for tracking requests and bugs.

----------------------------------------------------------------------------------------------------

### Citation

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.

----------------------------------------------------------------------------------------------------

### License

[Apache License 2.0](LICENSE.txt)
104 changes: 104 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Test environments

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

tox can be installed by running `pip install tox`.

tox is organized around various "environments," each of which is described below. To run _all_ test environments, run `tox` without any arguments:

```sh
$ tox
```

Environments for this repository are configured in [`tox.ini`] as described below.

## Lint environment

The `lint` environment ensures that the code meets basic coding standards, including

- [_Black_] formatting style
- Style checking with [ruff], [autoflake], and [pydocstyle]
- [mypy] type annotation checker, as configured by [`.mypy.ini`]

The _Black_ and mypy passes are applied also to [Jupyter] notebooks (via [nbqa]).

To run:

```sh
$ tox -e lint
```

## Style environment

The command `tox -e style` will apply automated style fixes. This includes:

- Automated fixes from [ruff] and [autoflake]
- Reformatting of all files in the repository according to _Black_ style

## Test (py##) environments

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:

```sh
$ tox -e py310,py311,py312
```

These environments execute all tests using [pytest], which supports its own simple style of tests, in addition to [unittest]-style tests.

## Notebook environments

The `notebook` and `py##-notebook` environments invoke [nbmake] to ensure that all Jupyter notebooks in the [`docs/`](/docs/) directory execute successfully.

```sh
$ tox -e py310-notebook
```

## Doctest environments

The `doctest` environments use [doctest] to execute the code snippets that are embedded into the documentation strings. The tests get run using [pytest].

```sh
$ tox -e py310-doctest
```

## Coverage environment

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.

To run:

```sh
$ tox -e coverage
```

## Documentation environment

The `docs` environment builds the [Sphinx] documentation locally.

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

To run this environment:

```sh
$ tox -e docs
```

If the build succeeds, it can be viewed by navigating to `docs/_build/html/index.html` in a web browser.

[tox]: https://github.com/tox-dev/tox
[`tox.ini`]: ../tox.ini
[mypy]: https://mypy.readthedocs.io/en/stable/
[`.mypy.ini`]: ../.mypy.ini
[nbmake]: https://github.com/treebeardtech/nbmake
[_Black_]: https://github.com/psf/black
[ruff]: https://github.com/charliermarsh/ruff
[autoflake]: https://github.com/PyCQA/autoflake
[pydocstyle]: https://www.pydocstyle.org/en/stable/
[pylint]: https://github.com/PyCQA/pylint
[nbqa]: https://github.com/nbQA-dev/nbQA
[Jupyter]: https://jupyter.org/
[doctest]: https://docs.python.org/3/library/doctest.html
[pytest]: https://docs.pytest.org/
[unittest]: https://docs.python.org/3/library/unittest.html
[Coverage.py]: https://coverage.readthedocs.io/
[Sphinx]: https://www.sphinx-doc.org/

0 comments on commit 1d99221

Please sign in to comment.