Skip to content

Commit

Permalink
Merge pull request #295 from entropicalabs/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
KilianPoirier authored Nov 27, 2023
2 parents 01f5028 + 3c76547 commit 072225e
Show file tree
Hide file tree
Showing 25 changed files with 1,122 additions and 354 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
run: |
source env/bin/activate
ipython kernel install --name "env" --user
pytest tests/ src/*/tests -m 'not (qpu or sim)' --cov -n auto
pytest tests/ src/openqaoa-core/tests src/openqaoa-azure/tests src/openqaoa-braket/tests src/openqaoa-qiskit/tests -m 'not (qpu or sim)' --cov -n auto
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_main_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
run: |
source env/bin/activate
ipython kernel install --name "env" --user
pytest tests/ src/*/tests -m 'not (qpu or sim)' --cov --cov-report=xml:coverage.xml
pytest tests/ src/openqaoa-core/tests src/openqaoa-azure/tests src/openqaoa-braket/tests src/openqaoa-qiskit/tests -m 'not (qpu or sim)' --cov --cov-report=xml:coverage.xml
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_main_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ jobs:
run: |
source env/bin/activate
ipython kernel install --user --name "env"
pytest tests/ src/*/tests -m 'not (qpu or api or docker_aws or braket_api or sim)'
pytest tests/ src/openqaoa-core/tests src/openqaoa-azure/tests src/openqaoa-braket/tests src/openqaoa-qiskit/tests -m 'not (qpu or api or docker_aws or braket_api or sim)'
2 changes: 1 addition & 1 deletion .github/workflows/test_main_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ jobs:
run: |
.\env\Scripts\Activate.ps1
ipython kernel install --name "env" --user
pytest \tests -m 'not (qpu or api or docker_aws or braket_api or sim)'
pytest tests/ src/openqaoa-core/tests src/openqaoa-azure/tests src/openqaoa-braket/tests src/openqaoa-qiskit/tests -m 'not (qpu or api or docker_aws or braket_api or sim)'
Get-ChildItem -Directory | ForEach-Object { pytest $_.FullName -m 'not (qpu or api or docker_aws or braket_api or sim)'}
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
local-install:
pip install ./src/openqaoa-core
pip install ./src/openqaoa-qiskit
pip install ./src/openqaoa-pyquil
# pip install ./src/openqaoa-pyquil
pip install ./src/openqaoa-braket
pip install ./src/openqaoa-azure
pip install .
Expand All @@ -14,7 +14,7 @@ local-install:
dev-install:
pip install -e ./src/openqaoa-core
pip install -e ./src/openqaoa-qiskit
pip install -e ./src/openqaoa-pyquil
# pip install -e ./src/openqaoa-pyquil
pip install -e ./src/openqaoa-braket
pip install -e ./src/openqaoa-azure
pip install -e .
Expand All @@ -23,7 +23,7 @@ dev-install:
dev-install-tests:
pip install -e ./src/openqaoa-core[tests]
pip install -e ./src/openqaoa-qiskit
pip install -e ./src/openqaoa-pyquil
# pip install -e ./src/openqaoa-pyquil
pip install -e ./src/openqaoa-braket
pip install -e ./src/openqaoa-azure
pip install -e .
Expand All @@ -32,7 +32,7 @@ dev-install-tests:
dev-install-docs:
pip install -e ./src/openqaoa-core[docs]
pip install -e ./src/openqaoa-qiskit
pip install -e ./src/openqaoa-pyquil
# pip install -e ./src/openqaoa-pyquil
pip install -e ./src/openqaoa-braket
pip install -e ./src/openqaoa-azure
pip install -e .
Expand All @@ -41,7 +41,7 @@ dev-install-docs:
dev-install-all:
pip install -e ./src/openqaoa-core[all]
pip install -e ./src/openqaoa-qiskit
pip install -e ./src/openqaoa-pyquil
# pip install -e ./src/openqaoa-pyquil
pip install -e ./src/openqaoa-braket
pip install -e ./src/openqaoa-azure
pip install -e .
Expand Down
4 changes: 4 additions & 0 deletions docs/source/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# CHANGELOG

```{include} ../../CHANGELOG.md
```
7 changes: 0 additions & 7 deletions docs/source/changelog.rst

This file was deleted.

5 changes: 5 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
"IPython.sphinxext.ipython_console_highlighting",
"nbsphinx",
"sphinx.ext.intersphinx",
"myst_parser",
# "myst_nb",
]

autodoc_mock_imports = [
Expand Down Expand Up @@ -124,3 +126,6 @@

# def setup(app):
# app.connect(skip)

# pygments_style = 'sphinx'
# suppress_warnings = ["myst_header"]
2 changes: 1 addition & 1 deletion docs/source/openqaoa_azure/openqaoa_azure_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ You can install the latest version of openqaoa-azure directly from PyPi. We reco
Installation instructions for Developers
----------------------------------------
OpenQAOA-Azure does not yet support developer install as a standalone package. If you wish to work in developer mode, please install the entire library. Instructions are available [here]()
OpenQAOA-Azure does not yet support developer install as a standalone package. If you wish to work in developer mode, please install the entire library. Instructions are available :ref:`here <openqaoa>`

Should you face any issue during the installation, please drop us an email at [email protected] or open an issue!
4 changes: 2 additions & 2 deletions docs/source/openqaoa_braket/openqaoa_braket_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ OpenQAOA Braket Installation

Install via PyPI
----------------
You can install the latest version of openqaoa-braket directly from PyPi. We recommend creating a virtual environment with `python>=3.8` first and then simply pip install openqaoa-braket with the following command.
You can install the latest version of openqaoa-braket directly from PyPi. We recommend creating a virtual environment with ``python>=3.8`` first and then simply pip install openqaoa-braket with the following command.

**NOTE:** Installing ``openqaoa-braket`` installs ``openqaoa-core`` by default

Expand All @@ -14,6 +14,6 @@ You can install the latest version of openqaoa-braket directly from PyPi. We rec
Installation instructions for Developers
----------------------------------------

OpenQAOA-Braket does not yet support developer install as a standalone package. If you wish to work in developer mode, please install the entire library. Instructions are available [here]()
OpenQAOA-Braket does not yet support developer install as a standalone package. If you wish to work in developer mode, please install the entire library. Instructions are available :ref:`here <openqaoa>`

Should you face any issue during the installation, please drop us an email at [email protected] or open an issue!
2 changes: 1 addition & 1 deletion docs/source/openqaoa_core/openqaoa_core_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ You can install the latest version of openqaoa-core directly from PyPi. We recom
Installation instructions for Developers
----------------------------------------

OpenQAOA-Core does not yet support developer install as a standalone package. If you wish to work in developer mode, please install the entire library. Instructions are available [here]()
OpenQAOA-Core does not yet support developer install as a standalone package. If you wish to work in developer mode, please install the entire library. Instructions are available :ref:`here <openqaoa>`

Should you face any issue during the installation, please drop us an email at [email protected] or open an issue!
65 changes: 40 additions & 25 deletions docs/source/openqaoa_metapackage_install.rst
Original file line number Diff line number Diff line change
@@ -1,49 +1,64 @@
OpenQAOA Metapackage Installation
=================================
.. _openqaoa:

The following instructions install OpenQAOA along with all optional plugins

OpenQAOA is divided into separately installable plugins based on the requirements of the user. The core elements of the package are placed in `openqaoa-core` which comes pre-installed with each flavour of OpenQAOA.
OpenQAOA is divided into separately installable plugins based on the requirements of the user. The core elements of the package are placed in ``openqaoa-core`` which comes pre-installed with each flavour of OpenQAOA.

Currently, OpenQAOA supports the following backends and each can be installed exclusively with the exception of `openqaoa-azure` which installs `openqaoa-qiskit` as an additional requirement because Azure backends support circuit submissions via `qiskit`.
- `openqaoa-braket` for AWS Braket
- `openqaoa-azure` for Microsoft Azure Quantum
- `openqaoa-pyquil` for Rigetti Pyquil
- `openqaoa-qiskit` for IBM Qiskit
Currently, OpenQAOA supports the following backends and each can be installed exclusively with the exception of ``openqaoa-azure`` which installs ``openqaoa-qiskit`` as an additional requirement because Azure backends support circuit submissions via `qiskit`.

- ``openqaoa-braket`` for AWS Braket
- ``openqaoa-azure`` for Microsoft Azure Quantum
- ``openqaoa-pyquil`` for Rigetti Pyquil
- ``openqaoa-qiskit`` for IBM Qiskit

The OpenQAOA metapackage allows you to install all OpenQAOA plug-ins together.

Install via PyPI
----------------
You can install the latest version of OpenQAOA directly from PyPI. First, create a virtual environment with python3.8, 3.9, 3.10 and then pip install openqaoa with the following command
```
.. code-block:: bash
pip install openqaoa
```


Install via git clone
---------------------
Alternatively, you can install OpenQAOA manually from the GitHub repository by following the instructions below.

**NOTE:** We recommend creating a python virtual environment for this project using a python environment manager, for instance Anaconda. Instructions can be found [here](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands). Make sure to use **python 3.8** (or newer) for the environment.
**NOTE:** We recommend creating a python virtual environment for this project using a python environment manager, for instance Anaconda. Instructions can be found `here <https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands>`_. Make sure to use **python 3.8** (or newer) for the environment.

1. Clone the git repository:
```
git clone https://github.com/entropicalabs/openqaoa.git
```
2. After cloning the repository `cd openqaoa` and pip install the package with instructions from the Makefile as follows
```
make local-install
```

.. code-block:: bash
git clone https://github.com/entropicalabs/openqaoa.git
2. After cloning the repository ``cd openqaoa`` and pip install the package with instructions from the Makefile as follows

.. code-block:: bash
make local-install
Installation instructions for Developers
----------------------------------------
Users can install OpenQAOA in the developer mode via the Makefile. For a clean editable install of the package run the following command from the `openqaoa` folder.
```
make dev-install
```
The package can be installed as an editable with extra requirements defined in the `setup.py`. If you would like to install the extra requirements to be able run the tests module or generate the docs, you can run the following
Users can install OpenQAOA in the developer mode via the Makefile. For a clean editable install of the package run the following command from the ``openqaoa`` folder.

.. code-block:: bash
make dev-install
The package can be installed as an editable with extra requirements defined in the ``setup.py``. If you would like to install the extra requirements to be able run the tests module or generate the docs, you can run the following

.. code-block:: bash
make dev-install-x
```
make dev-install-x, with x = {tests, docs, all}
```
with x = {tests, docs, all}

Should you face any issue during the installation, please drop us an email at [email protected] or open an issue!
Should you face any issue during the installation, please drop us an email at [email protected] or open an issue!
4 changes: 2 additions & 2 deletions docs/source/openqaoa_pyquil/openqaoa_pyquil_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ OpenQAOA Pyquil Installation
Install via PyPI
----------------

You can install the latest version of openqaoa-pyquil directly from PyPi. We recommend creating a virtual environment with `python>=3.8` first and then simply pip install openqaoa-pyquil with the following command.
You can install the latest version of openqaoa-pyquil directly from PyPi. We recommend creating a virtual environment with ``python>=3.8`` first and then simply pip install openqaoa-pyquil with the following command.

**NOTE:** Installing ``openqaoa-pyquil`` installs ``openqaoa-core`` by default

Expand All @@ -15,6 +15,6 @@ You can install the latest version of openqaoa-pyquil directly from PyPi. We rec
Installation instructions for Developers
----------------------------------------

OpenQAOA-Qiskit does not yet support developer install as a standalone package. If you wish to work in developer mode, please install the entire library. Instructions are available [here]()
OpenQAOA-Qiskit does not yet support developer install as a standalone package. If you wish to work in developer mode, please install the entire library. Instructions are available :ref:`here <openqaoa>`

Should you face any issue during the installation, please drop us an email at [email protected] or open an issue!
4 changes: 2 additions & 2 deletions docs/source/openqaoa_qiskit/openqaoa_qiskit_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ OpenQAOA Qiskit Installation
Install via PyPI
----------------

You can install the latest version of openqaoa-qiskit directly from PyPi. We recommend creating a virtual environment with `python>=3.8` first and then simply pip install openqaoa-qiskit with the following command.
You can install the latest version of openqaoa-qiskit directly from PyPi. We recommend creating a virtual environment with ``python>=3.8`` first and then simply pip install openqaoa-qiskit with the following command.

**NOTE:** Installing ``openqaoa-qiskit`` installs ``openqaoa-core`` by default

Expand All @@ -15,6 +15,6 @@ You can install the latest version of openqaoa-qiskit directly from PyPi. We rec
Installation instructions for Developers
----------------------------------------

OpenQAOA-Qiskit does not yet support developer install as a standalone package. If you wish to work in developer mode, please install the entire library. Instructions are available [here]()
OpenQAOA-Qiskit does not yet support developer install as a standalone package. If you wish to work in developer mode, please install the entire library. Instructions are available :ref:`here <openqaoa>`

Should you face any issue during the installation, please drop us an email at [email protected] or open an issue!
4 changes: 2 additions & 2 deletions examples/community_tutorials/02_docplex_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1082,8 +1082,8 @@
}
],
"source": [
"#Specific local device usign qiskit backend\n",
"device = create_device(\"local\", 'pyquil.statevector_simulator')\n",
"#Specific local device usign local vectorized backend\n",
"device = create_device(\"local\", 'vectorized')\n",
"\n",
"#Is possible check the devices using qaoa.local_simulators, qaoa.cloud_provider\n",
"qaoa = QAOA(device)\n",
Expand Down
Loading

0 comments on commit 072225e

Please sign in to comment.