diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 70daba0e7..1d3b2addd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,9 +5,9 @@ on: types: [created] workflow_dispatch: -jobs: +jobs: pypi_update: - + # Only run this job if new work is pushed to "main" # if: github.event_name == 'push' && github.ref == 'refs/heads/main' @@ -19,7 +19,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.9 - name: Check-out repository uses: actions/checkout@v3 @@ -31,7 +31,7 @@ jobs: run: | python -m pip install --upgrade pip build twine pip install setuptools wheel twine - + - name: Publish to PyPI run: | scripts/push_package_pypi.sh __token__ ${{secrets.PYPI_API_TOKEN}} diff --git a/.github/workflows/test_dev.yml b/.github/workflows/test_dev.yml index f2c7b3d84..0034d2ca2 100644 --- a/.github/workflows/test_dev.yml +++ b/.github/workflows/test_dev.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: 3.8 + python-version: 3.9 - name: Log in with Azure uses: azure/login@v1 with: @@ -38,7 +38,7 @@ jobs: pip install ipykernel - name: Setup IBMQ account env: - IBMQ_TOKEN: ${{ secrets.IBMQ_TOKEN }} + IBMQ_TOKEN: ${{ secrets.IBMQ_TOKEN }} run: | IBMQ_TOKEN=$IBMQ_TOKEN source env/bin/activate @@ -81,13 +81,13 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: 3.8 + python-version: 3.9 - name: Install OpenQAOA run: | python -m pip install --upgrade pip make dev-install-docs - + - name: Install qvm run: | find /usr/lib -name "libffi.so*" @@ -104,7 +104,7 @@ jobs: screen -d -m qvm -S screen -d -m quilc -S cd .. - + - name: Build and test Sphinx docs run: | sudo apt-get install pandoc diff --git a/.github/workflows/test_dev_ext.yml b/.github/workflows/test_dev_ext.yml index ef1daf264..c9dbd0a11 100644 --- a/.github/workflows/test_dev_ext.yml +++ b/.github/workflows/test_dev_ext.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: 3.8 + python-version: 3.9 - name: Install qvm run: | find /usr/lib -name "libffi.so*" @@ -47,7 +47,7 @@ jobs: source env/bin/activate python -m pip install --upgrade pip make local-install - pip install -e ./src/openqaoa-core[tests] + pip install -e "./src/openqaoa-core[tests]" pip install ipykernel - name: Run tests run: | @@ -66,14 +66,14 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: 3.8 + python-version: 3.9 - name: Install OpenQAOA run: | python -m pip install --upgrade pip - pip install . - pip install -e ./src/openqaoa-core[docs] - + make local-install + pip install -e "./src/openqaoa-core[docs]" + - name: Install qvm run: | find /usr/lib -name "libffi.so*" @@ -90,7 +90,7 @@ jobs: screen -d -m qvm -S screen -d -m quilc -S cd .. - + - name: Build and test Sphinx docs run: | sudo apt-get install pandoc diff --git a/.github/workflows/test_main_linux.yml b/.github/workflows/test_main_linux.yml index 65b39c541..269d256c4 100644 --- a/.github/workflows/test_main_linux.yml +++ b/.github/workflows/test_main_linux.yml @@ -15,10 +15,10 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ['3.8', '3.9', '3.10'] + python: ['3.9', '3.10', '3.11'] # The type of runner that the job will run on runs-on: ${{ matrix.os }} - + steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 @@ -42,7 +42,7 @@ jobs: pip install ipykernel - name: Setup IBMQ account env: - IBMQ_TOKEN: ${{ secrets.IBMQ_TOKEN }} + IBMQ_TOKEN: ${{ secrets.IBMQ_TOKEN }} run: | IBMQ_TOKEN=$IBMQ_TOKEN source env/bin/activate @@ -68,7 +68,7 @@ jobs: 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 - + - name: Upload coverage reports to Codecov with GitHub Action uses: codecov/codecov-action@v3 with: @@ -86,13 +86,13 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: 3.8 + python-version: 3.9 - name: Install OpenQAOA run: | python -m pip install --upgrade pip make dev-install-docs - + - name: Install qvm run: | find /usr/lib -name "libffi.so*" @@ -109,7 +109,7 @@ jobs: screen -d -m qvm -S screen -d -m quilc -S cd .. - + - name: Build and test Sphinx docs run: | sudo apt-get install pandoc diff --git a/.github/workflows/test_main_macos.yml b/.github/workflows/test_main_macos.yml index f1a3fc0fd..6f4cd276d 100644 --- a/.github/workflows/test_main_macos.yml +++ b/.github/workflows/test_main_macos.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - python: ['3.8', '3.9', '3.10'] + python: ['3.9', '3.10', '3.11'] forest-sdk-version: ['2.23.0'] runs-on: macos-latest @@ -25,8 +25,8 @@ jobs: uses: actions/setup-python@v3 with: python-version: ${{matrix.python}} - - - name: Install forest on macos + + - name: Install forest on macos run: | echo $PATH cd /usr/local/bin/ @@ -44,7 +44,7 @@ jobs: cd .. - name: Install OpenQAOA - run: | + run: | python -m pip install --user virtualenv python -m venv env source env/bin/activate diff --git a/.github/workflows/test_main_windows.yml b/.github/workflows/test_main_windows.yml index 7f38e2dce..c517ba183 100644 --- a/.github/workflows/test_main_windows.yml +++ b/.github/workflows/test_main_windows.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - python: ['3.8', '3.9', '3.10'] + python: ['3.9', '3.10', '3.11'] forest-sdk-version: [2.23.0] # Run on a Windows machine @@ -33,7 +33,7 @@ jobs: - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 - # Install OpenQAOA + # Install OpenQAOA - name: Install OpenQAOA shell: pwsh run: | @@ -57,7 +57,7 @@ jobs: Start-Process -FilePath "C:\Program Files\Rigetti Computing\Forest SDK for Windows\quilc.exe" -ArgumentList "-S" -PassThru Start-Process -FilePath "C:\Program Files\Rigetti Computing\Forest SDK for Windows\qvm.exe" -ArgumentList "-S" -PassThru - # Run all tests + # Run all tests - name: Run tests shell: pwsh run: | diff --git a/.github/workflows/test_pypi.yml b/.github/workflows/test_pypi.yml index 592f22daf..a52cdcd53 100644 --- a/.github/workflows/test_pypi.yml +++ b/.github/workflows/test_pypi.yml @@ -5,13 +5,13 @@ on: - cron: "0 0 * * 1,3,5" #“At 00:00 on Monday, Wednesday, and Friday.” https://crontab.guru/#0_0_*_*_1,3,5 workflow_dispatch: -jobs: +jobs: test_pypi: strategy: fail-fast: false matrix: os: [ubuntu-latest] - python: ['3.8', '3.9', '3.10'] + python: ['3.9', '3.10', '3.11'] # The type of runner that the job will run on runs-on: ${{ matrix.os }} @@ -26,37 +26,37 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - + - name: Install OpenQAOA-Core run: | pip install openqaoa-core - python -c 'from openqaoa._version import __version__; print(__version__)' - - + python -c 'from openqaoa import __version__; print(__version__)' + + - name: Install OpenQAOA-Qiskit run: | pip install openqaoa-qiskit - python -c 'from openqaoa._version import __version__; print(__version__)' - - + python -c 'from openqaoa import __version__; print(__version__)' + + - name: Install OpenQAOA-Pyquil run: | pip install openqaoa-pyquil - python -c 'from openqaoa._version import __version__; print(__version__)' - - + python -c 'from openqaoa import __version__; print(__version__)' + + - name: Install OpenQAOA-Braket run: | pip install openqaoa-braket - python -c 'from openqaoa._version import __version__; print(__version__)' - - + python -c 'from openqaoa import __version__; print(__version__)' + + - name: Install OpenQAOA-Azure run: | pip install openqaoa-azure - python -c 'from openqaoa._version import __version__; print(__version__)' + python -c 'from openqaoa import __version__; print(__version__)' - name: Install OpenQAOA (Full) run: | pip install openqaoa - python -c 'from openqaoa._version import __version__; print(__version__)' + python -c 'from openqaoa import __version__; print(__version__)' diff --git a/.github/workflows/test_pypi_prerelease.yml b/.github/workflows/test_pypi_prerelease.yml index d308f5a98..2ebbd2d78 100644 --- a/.github/workflows/test_pypi_prerelease.yml +++ b/.github/workflows/test_pypi_prerelease.yml @@ -5,13 +5,13 @@ on: # - cron: "0 0 * * 1,3,5" #“At 00:00 on Monday, Wednesday, and Friday.” https://crontab.guru/#0_0_*_*_1,3,5 workflow_dispatch: -jobs: +jobs: test_pypi: strategy: fail-fast: false matrix: os: [ubuntu-latest] - python: ['3.8', '3.9', '3.10', '3.11'] + python: ['3.9', '3.10', '3.11'] # The type of runner that the job will run on runs-on: ${{ matrix.os }} @@ -26,37 +26,37 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - + - name: Install OpenQAOA-Core release candidate run: | pip install --pre openqaoa-core - python -c 'from openqaoa._version import __version__; print(__version__)' - - + python -c 'from openqaoa import __version__; print(__version__)' + + - name: Install OpenQAOA-Qiskit release candidate run: | pip install --pre openqaoa-qiskit - python -c 'from openqaoa._version import __version__; print(__version__)' - - + python -c 'from openqaoa import __version__; print(__version__)' + + - name: Install OpenQAOA-Pyquil release candidate run: | pip install --pre openqaoa-pyquil - python -c 'from openqaoa._version import __version__; print(__version__)' - - + python -c 'from openqaoa import __version__; print(__version__)' + + - name: Install OpenQAOA-Braket release candidate run: | pip install --pre openqaoa-braket - python -c 'from openqaoa._version import __version__; print(__version__)' - - + python -c 'from openqaoa import __version__; print(__version__)' + + - name: Install OpenQAOA-Azure release candidate run: | pip install --pre openqaoa-azure - python -c 'from openqaoa._version import __version__; print(__version__)' + python -c 'from openqaoa import __version__; print(__version__)' - name: Install OpenQAOA (Full) release candidate run: | pip install --pre openqaoa - python -c 'from openqaoa._version import __version__; print(__version__)' + python -c 'from openqaoa import __version__; print(__version__)' diff --git a/.readthedocs.yml b/.readthedocs.yml index f6ab1ec3b..573131d25 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -9,7 +9,7 @@ version: 2 build: os: ubuntu-20.04 tools: - python: "3.8" + python: "3.9" jobs: pre_build: - echo "Creating the notebook folder from .readthedocs.yml" diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index d4e1cf8ec..000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -include README.md -include _version.py \ No newline at end of file diff --git a/_version.py b/_version.py deleted file mode 100644 index 845be4539..000000000 --- a/_version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.2.5" \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index e161750e8..000000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,14 +0,0 @@ -matplotlib>=2.2 -numpy==1.22.0 -qiskit==0.36 -pyquil>=3.1 -nbsphinx==0.8.9 -sphinx>=4.5.0 -sphinx-autodoc-typehints==1.18.1 -sphinx-rtd-theme==1.0.0 -ipython==8.10.0 -pandas>=1.3.5 -amazon-braket-sdk==1.23.0 -autograd>=1.4 -semantic_version>=2.10 -autoray>=0.3.1 diff --git a/docs/source/index.rst b/docs/source/index.rst index ad7ec5f5d..45a4308db 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,7 +1,7 @@ Welcome to OpenQAOA's documentation! ==================================== -OpenQAOA is an advanced multi-backend SDK for quantum optimization designed to ease research efforts within the VQA environment while ensuring the reliability and reproducibility of results. The library is divided into individually installable backend plugins. +OpenQAOA is an advanced multi-backend SDK for quantum optimization designed to ease research efforts within the VQA environment while ensuring the reliability and reproducibility of results. The library is divided into individually installable backend plugins. The core functionalities of the package are contained within `openqaoa-core`, required to run QAOA computations on any Quantum hardware or simulator. Further it includes `openqaoa-qiskit`, `openqaoa-pyquil`, `openqaoa-azure`, `openqaoa-braket` for running QAOA on devices accessible through the respective cloud providers. Installing any plugin through PyPI ships `openqaoa-core` along with it to provide the complete set of tools required to run QAOA computations. Users can also easily install all OpenQAOA plugins available by installing `openqaoa` through PyPI. The `openqaoa` metapackage easily manages all OpenQAOA plugins and their dependencies. Users can also install `openqaoa` in developer mode by git cloning the repository and executing the install Makefile, @@ -36,12 +36,12 @@ Getting started Installing ---------- -OpenQAOA provides several installation options to choose from. The package consists of `openqaoa-core` and backend specific modules that let users selectively install the provider they wish to run QAOA on. +OpenQAOA provides several installation options to choose from. The package consists of `openqaoa-core` and backend specific modules that let users selectively install the provider they wish to run QAOA on. For instance, `openqaoa-qiskit` enables QAOA computations on IBMQ devices and simulators, and qiskit supported devices. For a complete installation including all supported cloud providers, -users can simply install the full `openqaoa` metapackage. Do note, `openqaoa-core` is a dependency for all backend specific modules and the full `openqaoa` pacakge. +users can simply install the full `openqaoa` metapackage. Do note, `openqaoa-core` is a dependency for all backend specific modules and the full `openqaoa` package. Therefore, it ships by default with all flavors of OpenQAOA installations. -You can install the latest variants of OpenQAOA directly from PyPI. First, we recommend you create a virtual environment with python>=3.10 and then pip install openqaoa variants with the following commands +You can install the latest variants of OpenQAOA directly from PyPI. First, we recommend you create a virtual environment with python>=3.11 and then pip install openqaoa variants with the following commands - To install full OpenQAOA with all backend plugins and the `openqaoa` metapackage, users can .. code-block:: bash @@ -62,9 +62,9 @@ Alternatively, you can install manually directly from the GitHub repository by git clone https://github.com/entropicalabs/openqaoa.git -2. We recommend creating a new python `virtual environment`, for instance, using conda. Instructions on how to create a virtual environment using Anaconda 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. +2. We recommend creating a new python `virtual environment`, for instance, using conda. Instructions on how to create a virtual environment using Anaconda 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.9** (or newer) for the environment. -3. After cloning the repository `cd openqaoa` and pip install the package. +3. After cloning the repository `cd openqaoa` and pip install the package. .. code-block:: bash @@ -76,7 +76,7 @@ Additionally, users can install OpenQAOA in the developer mode via the Makefile. 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 +The package can be installed as an editable with extra requirements defined in the `pyproject.toml`. 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 @@ -102,11 +102,11 @@ First, create a problem instance. For example, an instance of vertex cover: Where [networkx](https://networkx.org/) is an open source Python package that can easily, among other things, create graphs. -Once the binary problem is defined, the simplest workflow can be defined as +Once the binary problem is defined, the simplest workflow can be defined as .. code-block:: python - - from openqaoa import QAOA + + from openqaoa import QAOA q = QAOA() q.compile(qubo_problem) q.optimize() @@ -173,7 +173,7 @@ rqaoa_type can take two values which select elimination strategies. The user can Factory mode ------------ -The user is also free to directly access the source code without using the workflow API. +The user is also free to directly access the source code without using the workflow API. A few reference notebooks can be found: * [comparing vectorized, pyquil, and qiskit backents](examples/test_backends_correctness.ipynb) @@ -202,7 +202,7 @@ then, specify terms and weights in order to define the cost hamiltonian cost_hamil = Hamiltonian.classical_hamiltonian(terms=terms,coeffs=coeffs,constant=0) mixer_hamil = X_mixer_hamiltonian(n_qubits=n_qubits) - + After having created the hamiltonians it is time to create the Circuit parameters and the Variational Parameters .. code-block:: python @@ -213,7 +213,7 @@ After having created the hamiltonians it is time to create the Circuit parameter Then proceed by instantiating the backend device .. code-block:: python - + backend_obj = QAOAvectorizedBackendSimulator(qaoa_descriptor = qaoa_descriptor, append_state = None, prepend_state = None, init_hadamard = True) And finally, create the classical optimizer and minimize the objective function @@ -225,7 +225,7 @@ And finally, create the classical optimizer and minimize the objective function optimizer_obj() -The result of the optimization will the be accessible as +The result of the optimization will the be accessible as .. code-block:: python @@ -259,7 +259,7 @@ Contents :caption: Installation and setup openqaoa_metapackage_install - + openqaoa_core/openqaoa_core_install openqaoa_qiskit/openqaoa_qiskit_install @@ -283,7 +283,7 @@ Contents openqaoa_azure/azure_backends openqaoa_pyquil/pyquil_backends - + .. toctree:: :maxdepth: 3 diff --git a/docs/source/openqaoa_azure/openqaoa_azure_install.rst b/docs/source/openqaoa_azure/openqaoa_azure_install.rst index 3e7c6b63c..1706b8dde 100644 --- a/docs/source/openqaoa_azure/openqaoa_azure_install.rst +++ b/docs/source/openqaoa_azure/openqaoa_azure_install.rst @@ -4,16 +4,16 @@ OpenQAOA Azure Installation Install via PyPI ---------------- -You can install the latest version of openqaoa-azure directly from PyPi. We recommend creating a virtual environment with ``python>=3.8`` first and then simply pip install openqaoa-azure with the following command. +You can install the latest version of openqaoa-azure directly from PyPi. We recommend creating a virtual environment with ``python>=3.9`` first and then simply pip install openqaoa-azure with the following command. **NOTE:** Installing ``openqaoa-azure`` installs ``openqaoa-core`` and ``openqaoa-qiskit`` by default .. code-block:: bash - + pip install openqaoa-azure 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 :ref:`here ` -Should you face any issue during the installation, please drop us an email at openqaoa@entropicalabs.com or open an issue! \ No newline at end of file +Should you face any issue during the installation, please drop us an email at openqaoa@entropicalabs.com or open an issue! diff --git a/docs/source/openqaoa_braket/openqaoa_braket_install.rst b/docs/source/openqaoa_braket/openqaoa_braket_install.rst index e940bb179..18fa3291d 100644 --- a/docs/source/openqaoa_braket/openqaoa_braket_install.rst +++ b/docs/source/openqaoa_braket/openqaoa_braket_install.rst @@ -3,12 +3,12 @@ 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.9`` first and then simply pip install openqaoa-braket with the following command. **NOTE:** Installing ``openqaoa-braket`` installs ``openqaoa-core`` by default .. code-block:: bash - + pip install openqaoa-braket Installation instructions for Developers @@ -16,4 +16,4 @@ 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 :ref:`here ` -Should you face any issue during the installation, please drop us an email at openqaoa@entropicalabs.com or open an issue! \ No newline at end of file +Should you face any issue during the installation, please drop us an email at openqaoa@entropicalabs.com or open an issue! diff --git a/docs/source/openqaoa_core/openqaoa_core_install.rst b/docs/source/openqaoa_core/openqaoa_core_install.rst index dd98ba1ac..57ab668a9 100644 --- a/docs/source/openqaoa_core/openqaoa_core_install.rst +++ b/docs/source/openqaoa_core/openqaoa_core_install.rst @@ -1,15 +1,15 @@ OpenQAOA Core Installation ========================== -Choose this barebones installation if you do not wish to run computations on any specific cloud providers. With this install you can +Choose this barebones installation if you do not wish to run computations on any specific cloud providers. With this install you can run QAOA on local Entropica simulators, namely, ``vectorized`` and ``analytical_simulator``. Install via PyPI ---------------- -You can install the latest version of openqaoa-core directly from PyPi. We recommend creating a virtual environment with ``python>=3.8`` first and then simply pip install openqaoa-core with the following command. +You can install the latest version of openqaoa-core directly from PyPi. We recommend creating a virtual environment with ``python>=3.9`` first and then simply pip install openqaoa-core with the following command. .. code-block:: bash - + pip install openqaoa-core @@ -18,4 +18,4 @@ 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 :ref:`here ` -Should you face any issue during the installation, please drop us an email at openqaoa@entropicalabs.com or open an issue! \ No newline at end of file +Should you face any issue during the installation, please drop us an email at openqaoa@entropicalabs.com or open an issue! diff --git a/docs/source/openqaoa_metapackage_install.rst b/docs/source/openqaoa_metapackage_install.rst index c9e797acc..9c2672427 100644 --- a/docs/source/openqaoa_metapackage_install.rst +++ b/docs/source/openqaoa_metapackage_install.rst @@ -4,7 +4,7 @@ OpenQAOA Metapackage Installation 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`. @@ -17,7 +17,7 @@ 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 +You can install the latest version of OpenQAOA directly from PyPI. First, create a virtual environment with python3.9, 3.10, 3.11 and then pip install openqaoa with the following command .. code-block:: bash pip install openqaoa @@ -25,14 +25,14 @@ pip install openqaoa Install via git clone --------------------- -Alternatively, you can install OpenQAOA manually from the GitHub repository by following the instructions below. +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 `_. 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 `_. Make sure to use **python 3.9** (or newer) for the environment. 1. Clone the git repository: .. code-block:: bash - + git clone https://github.com/entropicalabs/openqaoa.git @@ -52,7 +52,7 @@ Users can install OpenQAOA in the developer mode via the Makefile. For a clean e 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 +The package can be installed as an editable with extra requirements defined in the ``pyproject.toml``. 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 diff --git a/docs/source/openqaoa_pyquil/openqaoa_pyquil_install.rst b/docs/source/openqaoa_pyquil/openqaoa_pyquil_install.rst index a7b8f3c12..e55f6e05a 100644 --- a/docs/source/openqaoa_pyquil/openqaoa_pyquil_install.rst +++ b/docs/source/openqaoa_pyquil/openqaoa_pyquil_install.rst @@ -4,12 +4,12 @@ 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.9`` first and then simply pip install openqaoa-pyquil with the following command. **NOTE:** Installing ``openqaoa-pyquil`` installs ``openqaoa-core`` by default .. code-block:: bash - + pip install openqaoa-pyquil Installation instructions for Developers diff --git a/docs/source/openqaoa_qiskit/openqaoa_qiskit_install.rst b/docs/source/openqaoa_qiskit/openqaoa_qiskit_install.rst index af822b7c8..0d160bc98 100644 --- a/docs/source/openqaoa_qiskit/openqaoa_qiskit_install.rst +++ b/docs/source/openqaoa_qiskit/openqaoa_qiskit_install.rst @@ -4,12 +4,12 @@ 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.9`` first and then simply pip install openqaoa-qiskit with the following command. **NOTE:** Installing ``openqaoa-qiskit`` installs ``openqaoa-core`` by default .. code-block:: bash - + pip install openqaoa-qiskit Installation instructions for Developers @@ -17,4 +17,4 @@ 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 :ref:`here ` -Should you face any issue during the installation, please drop us an email at openqaoa@entropicalabs.com or open an issue! \ No newline at end of file +Should you face any issue during the installation, please drop us an email at openqaoa@entropicalabs.com or open an issue! diff --git a/pyproject.toml b/pyproject.toml index 8cf32563a..af4286248 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,39 @@ [build-system] requires = ["setuptools>=61.0"] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta" + +[project] +name = "openqaoa" +version = "0.2.5" +authors = [{ name = "Entropica Labs" }] +description = "OpenQAOA is a python open-source multi-backend Software Development Kit to create, customise and execute the Quantum Approximate Optimisation Algorithm (QAOA) on Noisy Intermediate-Scale Quantum (NISQ) devices, and simulators" +readme = "README.md" +requires-python = ">=3.9, <3.12" +license = { file = "LICENSE" } +urls = { "Homepage" = "https://github.com/entropicalabs/openqaoa" } +classifiers = [ + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent" +] +keywords = ["quantum", "optimisation", "SDK"] + +dependencies = [ + "openqaoa-azure==0.2.5", + "openqaoa-braket==0.2.5", + "openqaoa-core==0.2.5", + "openqaoa-pyquil==0.2.5", + "openqaoa-qiskit==0.2.5" +] + +[tool.pytest.ini_options] +markers = [ + "qpu: marks tests that require a QPU connection (deselect with '-m \"not qpu\"')", + "api: marks tests that require a connection to a QC cloud (deselect with '-m \"not api\"')", + "qvm: marks tests that require an active Rigetti QVM and QILC compiler (deselect with '-m \"not qvm\"')", + "docker_aws: marks tests that require to build aws docker (deselect with '-m \"not docker_aws\"')", + "braket_api: marks tests that require valid AWS credentials (no QPU) (deselect with '-m \"not braket_api\"')", + "notebook: marks tests that run on jupyter notebooks (deselect with '-m \"not notebook\"')", + "sim: marks tests that run on remote Simulators (deselect with '-m \"not sim\"')" +] diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 8b2a53fe6..000000000 --- a/pytest.ini +++ /dev/null @@ -1,9 +0,0 @@ -[pytest] -markers = - qpu: marks tests that require a QPU connection (deselect with '-m "not qpu"') - api: marks tests that require a connection to a QC cloud (deselect with '-m "not api"') - qvm: marks tests that require an active Rigetti QVM and QILC compiler (deselect with '-m "not qvm"') - docker_aws: marks tests that require to build aws docker (deselect with '-m "not docker_aws"') - braket_api: marks tests that require valid AWS credentials (no QPU) (deselect with '-m "not braket_api"') - notebook: marks tests that run on jupyter noteboks (deselect with '-m "not notebook"') - sim: marks tests that run on remote Simulators (deselect with '-m "not sim"') \ No newline at end of file diff --git a/runtime.txt b/runtime.txt deleted file mode 100644 index 3cd310223..000000000 --- a/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -python-3.8 \ No newline at end of file diff --git a/scripts/push_package_pypi.sh b/scripts/push_package_pypi.sh index 4b15b6228..5ec87b31e 100755 --- a/scripts/push_package_pypi.sh +++ b/scripts/push_package_pypi.sh @@ -4,8 +4,6 @@ set -e # TODO: Dynamically generate names (The order of installing and pushing is important here.) modulesList=("src/openqaoa-core" "src/openqaoa-qiskit" "src/openqaoa-braket" "src/openqaoa-pyquil" "src/openqaoa-azure") -python scripts/test_version.py - pip install build twine # build and install plugins @@ -24,4 +22,4 @@ done rm -rf dist build pip install . python -m build -twine upload dist/* --username $1 --password $2 \ No newline at end of file +twine upload dist/* --username $1 --password $2 diff --git a/scripts/test_version.py b/scripts/test_version.py index 40a8d0dfd..ca8fa50bb 100644 --- a/scripts/test_version.py +++ b/scripts/test_version.py @@ -1,29 +1,21 @@ import os -import importlib +import toml version_dict = {} for each_file in os.listdir("src"): if each_file.startswith("openqaoa-"): - __version__ = "" - if not each_file == "openqaoa-core": - exec( - open( - "./src/" - + each_file - + "/" - + each_file.replace("-", "_") - + "/_version.py" - ).read() - ) - else: - exec(open("./src/" + each_file + "/openqaoa/_version.py").read()) - version_dict.update({each_file: __version__}) + library = ( + each_file.replace("-", "_") if each_file != "openqaoa-core" else "openqaoa" + ) + version = __import__(library).__version__ + version_dict.update({each_file: version}) version_check = [ each_item == version_dict["openqaoa-core"] for each_item in version_dict.values() ] -with open("_version.py") as f: - meta_version = f.readlines()[-1].split()[-1].strip("\"'") + +pyproject_data = toml.load("pyproject.toml") +meta_version = pyproject_data["project"]["version"] version_check.append(meta_version == version_dict["openqaoa-core"]) for each_check in version_check: if not each_check: diff --git a/setup.py b/setup.py deleted file mode 100644 index fd9bc2f68..000000000 --- a/setup.py +++ /dev/null @@ -1,38 +0,0 @@ -from setuptools import setup, find_namespace_packages -import os - -current_path = os.getcwd() - -with open("README.md", "r") as fh: - long_description = fh.read() - -# Dev package will share versions with the core in it. -with open("_version.py") as f: - version = f.readlines()[-1].split()[-1].strip("\"'") - -requirements = [ - f"{each_folder_name}=={version}" - for each_folder_name in os.listdir("src") - if ("openqaoa-" in each_folder_name and "openqaoa-pyquil" not in each_folder_name) -] - -setup( - name="openqaoa", - python_requires=">=3.8, <3.11", - version=version, - author="Entropica Labs", - entry_points={"openqaoa.plugins": []}, - url="https://github.com/entropicalabs/openqaoa", - install_requires=requirements, - license="MIT", - description="OpenQAOA is a python open-source multi-backend Software Development Kit to create, customise and execute the Quantum Approximate Optimisation Algorithm (QAOA) on Noisy Intermediate-Scale Quantum (NISQ) devices, and simulators", - long_description=long_description, - long_description_content_type="text/markdown", - classifiers=[ - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Operating System :: OS Independent", - ], - keywords="quantum optimisation SDK", -) diff --git a/src/openqaoa-azure/MANIFEST.in b/src/openqaoa-azure/MANIFEST.in deleted file mode 100644 index 540b72040..000000000 --- a/src/openqaoa-azure/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include requirements.txt \ No newline at end of file diff --git a/src/openqaoa-azure/README.md b/src/openqaoa-azure/README.md index dfdc8d2b9..de33ed6c9 100644 --- a/src/openqaoa-azure/README.md +++ b/src/openqaoa-azure/README.md @@ -5,58 +5,82 @@ OpenQAOA - [![build test](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml/badge.svg)](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml) - [![Documentation Status](https://readthedocs.org/projects/el-openqaoa/badge/?version=latest)](https://el-openqaoa.readthedocs.io/en/latest/?badge=latest) - [![PyPI version](https://badge.fury.io/py/openqaoa.svg)](https://badge.fury.io/py/openqaoa) - [![arXiv](https://img.shields.io/badge/arXiv-2210.08695-.svg)](https://arxiv.org/abs/2210.08695) - [![License](https://img.shields.io/pypi/l/openqaoa)](LICENSE.md) - [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) - [![Downloads](https://pepy.tech/badge/openqaoa)](https://pepy.tech/project/openqaoa) - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/entropicalabs/openqaoa.git/main?labpath=%2Fexamples) - [![Discord](https://img.shields.io/discord/991258119525122058)](https://discord.gg/ana76wkKBd) - [![Website](https://img.shields.io/badge/OpenQAOA-Website-blueviolet)](https://openqaoa.entropicalabs.com/) +[![build test](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml/badge.svg)](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml) +[![Documentation Status](https://readthedocs.org/projects/el-openqaoa/badge/?version=latest)](https://el-openqaoa.readthedocs.io/en/latest/?badge=latest) + + + +[![PyPI version](https://badge.fury.io/py/openqaoa.svg)](https://badge.fury.io/py/openqaoa) + + + +[![arXiv](https://img.shields.io/badge/arXiv-2210.08695-.svg)](https://arxiv.org/abs/2210.08695) + + + +[![License](https://img.shields.io/pypi/l/openqaoa)](LICENSE.md) +[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) +[![Downloads](https://pepy.tech/badge/openqaoa)](https://pepy.tech/project/openqaoa) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/entropicalabs/openqaoa.git/main?labpath=%2Fexamples) +[![Discord](https://img.shields.io/discord/991258119525122058)](https://discord.gg/ana76wkKBd) +[![Website](https://img.shields.io/badge/OpenQAOA-Website-blueviolet)](https://openqaoa.entropicalabs.com/) + # OpenQAOA-Azure Plugin - -OpenQAOA is a multi-backend python library for quantum optimization using QAOA on Quantum computers and Quantum computer simulators. This package is part of a set of OpenQAOA plug-ins that lets users run QAOA computations on devices accessible through Azure cloud platform. Check out OpenQAOA website [https://openqaoa.entropicalabs.com/](https://openqaoa.entropicalabs.com/) +OpenQAOA is a multi-backend python library for quantum optimization using QAOA +on Quantum computers and Quantum computer simulators. This package is part of a +set of OpenQAOA plug-ins that lets users run QAOA computations on devices +accessible through Azure cloud platform. Check out OpenQAOA website +[https://openqaoa.entropicalabs.com/](https://openqaoa.entropicalabs.com/) **OpenQAOA is currently in OpenBeta.** -Please, consider [joining our discord](https://discord.gg/ana76wkKBd) if you want to be part of our community and participate in the OpenQAOA's development. +Please, consider [joining our discord](https://discord.gg/ana76wkKBd) if you +want to be part of our community and participate in the OpenQAOA's development. ## Installation instructions ### Install via PyPI -You can install the latest version of openqaoa-azure directly from PyPi. We recommend creating a virtual environment with `python>=3.8` first and then simply pip install openqaoa-azure with the following command. +You can install the latest version of openqaoa-azure directly from PyPi. We +recommend creating a virtual environment with `python>=3.9` first and then +simply pip install openqaoa-azure with the following command. -**NOTE:** Installing `openqaoa-azure` installs `openqaoa-core` and `openqaoa-qiskit` by default +**NOTE:** Installing `openqaoa-azure` installs `openqaoa-core` and +`openqaoa-qiskit` by default ```bash pip install openqaoa-azure ``` ### 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]() -Should you face any issue during the installation, please drop us an email at openqaoa@entropicalabs.com or open an issue! +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]() + +Should you face any issue during the installation, please drop us an email at +openqaoa@entropicalabs.com or open an issue! ## Getting started -The documentation for OpenQAOA can be found [here](https://el-openqaoa.readthedocs.io/en/latest/). +The documentation for OpenQAOA can be found +[here](https://el-openqaoa.readthedocs.io/en/latest/). -We also provide a set of tutorials to get you started. Among the many, perhaps you can get started with the following ones: +We also provide a set of tutorials to get you started. Among the many, perhaps +you can get started with the following ones: - Link Azure Quantum notebook -### Available devives +### Available devives -OpenQAOA-Azure serves devices through Azure cloud platform. The available devices depend on the specified credentials. +OpenQAOA-Azure serves devices through Azure cloud platform. The available +devices depend on the specified credentials. -| Device location | Device Name | -| --------------- | ----------- | +| Device location | Device Name | +| ------------------------------------------------------------------- | -------------------------------------- | | [Azure Quantum](https://azure.microsoft.com/en-us/products/quantum) | QCI, Rigetti, PASQAL, Quantinuum, IONQ | ## Running the tests @@ -65,6 +89,9 @@ TODO ## Contributing and feedback -If you find any bugs or errors, have feature requests, or code you would like to contribute, feel free to open an issue or send us a pull request on GitHub. +If you find any bugs or errors, have feature requests, or code you would like to +contribute, feel free to open an issue or send us a pull request on GitHub. -We are always interested to hear about projects built with EntropicaQAOA. If you have an application you'd like to tell us about, drop us an email at openqaoa@entropicalabs.com. +We are always interested to hear about projects built with EntropicaQAOA. If you +have an application you'd like to tell us about, drop us an email at +openqaoa@entropicalabs.com. diff --git a/src/openqaoa-azure/openqaoa_azure/__init__.py b/src/openqaoa-azure/openqaoa_azure/__init__.py index e69de29bb..e2fd8e5e7 100644 --- a/src/openqaoa-azure/openqaoa_azure/__init__.py +++ b/src/openqaoa-azure/openqaoa_azure/__init__.py @@ -0,0 +1,3 @@ +import importlib.metadata + +__version__ = importlib.metadata.version("openqaoa_azure") diff --git a/src/openqaoa-azure/openqaoa_azure/_version.py b/src/openqaoa-azure/openqaoa_azure/_version.py deleted file mode 100644 index fe404ae57..000000000 --- a/src/openqaoa-azure/openqaoa_azure/_version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.2.5" diff --git a/src/openqaoa-azure/pyproject.toml b/src/openqaoa-azure/pyproject.toml index 638dd9c54..c1dd74787 100644 --- a/src/openqaoa-azure/pyproject.toml +++ b/src/openqaoa-azure/pyproject.toml @@ -1,3 +1,34 @@ [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" + +[tool.setuptools.packages.find] +where = ["."] + +[project] +name = "openqaoa-azure" +version = "0.2.5" +authors = [{ name = "Entropica Labs" }] +description = "Azure Plug-in for OpenQAOA" +readme = "README.md" +requires-python = ">=3.9, <3.12" +license = { file = "LICENSE" } +urls = { "Homepage" = "https://github.com/entropicalabs/openqaoa" } +classifiers = [ + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", +] +keywords = ["quantum", "optimisation", "SDK"] + +dependencies = [ + "openqaoa-core==0.2.5", + "openqaoa-qiskit==0.2.5", + "qiskit-qir", + "qiskit-ionq", + "azure-quantum[qiskit]", +] + +[project.entry-points."openqaoa.plugins"] +azure = "openqaoa_azure.backend_config" diff --git a/src/openqaoa-azure/requirements.txt b/src/openqaoa-azure/requirements.txt deleted file mode 100644 index 1132ee171..000000000 --- a/src/openqaoa-azure/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -qdk -qiskit-qir -qiskit-ionq -azure-quantum[qiskit] \ No newline at end of file diff --git a/src/openqaoa-azure/setup.py b/src/openqaoa-azure/setup.py deleted file mode 100644 index db1805e43..000000000 --- a/src/openqaoa-azure/setup.py +++ /dev/null @@ -1,42 +0,0 @@ -from setuptools import setup, find_packages -from os import getcwd - -current_path = getcwd() - -with open("README.md", "r") as fh: - long_description = fh.read() - -with open("openqaoa_azure/_version.py") as f: - version = f.readlines()[-1].split()[-1].strip("\"'") - -requirements = [ - "openqaoa-core=={}".format(version), - "openqaoa-qiskit=={}".format(version), -] - -add_requirements = open("requirements.txt").readlines() -add_requirements = [r.strip() for r in add_requirements] - -requirements.extend(add_requirements) - -setup( - name="openqaoa-azure", - python_requires=">=3.8, <3.11", - version=version, - author="Entropica Labs", - packages=find_packages(where="."), - entry_points={"openqaoa.plugins": ["azure = openqaoa_azure.backend_config"]}, - url="https://github.com/entropicalabs/openqaoa", - install_requires=requirements, - license="MIT", - description="Azure Plug-in for OpenQAOA", - long_description=long_description, - long_description_content_type="text/markdown", - classifiers=[ - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Operating System :: OS Independent", - ], - keywords="quantum optimisation SDK", -) diff --git a/src/openqaoa-braket/MANIFEST.in b/src/openqaoa-braket/MANIFEST.in deleted file mode 100644 index 540b72040..000000000 --- a/src/openqaoa-braket/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include requirements.txt \ No newline at end of file diff --git a/src/openqaoa-braket/README.md b/src/openqaoa-braket/README.md index 226795587..b2b4cf803 100644 --- a/src/openqaoa-braket/README.md +++ b/src/openqaoa-braket/README.md @@ -5,31 +5,49 @@ OpenQAOA - [![build test](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml/badge.svg)](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml) - [![Documentation Status](https://readthedocs.org/projects/el-openqaoa/badge/?version=latest)](https://el-openqaoa.readthedocs.io/en/latest/?badge=latest) - [![PyPI version](https://badge.fury.io/py/openqaoa.svg)](https://badge.fury.io/py/openqaoa) - [![arXiv](https://img.shields.io/badge/arXiv-2210.08695-.svg)](https://arxiv.org/abs/2210.08695) - [![License](https://img.shields.io/pypi/l/openqaoa)](LICENSE.md) - [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) - [![Downloads](https://pepy.tech/badge/openqaoa)](https://pepy.tech/project/openqaoa) - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/entropicalabs/openqaoa.git/main?labpath=%2Fexamples) - [![Discord](https://img.shields.io/discord/991258119525122058)](https://discord.gg/ana76wkKBd) - [![Website](https://img.shields.io/badge/OpenQAOA-Website-blueviolet)](https://openqaoa.entropicalabs.com/) +[![build test](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml/badge.svg)](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml) +[![Documentation Status](https://readthedocs.org/projects/el-openqaoa/badge/?version=latest)](https://el-openqaoa.readthedocs.io/en/latest/?badge=latest) + + + +[![PyPI version](https://badge.fury.io/py/openqaoa.svg)](https://badge.fury.io/py/openqaoa) + + + +[![arXiv](https://img.shields.io/badge/arXiv-2210.08695-.svg)](https://arxiv.org/abs/2210.08695) + + + +[![License](https://img.shields.io/pypi/l/openqaoa)](LICENSE.md) +[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) +[![Downloads](https://pepy.tech/badge/openqaoa)](https://pepy.tech/project/openqaoa) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/entropicalabs/openqaoa.git/main?labpath=%2Fexamples) +[![Discord](https://img.shields.io/discord/991258119525122058)](https://discord.gg/ana76wkKBd) +[![Website](https://img.shields.io/badge/OpenQAOA-Website-blueviolet)](https://openqaoa.entropicalabs.com/) + # OpenQAOA-Braket Plugin -OpenQAOA is a multi-backend python library for quantum optimization using QAOA on Quantum computers and Quantum computer simulators. This package is part of a set of OpenQAOA plug-ins that lets users run QAOA computations on AWS Braket supported devices, and devices that support Amazon Braket circuits. Check out OpenQAOA website [https://openqaoa.entropicalabs.com/](https://openqaoa.entropicalabs.com/) +OpenQAOA is a multi-backend python library for quantum optimization using QAOA +on Quantum computers and Quantum computer simulators. This package is part of a +set of OpenQAOA plug-ins that lets users run QAOA computations on AWS Braket +supported devices, and devices that support Amazon Braket circuits. Check out +OpenQAOA website +[https://openqaoa.entropicalabs.com/](https://openqaoa.entropicalabs.com/) **OpenQAOA is currently in OpenBeta.** -Please, consider [joining our discord](https://discord.gg/ana76wkKBd) if you want to be part of our community and participate in the OpenQAOA's development. +Please, consider [joining our discord](https://discord.gg/ana76wkKBd) if you +want to be part of our community and participate in the OpenQAOA's development. ## Installation instructions ### 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.9` first and then +simply pip install openqaoa-braket with the following command. **NOTE:** Installing `openqaoa-braket` installs `openqaoa-core` by default @@ -38,32 +56,42 @@ pip install openqaoa-braket ``` ### 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]() -Should you face any issue during the installation, please drop us an email at openqaoa@entropicalabs.com or open an issue! +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](https://github.com/entropicalabs/openqaoa/blob/dev/README.md) + +Should you face any issue during the installation, please drop us an email at +openqaoa@entropicalabs.com or open an issue! ## Getting started -The documentation for OpenQAOA-Braket can be found [here](https://el-openqaoa.readthedocs.io/en/latest/). +The documentation for OpenQAOA-Braket can be found +[here](https://el-openqaoa.readthedocs.io/en/latest/). -We also provide a set of tutorials to get you started. Among the many, perhaps you can get started with the following ones: +We also provide a set of tutorials to get you started. Among the many, perhaps +you can get started with the following ones: - Link Braket notebook to get started -### Available devives +### Available devices -OpenQAOA-Braket serves devices accessible to the user through their AWS account. The available devices depend on the specified credentials. +OpenQAOA-Braket serves devices accessible to the user through their AWS account. +The available devices depend on the specified credentials. | Device location | Device Name | | --------------- | ----------- | | [Amazon Braket](https://docs.aws.amazon.com/braket/latest/developerguide/braket-devices.html) | IonQ, Rigetti, OQC, and simulators | - ## Running the tests TODO + ## Contributing and feedback -If you find any bugs or errors, have feature requests, or code you would like to contribute, feel free to open an issue or send us a pull request on GitHub. +If you find any bugs or errors, have feature requests, or code you would like to +contribute, feel free to open an issue or send us a pull request on GitHub. -We are always interested to hear about projects built with EntropicaQAOA. If you have an application you'd like to tell us about, drop us an email at openqaoa@entropicalabs.com. +We are always interested to hear about projects built with EntropicaQAOA. If you +have an application you'd like to tell us about, drop us an email at +openqaoa@entropicalabs.com. diff --git a/src/openqaoa-braket/openqaoa_braket/__init__.py b/src/openqaoa-braket/openqaoa_braket/__init__.py index e69de29bb..283f5e573 100644 --- a/src/openqaoa-braket/openqaoa_braket/__init__.py +++ b/src/openqaoa-braket/openqaoa_braket/__init__.py @@ -0,0 +1,3 @@ +import importlib.metadata + +__version__ = importlib.metadata.version("openqaoa_braket") diff --git a/src/openqaoa-braket/openqaoa_braket/_version.py b/src/openqaoa-braket/openqaoa_braket/_version.py deleted file mode 100644 index fe404ae57..000000000 --- a/src/openqaoa-braket/openqaoa_braket/_version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.2.5" diff --git a/src/openqaoa-braket/pyproject.toml b/src/openqaoa-braket/pyproject.toml index 638dd9c54..8adee26f3 100644 --- a/src/openqaoa-braket/pyproject.toml +++ b/src/openqaoa-braket/pyproject.toml @@ -1,3 +1,31 @@ [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" + +[tool.setuptools.packages.find] +where = ["."] + +[project] +name = "openqaoa-braket" +version = "0.2.5" +authors = [{ name = "Entropica Labs" }] +description = "Braket Plug-in for OpenQAOA" +readme = "README.md" +requires-python = ">=3.9, <3.12" +license = { file = "LICENSE" } +urls = { "Homepage" = "https://github.com/entropicalabs/openqaoa" } +classifiers = [ + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", +] +keywords = ["quantum", "optimisation", "SDK"] + +dependencies = [ + "openqaoa-core==0.2.5", + "amazon-braket-sdk>=1.23.0" +] + +[project.entry-points."openqaoa.plugins"] +braket = "openqaoa_braket.backend_config" diff --git a/src/openqaoa-braket/requirements.txt b/src/openqaoa-braket/requirements.txt deleted file mode 100644 index f232b199c..000000000 --- a/src/openqaoa-braket/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -amazon-braket-sdk>=1.23.0 \ No newline at end of file diff --git a/src/openqaoa-braket/setup.py b/src/openqaoa-braket/setup.py deleted file mode 100644 index 207ee5565..000000000 --- a/src/openqaoa-braket/setup.py +++ /dev/null @@ -1,41 +0,0 @@ -from setuptools import setup, find_packages -from os import getcwd - -current_path = getcwd() - -with open("README.md", "r") as fh: - long_description = fh.read() - -with open("openqaoa_braket/_version.py") as f: - version = f.readlines()[-1].split()[-1].strip("\"'") - -requirements = [ - "openqaoa-core=={}".format(version), -] - -add_requirements = open("requirements.txt").readlines() -add_requirements = [r.strip() for r in add_requirements] - -requirements.extend(add_requirements) - -setup( - name="openqaoa-braket", - python_requires=">=3.8, <3.11", - version=version, - author="Entropica Labs", - packages=find_packages(where="."), - entry_points={"openqaoa.plugins": ["braket = openqaoa_braket.backend_config"]}, - url="https://github.com/entropicalabs/openqaoa", - install_requires=requirements, - license="MIT", - description="Braket Plug-in for OpenQAOA", - long_description=long_description, - long_description_content_type="text/markdown", - classifiers=[ - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Operating System :: OS Independent", - ], - keywords="quantum optimisation SDK", -) diff --git a/src/openqaoa-core/MANIFEST.in b/src/openqaoa-core/MANIFEST.in deleted file mode 100644 index 8c5744598..000000000 --- a/src/openqaoa-core/MANIFEST.in +++ /dev/null @@ -1,3 +0,0 @@ -include requirements.txt -include requirements_docs.txt -include requirements_test.txt \ No newline at end of file diff --git a/src/openqaoa-core/README.md b/src/openqaoa-core/README.md index 219e817a3..f40bf8cd3 100644 --- a/src/openqaoa-core/README.md +++ b/src/openqaoa-core/README.md @@ -5,46 +5,75 @@ OpenQAOA - [![build test](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml/badge.svg)](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml) - [![Documentation Status](https://readthedocs.org/projects/el-openqaoa/badge/?version=latest)](https://el-openqaoa.readthedocs.io/en/latest/?badge=latest) - [![PyPI version](https://badge.fury.io/py/openqaoa.svg)](https://badge.fury.io/py/openqaoa) - [![arXiv](https://img.shields.io/badge/arXiv-2210.08695-.svg)](https://arxiv.org/abs/2210.08695) - [![License](https://img.shields.io/pypi/l/openqaoa)](LICENSE.md) - [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) - [![Downloads](https://pepy.tech/badge/openqaoa)](https://pepy.tech/project/openqaoa) - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/entropicalabs/openqaoa.git/main?labpath=%2Fexamples) - [![Discord](https://img.shields.io/discord/991258119525122058)](https://discord.gg/ana76wkKBd) - [![Website](https://img.shields.io/badge/OpenQAOA-Website-blueviolet)](https://openqaoa.entropicalabs.com/) +[![build test](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml/badge.svg)](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml) +[![Documentation Status](https://readthedocs.org/projects/el-openqaoa/badge/?version=latest)](https://el-openqaoa.readthedocs.io/en/latest/?badge=latest) + + + +[![PyPI version](https://badge.fury.io/py/openqaoa.svg)](https://badge.fury.io/py/openqaoa) + + + +[![arXiv](https://img.shields.io/badge/arXiv-2210.08695-.svg)](https://arxiv.org/abs/2210.08695) + + + +[![License](https://img.shields.io/pypi/l/openqaoa)](LICENSE.md) +[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) +[![Downloads](https://pepy.tech/badge/openqaoa)](https://pepy.tech/project/openqaoa) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/entropicalabs/openqaoa.git/main?labpath=%2Fexamples) +[![Discord](https://img.shields.io/discord/991258119525122058)](https://discord.gg/ana76wkKBd) +[![Website](https://img.shields.io/badge/OpenQAOA-Website-blueviolet)](https://openqaoa.entropicalabs.com/) + # OpenQAOA-Core -OpenQAOA is a multi-backend python library for quantum optimization using QAOA on Quantum computers and Quantum computer simulators. This package is part of a set of OpenQAOA plug-ins and forms the core functionality of the package. It includes all backend agnostic elements of the QAOA process. Along with other OpenQAOA plug-in extensions enables users to seemlessly run QAOA computations across multiple Quantum Computers. Additionally, it also comes bundled with Entropica's fast QAOA simulator called `vectorized` and a unit-depth QAOA analytical simulator (you can find more details in the Getting Started section). Check out OpenQAOA website [https://openqaoa.entropicalabs.com/](https://openqaoa.entropicalabs.com/) +OpenQAOA is a multi-backend python library for quantum optimization using QAOA +on Quantum computers and Quantum computer simulators. This package is part of a +set of OpenQAOA plug-ins and forms the core functionality of the package. It +includes all backend agnostic elements of the QAOA process. Along with other +OpenQAOA plug-in extensions enables users to seemlessly run QAOA computations +across multiple Quantum Computers. Additionally, it also comes bundled with +Entropica's fast QAOA simulator called `vectorized` and a unit-depth QAOA +analytical simulator (you can find more details in the Getting Started section). +Check out OpenQAOA website +[https://openqaoa.entropicalabs.com/](https://openqaoa.entropicalabs.com/) **OpenQAOA is currently in OpenBeta.** -Please, consider [joining our discord](https://discord.gg/ana76wkKBd) if you want to be part of our community and participate in the OpenQAOA's development. +Please, consider [joining our discord](https://discord.gg/ana76wkKBd) if you +want to be part of our community and participate in the OpenQAOA's development. ## Installation instructions ### Install via PyPI -You can install the latest version of openqaoa-core directly from PyPi. We recommend creating a virtual environment with `python>=3.8` first and then simply pip install openqaoa-core with the following command. +You can install the latest version of openqaoa-core directly from PyPi. We +recommend creating a virtual environment with `python>=3.9` first and then +simply pip install openqaoa-core with the following command. ```bash pip install openqaoa-core ``` ### 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]() -Should you face any issue during the installation, please drop us an email at openqaoa@entropicalabs.com or open an issue! +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](https://github.com/entropicalabs/openqaoa/blob/dev/README.md) + +Should you face any issue during the installation, please drop us an email at +openqaoa@entropicalabs.com or open an issue! ## Getting started -The documentation for OpenQAOA-Core can be found [here](https://el-openqaoa.readthedocs.io/en/latest/). +The documentation for OpenQAOA-Core can be found +[here](https://el-openqaoa.readthedocs.io/en/latest/). + +We also provide a set of tutorials to get you started. Among the many, perhaps +you can get started with the following ones: -We also provide a set of tutorials to get you started. Among the many, perhaps you can get started with the following ones: - A notebook showing Analytical Simulator usage - [Introducing EL's fast QAOA simulator](https://el-openqaoa.readthedocs.io/en/latest/notebooks/06_fast_qaoa_simulator.html) - [Discover OpenQAOA's custom parametrizations](https://el-openqaoa.readthedocs.io/en/latest/notebooks/05_advanced_parameterization.html) @@ -52,19 +81,26 @@ We also provide a set of tutorials to get you started. Among the many, perhaps y ### Key Features -- **Build advanced QAOAs**. Create complex QAOAs by specifying custom _parametrisation_, _mixer hamiltonians_, _classical optimisers_ and execute the algorithm on either simulators or QPUs. +- **Build advanced QAOAs**. Create complex QAOAs by specifying custom + _parametrisation_, _mixer hamiltonians_, _classical optimisers_ and execute + the algorithm on either simulators or QPUs. -- **Recursive QAOA**. Run RQAOA with fully customisable schedules on simulators and QPUs alike. +- **Recursive QAOA**. Run RQAOA with fully customisable schedules on simulators + and QPUs alike. -- **QPU access**. Built in access for `IBM Quantum`, `Rigetti QCS`, `Amazon Braket` and `Azure Quantum` (Please install the OpenQAOA plugin corresponding to the QPU platform for running QAOA on these devices). +- **QPU access**. Built in access for `IBM Quantum`, `Rigetti QCS`, + `Amazon Braket` and `Azure Quantum` (Please install the OpenQAOA plugin + corresponding to the QPU platform for running QAOA on these devices). -### Available devives +### Available devices -Devices are serviced both locally and on the cloud. For the IBM Quantum experience, the available devices depend on the specified credentials. For QCS and Amazon Braket, the available devices are listed in the table below: +Devices are serviced both locally and on the cloud. For the IBM Quantum +experience, the available devices depend on the specified credentials. For QCS +and Amazon Braket, the available devices are listed in the table below: | Device location | Device Name | | --------------- | ----------- | -| `local` | `['vectorized', 'analytical_simulator']` | +| `local` | `['vectorized', 'analytical_simulator']` | ## Running the tests @@ -72,6 +108,9 @@ TODO ## Contributing and feedback -If you find any bugs or errors, have feature requests, or code you would like to contribute, feel free to open an issue or send us a pull request on GitHub. +If you find any bugs or errors, have feature requests, or code you would like to +contribute, feel free to open an issue or send us a pull request on GitHub. -We are always interested to hear about projects built with EntropicaQAOA. If you have an application you'd like to tell us about, drop us an email at openqaoa@entropicalabs.com. +We are always interested to hear about projects built with EntropicaQAOA. If you +have an application you'd like to tell us about, drop us an email at +openqaoa@entropicalabs.com. diff --git a/src/openqaoa-core/openqaoa/__init__.py b/src/openqaoa-core/openqaoa/__init__.py index 4db56ed3a..1133c233e 100644 --- a/src/openqaoa-core/openqaoa/__init__.py +++ b/src/openqaoa-core/openqaoa/__init__.py @@ -1,3 +1,7 @@ +import importlib.metadata + from .algorithms import QAOA, RQAOA, QAOABenchmark from .problems import QUBO from .backends import create_device + +__version__ = importlib.metadata.version("openqaoa") diff --git a/src/openqaoa-core/openqaoa/_version.py b/src/openqaoa-core/openqaoa/_version.py deleted file mode 100644 index fe404ae57..000000000 --- a/src/openqaoa-core/openqaoa/_version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.2.5" diff --git a/src/openqaoa-core/pyproject.toml b/src/openqaoa-core/pyproject.toml index 638dd9c54..055ff32c3 100644 --- a/src/openqaoa-core/pyproject.toml +++ b/src/openqaoa-core/pyproject.toml @@ -1,3 +1,60 @@ [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" + +[tool.setuptools.packages.find] +where = ["."] + +[project] +name = "openqaoa-core" +version = "0.2.5" +authors = [{ name = "Entropica Labs" }] +description = "OpenQAOA is a python open-source multi-backend Software Development Kit to create, customise and execute the Quantum Approximate Optimisation Algorithm (QAOA) on Noisy Intermediate-Scale Quantum (NISQ) devices, and simulators" +readme = "README.md" +requires-python = ">=3.9, <3.12" +license = { file = "LICENSE" } +urls = { "Homepage" = "https://github.com/entropicalabs/openqaoa" } +classifiers = [ + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent" +] +keywords = ["quantum", "optimisation", "SDK"] + +dependencies = [ + "pandas>=2.2.2", + "sympy>=1.12", + "numpy>=1.23", + "networkx>=2.8", + "matplotlib>=3.6, <3.9", + "scipy>=1.9.0", + "docplex==2.25.236", + "autograd>=1.6", + "semantic_version>=2.10", + "autoray>=0.6", + "requests>=2.32.3", + "ipython>=8.18.1", + "mitiq>=0.30.0" +] + +[project.optional-dependencies] +docs = [ + "sphinx>=4.5.0", + "sphinx-autodoc-typehints>=1.18.1", + "sphinx-rtd-theme>=1.0.0", + "nbsphinx>=0.8.9", + "nbconvert>=6.5.1", + "myst_parser>=2.0.0" +] +tests = [ + "pytest>=7.1.0", + "pytest-xdist", + "pytest-cov>=3.0.0", + "nbconvert>=6.5.1", + "plotly>=5.9.0", + "cplex>=22.1.0.0" +] +all = [ + "openqaoa-core[docs,tests]" +] diff --git a/src/openqaoa-core/requirements.txt b/src/openqaoa-core/requirements.txt deleted file mode 100644 index b7fb109bb..000000000 --- a/src/openqaoa-core/requirements.txt +++ /dev/null @@ -1,13 +0,0 @@ -pandas>=1.3.5 -sympy>=1.10.1 -numpy>=1.22.3 -networkx>=2.8 -matplotlib>=3.4.3 -scipy>=1.8 -docplex==2.25.236 -autograd>=1.4 -semantic_version>=2.10 -autoray>=0.3.1 -requests -ipython>=8.2.0 -mitiq diff --git a/src/openqaoa-core/requirements_docs.txt b/src/openqaoa-core/requirements_docs.txt deleted file mode 100644 index fd7c6ca0f..000000000 --- a/src/openqaoa-core/requirements_docs.txt +++ /dev/null @@ -1,7 +0,0 @@ -sphinx>=4.5.0 -sphinx-autodoc-typehints>=1.18.1 -sphinx-rtd-theme>=1.0.0 -nbsphinx>=0.8.9 -ipython>=8.10.0 -nbconvert>=6.5.1 -myst_parser>=2.0.0 \ No newline at end of file diff --git a/src/openqaoa-core/requirements_test.txt b/src/openqaoa-core/requirements_test.txt deleted file mode 100644 index 9ca19d8a2..000000000 --- a/src/openqaoa-core/requirements_test.txt +++ /dev/null @@ -1,7 +0,0 @@ -pytest>=7.1.0 -pytest-xdist -pytest-cov>=3.0.0 -nbconvert>=6.5.1 -pandas>=1.4.3 -plotly>=5.9.0 -cplex>=22.1.0.0 \ No newline at end of file diff --git a/src/openqaoa-core/setup.py b/src/openqaoa-core/setup.py deleted file mode 100644 index 2f86ff78b..000000000 --- a/src/openqaoa-core/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -from setuptools import setup, find_packages -from os import getcwd - -current_path = getcwd() - -with open("README.md", "r") as fh: - long_description = fh.read() - -with open("openqaoa/_version.py") as f: - version = f.readlines()[-1].split()[-1].strip("\"'") - -requirements = open("requirements.txt").readlines() -requirements = [r.strip() for r in requirements] - -requirements_docs = open("requirements_docs.txt").readlines() -requirements_docs = [r.strip() for r in requirements_docs] - -requirements_test = open("requirements_test.txt").readlines() -requirements_test = [r.strip() for r in requirements_test] - -setup( - name="openqaoa-core", - python_requires=">=3.8, <3.11", - version=version, - author="Entropica Labs", - packages=find_packages(where="."), - entry_points={"openqaoa.plugins": []}, - url="https://github.com/entropicalabs/openqaoa", - install_requires=requirements, - license="MIT", - description="OpenQAOA is a python open-source multi-backend Software Development Kit to create, customise and execute the Quantum Approximate Optimisation Algorithm (QAOA) on Noisy Intermediate-Scale Quantum (NISQ) devices, and simulators", - long_description=long_description, - long_description_content_type="text/markdown", - classifiers=[ - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Operating System :: OS Independent", - ], - keywords="quantum optimisation SDK", - extras_require={ - "docs": requirements_docs, - "tests": requirements_test, - "all": requirements_docs + requirements_test, - }, -) diff --git a/src/openqaoa-pyquil/MANIFEST.in b/src/openqaoa-pyquil/MANIFEST.in deleted file mode 100644 index 540b72040..000000000 --- a/src/openqaoa-pyquil/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include requirements.txt \ No newline at end of file diff --git a/src/openqaoa-pyquil/README.md b/src/openqaoa-pyquil/README.md index a13676fb4..b0c511f35 100644 --- a/src/openqaoa-pyquil/README.md +++ b/src/openqaoa-pyquil/README.md @@ -5,31 +5,49 @@ OpenQAOA - [![build test](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml/badge.svg)](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml) - [![Documentation Status](https://readthedocs.org/projects/el-openqaoa/badge/?version=latest)](https://el-openqaoa.readthedocs.io/en/latest/?badge=latest) - [![PyPI version](https://badge.fury.io/py/openqaoa.svg)](https://badge.fury.io/py/openqaoa) - [![arXiv](https://img.shields.io/badge/arXiv-2210.08695-.svg)](https://arxiv.org/abs/2210.08695) - [![License](https://img.shields.io/pypi/l/openqaoa)](LICENSE.md) - [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) - [![Downloads](https://pepy.tech/badge/openqaoa)](https://pepy.tech/project/openqaoa) - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/entropicalabs/openqaoa.git/main?labpath=%2Fexamples) - [![Discord](https://img.shields.io/discord/991258119525122058)](https://discord.gg/ana76wkKBd) - [![Website](https://img.shields.io/badge/OpenQAOA-Website-blueviolet)](https://openqaoa.entropicalabs.com/) +[![build test](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml/badge.svg)](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml) +[![Documentation Status](https://readthedocs.org/projects/el-openqaoa/badge/?version=latest)](https://el-openqaoa.readthedocs.io/en/latest/?badge=latest) + + + +[![PyPI version](https://badge.fury.io/py/openqaoa.svg)](https://badge.fury.io/py/openqaoa) + + + +[![arXiv](https://img.shields.io/badge/arXiv-2210.08695-.svg)](https://arxiv.org/abs/2210.08695) + + + +[![License](https://img.shields.io/pypi/l/openqaoa)](LICENSE.md) +[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) +[![Downloads](https://pepy.tech/badge/openqaoa)](https://pepy.tech/project/openqaoa) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/entropicalabs/openqaoa.git/main?labpath=%2Fexamples) +[![Discord](https://img.shields.io/discord/991258119525122058)](https://discord.gg/ana76wkKBd) +[![Website](https://img.shields.io/badge/OpenQAOA-Website-blueviolet)](https://openqaoa.entropicalabs.com/) + # OpenQAOA-Pyquil Plugin -OpenQAOA is a multi-backend python library for quantum optimization using QAOA on Quantum computers and Quantum computer simulators. This package is part of a set of OpenQAOA plug-ins that lets users run QAOA computations on Rigetti's devices accessible through QCS, and devices that support quil instructions. Check out OpenQAOA website [https://openqaoa.entropicalabs.com/](https://openqaoa.entropicalabs.com/) +OpenQAOA is a multi-backend python library for quantum optimization using QAOA +on Quantum computers and Quantum computer simulators. This package is part of a +set of OpenQAOA plug-ins that lets users run QAOA computations on Rigetti's +devices accessible through QCS, and devices that support quil instructions. +Check out OpenQAOA website +[https://openqaoa.entropicalabs.com/](https://openqaoa.entropicalabs.com/) **OpenQAOA is currently in OpenBeta.** -Please, consider [joining our discord](https://discord.gg/ana76wkKBd) if you want to be part of our community and participate in the OpenQAOA's development. +Please, consider [joining our discord](https://discord.gg/ana76wkKBd) if you +want to be part of our community and participate in the OpenQAOA's development. ## Installation instructions ### 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.9` first and then +simply pip install openqaoa-pyquil with the following command. **NOTE:** Installing `openqaoa-pyquil` installs `openqaoa-core` by default @@ -38,34 +56,48 @@ pip install openqaoa-pyquil ``` ### 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]() -Should you face any issue during the installation, please drop us an email at openqaoa@entropicalabs.com or open an issue! +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](https://github.com/entropicalabs/openqaoa/blob/dev/README.md) + +Should you face any issue during the installation, please drop us an email at +openqaoa@entropicalabs.com or open an issue! ## Getting started -The documentation for OpenQAOA-Pyquil can be found [here](https://el-openqaoa.readthedocs.io/en/latest/). +The documentation for OpenQAOA-Pyquil can be found +[here](https://el-openqaoa.readthedocs.io/en/latest/). + +We also provide a set of tutorials to get you started. Among the many, perhaps +you can get started with the following ones: -We also provide a set of tutorials to get you started. Among the many, perhaps you can get started with the following ones: - Link OpenQAOA Pyquil notebooks - Using QPU - Using as QVM -### Available devives +### Available devices -OpenQAOA-Pyquil services devices both locally and on the cloud. The Rigetti supports access to their QPUs through the QCS platform. Moreover, users can also access a `qvm` emulator of Rigetti QPUs that runs locally. -**NOTE:** Using a QVM requires installation of Rigetti Forest SDK that does not come pre-installed with OpenQAOA. If required the user may install the SDK [here](https://qcs.rigetti.com/sdk-downloads) - -| Device location | Device Name | -| ------------- | ------------- | -| [Rigetti QCS](https://qcs.rigetti.com/sign-in) | Aspen-11, Aspen-M-1, and QVM simulator | +OpenQAOA-Pyquil services devices both locally and on the cloud. The Rigetti +supports access to their QPUs through the QCS platform. Moreover, users can also +access a `qvm` emulator of Rigetti QPUs that runs locally. **NOTE:** Using a QVM +requires installation of Rigetti Forest SDK that does not come pre-installed +with OpenQAOA. If required the user may install the SDK +[here](https://qcs.rigetti.com/sdk-downloads) +| Device location | Device Name | +| --------------- | ----------- | +| [Rigetti QCS](https://qcs.rigetti.com/sign-in) | Aspen-11, Aspen-M-1, and QVM simulator | ## Running the tests + TODO ## Contributing and feedback -If you find any bugs or errors, have feature requests, or code you would like to contribute, feel free to open an issue or send us a pull request on GitHub. +If you find any bugs or errors, have feature requests, or code you would like to +contribute, feel free to open an issue or send us a pull request on GitHub. -We are always interested to hear about projects built with EntropicaQAOA. If you have an application you'd like to tell us about, drop us an email at openqaoa@entropicalabs.com. +We are always interested to hear about projects built with EntropicaQAOA. If you +have an application you'd like to tell us about, drop us an email at +openqaoa@entropicalabs.com. diff --git a/src/openqaoa-pyquil/openqaoa_pyquil/__init__.py b/src/openqaoa-pyquil/openqaoa_pyquil/__init__.py index e69de29bb..9942648d5 100644 --- a/src/openqaoa-pyquil/openqaoa_pyquil/__init__.py +++ b/src/openqaoa-pyquil/openqaoa_pyquil/__init__.py @@ -0,0 +1,3 @@ +import importlib.metadata + +__version__ = importlib.metadata.version("openqaoa_pyquil") diff --git a/src/openqaoa-pyquil/openqaoa_pyquil/_version.py b/src/openqaoa-pyquil/openqaoa_pyquil/_version.py deleted file mode 100644 index fe404ae57..000000000 --- a/src/openqaoa-pyquil/openqaoa_pyquil/_version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.2.5" diff --git a/src/openqaoa-pyquil/pyproject.toml b/src/openqaoa-pyquil/pyproject.toml index 638dd9c54..a510d6f82 100644 --- a/src/openqaoa-pyquil/pyproject.toml +++ b/src/openqaoa-pyquil/pyproject.toml @@ -1,3 +1,31 @@ [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" + +[tool.setuptools.packages.find] +where = ["."] + +[project] +name = "openqaoa-pyquil" +version = "0.2.5" +authors = [{ name = "Entropica Labs" }] +description = "Pyquil Plug-in for OpenQAOA" +readme = "README.md" +requires-python = ">=3.9, <3.12" +license = { file = "LICENSE" } +urls = { "Homepage" = "https://github.com/entropicalabs/openqaoa" } +classifiers = [ + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", +] +keywords = ["quantum", "optimisation", "SDK"] + +dependencies = [ + "openqaoa-core==0.2.5", + "pyquil>=4.0.0" +] + +[project.entry-points."openqaoa.plugins"] +pyquil = "openqaoa_pyquil.backend_config" diff --git a/src/openqaoa-pyquil/requirements.txt b/src/openqaoa-pyquil/requirements.txt deleted file mode 100644 index c4fc2f327..000000000 --- a/src/openqaoa-pyquil/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pyquil \ No newline at end of file diff --git a/src/openqaoa-pyquil/setup.py b/src/openqaoa-pyquil/setup.py deleted file mode 100644 index 24ea1aa2c..000000000 --- a/src/openqaoa-pyquil/setup.py +++ /dev/null @@ -1,41 +0,0 @@ -from setuptools import setup, find_packages -from os import getcwd - -current_path = getcwd() - -with open("README.md", "r") as fh: - long_description = fh.read() - -with open("openqaoa_pyquil/_version.py") as f: - version = f.readlines()[-1].split()[-1].strip("\"'") - -requirements = [ - "openqaoa-core=={}".format(version), -] - -add_requirements = open("requirements.txt").readlines() -add_requirements = [r.strip() for r in add_requirements] - -requirements.extend(add_requirements) - -setup( - name="openqaoa-pyquil", - python_requires=">=3.8, <3.11", - version=version, - author="Entropica Labs", - packages=find_packages(where="."), - entry_points={"openqaoa.plugins": ["pyquil = openqaoa_pyquil.backend_config"]}, - url="https://github.com/entropicalabs/openqaoa", - install_requires=requirements, - license="MIT", - description="Pyquil Plug-in for OpenQAOA", - long_description=long_description, - long_description_content_type="text/markdown", - classifiers=[ - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Operating System :: OS Independent", - ], - keywords="quantum optimisation SDK", -) diff --git a/src/openqaoa-qiskit/MANIFEST.in b/src/openqaoa-qiskit/MANIFEST.in deleted file mode 100644 index 540b72040..000000000 --- a/src/openqaoa-qiskit/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include requirements.txt \ No newline at end of file diff --git a/src/openqaoa-qiskit/README.md b/src/openqaoa-qiskit/README.md index e29bd1925..c9ea23c25 100644 --- a/src/openqaoa-qiskit/README.md +++ b/src/openqaoa-qiskit/README.md @@ -5,31 +5,48 @@ OpenQAOA - [![build test](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml/badge.svg)](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml) - [![Documentation Status](https://readthedocs.org/projects/el-openqaoa/badge/?version=latest)](https://el-openqaoa.readthedocs.io/en/latest/?badge=latest) - [![PyPI version](https://badge.fury.io/py/openqaoa.svg)](https://badge.fury.io/py/openqaoa) - [![arXiv](https://img.shields.io/badge/arXiv-2210.08695-.svg)](https://arxiv.org/abs/2210.08695) - [![License](https://img.shields.io/pypi/l/openqaoa)](LICENSE.md) - [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) - [![Downloads](https://pepy.tech/badge/openqaoa)](https://pepy.tech/project/openqaoa) - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/entropicalabs/openqaoa.git/main?labpath=%2Fexamples) - [![Discord](https://img.shields.io/discord/991258119525122058)](https://discord.gg/ana76wkKBd) - [![Website](https://img.shields.io/badge/OpenQAOA-Website-blueviolet)](https://openqaoa.entropicalabs.com/) +[![build test](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml/badge.svg)](https://github.com/entropicalabs/openqaoa/actions/workflows/test_main_linux.yml) +[![Documentation Status](https://readthedocs.org/projects/el-openqaoa/badge/?version=latest)](https://el-openqaoa.readthedocs.io/en/latest/?badge=latest) + + + +[![PyPI version](https://badge.fury.io/py/openqaoa.svg)](https://badge.fury.io/py/openqaoa) + + + +[![arXiv](https://img.shields.io/badge/arXiv-2210.08695-.svg)](https://arxiv.org/abs/2210.08695) + + + +[![License](https://img.shields.io/pypi/l/openqaoa)](LICENSE.md) +[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) +[![Downloads](https://pepy.tech/badge/openqaoa)](https://pepy.tech/project/openqaoa) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/entropicalabs/openqaoa.git/main?labpath=%2Fexamples) +[![Discord](https://img.shields.io/discord/991258119525122058)](https://discord.gg/ana76wkKBd) +[![Website](https://img.shields.io/badge/OpenQAOA-Website-blueviolet)](https://openqaoa.entropicalabs.com/) + # OpenQAOA-Qiskit Plugin -OpenQAOA is a multi-backend python library for quantum optimization using QAOA on Quantum computers and Quantum computer simulators. This package is part of a set of OpenQAOA plug-ins that lets users run QAOA computations on IBMQ devices, and devices that support qiskit circuits. Check out OpenQAOA website [https://openqaoa.entropicalabs.com/](https://openqaoa.entropicalabs.com/) +OpenQAOA is a multi-backend python library for quantum optimization using QAOA +on Quantum computers and Quantum computer simulators. This package is part of a +set of OpenQAOA plug-ins that lets users run QAOA computations on IBMQ devices, +and devices that support qiskit circuits. Check out OpenQAOA website +[https://openqaoa.entropicalabs.com/](https://openqaoa.entropicalabs.com/) **OpenQAOA is currently in OpenBeta.** -Please consider [joining our discord](https://discord.gg/ana76wkKBd) if you want to be part of our community and participate in the OpenQAOA's development. +Please consider [joining our discord](https://discord.gg/ana76wkKBd) if you want +to be part of our community and participate in the OpenQAOA's development. ## Installation instructions ### 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.9` first and then +simply pip install openqaoa-qiskit with the following command. **NOTE:** Installing `openqaoa-qiskit` installs `openqaoa-core` by default @@ -38,28 +55,36 @@ pip install openqaoa-qiskit ``` ### 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]() -Should you face any issue during the installation, please drop us an email at openqaoa@entropicalabs.com or open an issue! +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](https://github.com/entropicalabs/openqaoa/blob/dev/README.md) + +Should you face any issue during the installation, please drop us an email at +openqaoa@entropicalabs.com or open an issue! ## Getting started -The documentation for OpenQAOA-Qiskit can be found [here](https://el-openqaoa.readthedocs.io/en/latest/). +The documentation for OpenQAOA-Qiskit can be found +[here](https://el-openqaoa.readthedocs.io/en/latest/). + +We also provide a set of tutorials to get you started. Among the many, perhaps +you can get started with the following ones: -We also provide a set of tutorials to get you started. Among the many, perhaps you can get started with the following ones: - Link OpenQAOA Qiskit notebooks - Using QPU - Using Qiskit Simulators -### Available devives +### Available devices -OpenQAOA-Qiskit services devices both locally and on the cloud. The QPU accessible through the cloud depends on the specified credentials. Moreover, users can also access `qiskit` local simulators. +OpenQAOA-Qiskit services devices both locally and on the cloud. The QPU +accessible through the cloud depends on the specified credentials. Moreover, +users can also access `qiskit` local simulators. | Device location | Device Name | | --------------- | ----------- | -| `local`| `['qiskit.shot_simulator', 'qiskit.statevector_simulator']` | -| `ibmq` | Please check the IBMQ backends available to your [account](https://quantum-computing.ibm.com/) | - +| `local` | `['qiskit.shot_simulator', 'qiskit.statevector_simulator']` | +| `ibmq` | Please check the IBMQ backends available to your [account](https://quantum-computing.ibm.com/) | ## Running the tests @@ -67,6 +92,9 @@ TODO ## Contributing and feedback -If you find any bugs or errors, have feature requests, or code you would like to contribute, feel free to open an issue or send us a pull request on GitHub. +If you find any bugs or errors, have feature requests, or code you would like to +contribute, feel free to open an issue or send us a pull request on GitHub. -We are always interested to hear about projects built with EntropicaQAOA. If you have an application you'd like to tell us about, drop us an email at openqaoa@entropicalabs.com. +We are always interested to hear about projects built with EntropicaQAOA. If you +have an application you'd like to tell us about, drop us an email at +openqaoa@entropicalabs.com. diff --git a/src/openqaoa-qiskit/openqaoa_qiskit/__init__.py b/src/openqaoa-qiskit/openqaoa_qiskit/__init__.py index e69de29bb..f57c0e87b 100644 --- a/src/openqaoa-qiskit/openqaoa_qiskit/__init__.py +++ b/src/openqaoa-qiskit/openqaoa_qiskit/__init__.py @@ -0,0 +1,3 @@ +import importlib.metadata + +__version__ = importlib.metadata.version("openqaoa_qiskit") diff --git a/src/openqaoa-qiskit/openqaoa_qiskit/_version.py b/src/openqaoa-qiskit/openqaoa_qiskit/_version.py deleted file mode 100644 index fe404ae57..000000000 --- a/src/openqaoa-qiskit/openqaoa_qiskit/_version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.2.5" diff --git a/src/openqaoa-qiskit/pyproject.toml b/src/openqaoa-qiskit/pyproject.toml index 638dd9c54..06f7ee1c2 100644 --- a/src/openqaoa-qiskit/pyproject.toml +++ b/src/openqaoa-qiskit/pyproject.toml @@ -1,3 +1,33 @@ [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" + +[tool.setuptools.packages.find] +where = ["."] + +[project] +name = "openqaoa-qiskit" +version = "0.2.5" +authors = [{ name = "Entropica Labs" }] +description = "Qiskit Plug-in for OpenQAOA" +readme = "README.md" +requires-python = ">=3.9, <3.12" +license = { file = "LICENSE" } +urls = { "Homepage" = "https://github.com/entropicalabs/openqaoa" } +classifiers = [ + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent" +] +keywords = ["quantum", "optimisation", "SDK"] + +dependencies = [ + "openqaoa-core==0.2.5", + "qiskit>=0.36.1,<1.0", + "qiskit-ibm-provider", + "qiskit-aer" +] + +[project.entry-points."openqaoa.plugins"] +qiskit = "openqaoa_qiskit.backend_config" diff --git a/src/openqaoa-qiskit/requirements.txt b/src/openqaoa-qiskit/requirements.txt deleted file mode 100644 index 469ae1b6e..000000000 --- a/src/openqaoa-qiskit/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -qiskit>=0.36.1,<1.0 -qiskit-ibm-provider -qiskit-aer \ No newline at end of file diff --git a/src/openqaoa-qiskit/setup.py b/src/openqaoa-qiskit/setup.py deleted file mode 100644 index ff5bf7218..000000000 --- a/src/openqaoa-qiskit/setup.py +++ /dev/null @@ -1,41 +0,0 @@ -from setuptools import setup, find_packages -from os import getcwd - -current_path = getcwd() - -with open("README.md", "r") as fh: - long_description = fh.read() - -with open("openqaoa_qiskit/_version.py") as f: - version = f.readlines()[-1].split()[-1].strip("\"'") - -requirements = [ - "openqaoa-core=={}".format(version), -] - -add_requirements = open("requirements.txt").readlines() -add_requirements = [r.strip() for r in add_requirements] - -requirements.extend(add_requirements) - -setup( - name="openqaoa-qiskit", - python_requires=">=3.8, <3.11", - version=version, - author="Entropica Labs", - packages=find_packages(where="."), - entry_points={"openqaoa.plugins": ["qiskit = openqaoa_qiskit.backend_config"]}, - url="https://github.com/entropicalabs/openqaoa", - install_requires=requirements, - license="MIT", - description="Qiskit Plug-in for OpenQAOA", - long_description=long_description, - long_description_content_type="text/markdown", - classifiers=[ - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Operating System :: OS Independent", - ], - keywords="quantum optimisation SDK", -)