Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 45 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,46 @@
version: 2
version: 2.1

jobs:
build:
working_directory: ~/open-controls
docker:
- image: continuumio/anaconda3
steps:
- checkout
- run: python3 setup.py install
- run: pytest
- run: pytest --nbval-lax examples/*.ipynb --sanitize-with examples/notebook-sanitize.cfg
- run: pylint qctrlopencontrols --rcfile=.pylintrc
- run: pylint tests --rcfile=.pylintrc
orbs:
q-ctrl: q-ctrl/python@dev:0.0.72

workflows:
version: 2

"PyPi Project":
jobs:
- q-ctrl/open_test:
context: q-ctrl-api-development
filters:
tags: # Tag filter required because the release job has a tag filter
only: /.*/
- q-ctrl/open_build:
context: q-ctrl-api-development
filters:
branches:
only:
- master
- development
tags: # Tag filter required because the release job has a tag filter
only: /.*/
- q-ctrl/pypi_publish:
context: q-ctrl-api-development
requires:
- q-ctrl/open_test
- q-ctrl/open_build
filters:
branches:
only:
- development
tags:
only: /^v?\d+(\.\d+){1,2}rc\d+$/ # RC version required for publish from development
- q-ctrl/pypi_publish:
context: q-ctrl-api-production
requires:
- q-ctrl/open_test
- q-ctrl/open_build
filters:
branches:
only:
- master
tags:
only: /^v?\d+(\.\d+){1,2}$/
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Example controls
*.csv

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -102,6 +105,7 @@ ENV/

# pytest
.pytest_cache/*
junit.xml

#Mac related files
*.DS_Store
Expand All @@ -112,3 +116,4 @@ qctrl_library.code-workspace
# docs
docs-source
docs

71 changes: 43 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Q-CTRL Open Controls
# Q-CTRL Open Controls #

Q-CTRL Open Controls is an open-source Python package that makes it easy to create and deploy established error-robust quantum control protocols from the open literature. The aim of the package is to be the most comprehensive library of published and tested quantum control techniques developed by the community, with easy to use export functions allowing users to deploy these controls on:

Expand All @@ -8,84 +8,99 @@ Q-CTRL Open Controls is an open-source Python package that makes it easy to crea

Anyone interested in quantum control is welcome to contribute to this project.

## Table of Contents
## Table of Contents ##

- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)
* [Installation](#installation)
* [Usage](#usage)
* [Contributing](#contributing)
* [Credits](#credits)
* [License](#license)

## Installation
## Installation ##

Q-CTRL Open Controls can be install through `pip` or from source. We recommend the `pip` distribution to get the most recent stable release. If you want the latest features then install from source.

### Requirements
### Requirements ###

To use Q-CTRL Open Controls you will need an installation of Python. We recommend using the [Anaconda](https://www.anaconda.com/) distribution of Python. Anaconda includes standard numerical and scientific Python packages which are optimally compiled for your machine. Follow the [Anaconda Installation](https://docs.anaconda.com/anaconda/install/) instructions and consult the [Anaconda User guide](https://docs.anaconda.com/anaconda/user-guide/) to get started.

We use interactive jupyter notebooks for our usage examples. The Anaconda python distribution comes with editors for these files, or you can [install the jupyter notebook editor](https://jupyter.org/install) on its own.

### Using PyPi
### Using PyPi ###

Use `pip` to install the latest version of Q-CTRL Open Controls.

```shell
$ pip install qctrl-open-controls
pip install qctrl-open-controls
```

### From Source
### From Source ###

The source code is hosted on [Github](https://github.com/qctrl/python-open-controls). The repository can be cloned using

```shell
$ git clone git@github.com:qctrl/python-open-controls.git
git clone git@github.com:qctrl/python-open-controls.git
```

Once the clone is complete, you can run the install script.
Once the clone is complete, you have two options:

1. Using setup.py

```shell
$ cd python-open-controls
$ python setup.py develop
cd python-open-controls
python setup.py develop
```

**Note:** We recommend installing using `develop` to point your installation at the source code in the directory where you cloned the repository.

To test your installation run `pytest` in the `python-open-controls` directory.
2. Using Poetry

```shell
$ pytest
cd python-open-controls
./setup-poetry.sh
```

## Usage
**Note:** if you are on Windows, you'll need to install [Poetry](https://poetry.eustace.io) manually, and use:

```cmd
cd python-open-controls
poetry install
```

Usage depends on the application. We've provided a set of [example Jupyter notebooks](examples) addressing a variety of quantum control problems. Below is a short description of each notebook grouped by application. For further details on usage, use the inline documentation in the source code.
Once installed via one of the above methods, test your installation by running `pytest` in the `python-open-controls` directory.

### Dynamical Decoupling Sequences (DDS)
```shell
pytest
```

## Usage ###

Usage depends on the application. We've provided a set of [example Jupyter notebooks](examples) addressing a variety of quantum control problems. Below is a short description of each notebook grouped by application. For further details on usage, use the inline documentation in the source code.

### Dynamical Decoupling Sequences (DDS) ###

Q-CTRL Open Controls can create a large library of standard DDS which can be exported in a variety of formats.

#### Create a DDS
#### Create a DDS ####

[`examples/creating_a_dds.ipynb`](examples/creating_a_dds.ipynb) demonstrates how to use Q-CTRL Open Controls to create a DDS from a large library of published dynamical decoupling protocols. It also shows how to make Custom DDS with timings, offsets and unitaries defined by the user. The notebook shows how to export a DDS for deployment in the [Q-CTRL products](https://q-ctrl.com/products/) or your quantum hardware.

#### Export a DDS to Qiskit
#### Export a DDS to Qiskit ####

[`examples/export_a_dds_to_qiskit.ipynb`](examples/export_a_dds_to_qiskit.ipynb) demonstrates how to take a DDS and convert it to a Qiskit circuit so it can be run on IBM's quantum computers. It also demonstrates using a DDS to improve the performance of a quantum circuit execution by extending the coherence time of a qubit.

#### Export a DDS to Cirq
#### Export a DDS to Cirq ####

[`examples/export_a_dds_to_cirq.ipynb`](examples/export_a_dds_to_cirq.ipynb) demonstrates how to take a DDS and convert it to a Cirq circuit or schdule. It also shows how to run a circuit or schedule in a Cirq simulator.


## Contributing
## Contributing ##

See [Contributing](https://github.com/qctrl/.github/blob/master/CONTRIBUTING.md).

## Credits
## Credits ##

See [Contributors](https://github.com/qctrl/python-open-controls/graphs/contributors).

## License
## License ##

See [LICENSE](LICENSE).
125 changes: 125 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@

Q-CTRL Open Controls
====================

Q-CTRL Open Controls is an open-source Python package that makes it easy to create and deploy established error-robust quantum control protocols from the open literature. The aim of the package is to be the most comprehensive library of published and tested quantum control techniques developed by the community, with easy to use export functions allowing users to deploy these controls on:


* Custom quantum hardware
* Publicly available cloud quantum computers
* The `Q-CTRL product suite <https://q-ctrl.com/products/>`_

Anyone interested in quantum control is welcome to contribute to this project.

Table of Contents
-----------------


* `Installation <#installation>`_
* `Usage <#usage>`_
* `Contributing <#contributing>`_
* `Credits <#credits>`_
* `License <#license>`_

Installation
------------

Q-CTRL Open Controls can be install through ``pip`` or from source. We recommend the ``pip`` distribution to get the most recent stable release. If you want the latest features then install from source.

Requirements
^^^^^^^^^^^^

To use Q-CTRL Open Controls you will need an installation of Python. We recommend using the `Anaconda <https://www.anaconda.com/>`_ distribution of Python. Anaconda includes standard numerical and scientific Python packages which are optimally compiled for your machine. Follow the `Anaconda Installation <https://docs.anaconda.com/anaconda/install/>`_ instructions and consult the `Anaconda User guide <https://docs.anaconda.com/anaconda/user-guide/>`_ to get started.

We use interactive jupyter notebooks for our usage examples. The Anaconda python distribution comes with editors for these files, or you can `install the jupyter notebook editor <https://jupyter.org/install>`_ on its own.

Using PyPi
^^^^^^^^^^

Use ``pip`` to install the latest version of Q-CTRL Open Controls.

.. code-block:: shell

pip install qctrl-open-controls

From Source
^^^^^^^^^^^

The source code is hosted on `Github <https://github.com/qctrl/python-open-controls>`_. The repository can be cloned using

.. code-block:: shell

git clone git@github.com:qctrl/python-open-controls.git

Once the clone is complete, you have two options:


#. Using setup.py

.. code-block:: shell

cd python-open-controls
python setup.py develop

**Note:** We recommend installing using ``develop`` to point your installation at the source code in the directory where you cloned the repository.


#. Using Poetry

.. code-block:: shell

cd python-open-controls
./setup-poetry.sh

**Note:** if you are on Windows, you'll need to install `Poetry <https://poetry.eustace.io>`_ manually, and use:

.. code-block:: cmd

cd python-open-controls
poetry install

Once installed via one of the above methods, test your installation by running ``pytest`` in the ``python-open-controls`` directory.

.. code-block:: shell

pytest

Usage
-----

Usage depends on the application. We've provided a set of `example Jupyter notebooks <examples>`_ addressing a variety of quantum control problems. Below is a short description of each notebook grouped by application. For further details on usage, use the inline documentation in the source code.

Dynamical Decoupling Sequences (DDS)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Q-CTRL Open Controls can create a large library of standard DDS which can be exported in a variety of formats.

Create a DDS
~~~~~~~~~~~~

`\ ``examples/creating_a_dds.ipynb`` <examples/creating_a_dds.ipynb>`_ demonstrates how to use Q-CTRL Open Controls to create a DDS from a large library of published dynamical decoupling protocols. It also shows how to make Custom DDS with timings, offsets and unitaries defined by the user. The notebook shows how to export a DDS for deployment in the `Q-CTRL products <https://q-ctrl.com/products/>`_ or your quantum hardware.

Export a DDS to Qiskit
~~~~~~~~~~~~~~~~~~~~~~

`\ ``examples/export_a_dds_to_qiskit.ipynb`` <examples/export_a_dds_to_qiskit.ipynb>`_ demonstrates how to take a DDS and convert it to a Qiskit circuit so it can be run on IBM's quantum computers. It also demonstrates using a DDS to improve the performance of a quantum circuit execution by extending the coherence time of a qubit.

Export a DDS to Cirq
~~~~~~~~~~~~~~~~~~~~

`\ ``examples/export_a_dds_to_cirq.ipynb`` <examples/export_a_dds_to_cirq.ipynb>`_ demonstrates how to take a DDS and convert it to a Cirq circuit or schdule. It also shows how to run a circuit or schedule in a Cirq simulator.

Contributing
------------

See `Contributing <https://github.com/qctrl/.github/blob/master/CONTRIBUTING.md>`_.

Credits
-------

See `Contributors <https://github.com/qctrl/python-open-controls/graphs/contributors>`_.

License
-------

See `LICENSE <LICENSE>`_.
1 change: 1 addition & 0 deletions matplotlibrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
backend: agg
Loading