From 58d14371b37c74309ddbdd41a0daeeee61b8acce Mon Sep 17 00:00:00 2001 From: BoxiLi Date: Tue, 2 Apr 2024 03:54:38 +0200 Subject: [PATCH 1/6] Drop support of Python=3.7 and 3.8 --- .github/workflows/build.yml | 6 +++--- .github/workflows/build_documentation.yml | 2 +- .github/workflows/test.yml | 22 ++++++++-------------- doc/source/installation.rst | 2 +- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b193f463..4f47f623 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,7 +54,7 @@ jobs: # For the sdist we should be as conservative as possible with our # Python version. This should be the lowest supported version. This # means that no unsupported syntax can sneak through. - python-version: '3.7' + python-version: '3.11' - name: Install pip build run: | @@ -89,7 +89,7 @@ jobs: name: Install Python with: # This is about the build environment, not the released wheel version. - python-version: '3.7' + python-version: '3.11' - name: Install pip build run: | @@ -129,7 +129,7 @@ jobs: - uses: actions/setup-python@v4 name: Install Python with: - python-version: '3.7' + python-version: '3.11' - name: Verify this is not a dev version shell: bash diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml index d41d71ff..15f2a5e1 100644 --- a/.github/workflows/build_documentation.yml +++ b/.github/workflows/build_documentation.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/setup-python@v4 name: Install Python with: - python-version: '3.8' + python-version: '3.11' - name: Install Pandoc run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 49e9bc52..b1a90e59 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,11 +12,11 @@ jobs: strategy: matrix: include: - - case-name: qutip@5.0.0a2 + - case-name: qutip@5.0.0 os: ubuntu-latest - qutip-version: '==5.0.0a2' + qutip-version: '==5.0.0' pyqir-version: '' - python-version: '3.10' + python-version: '3.11' - case-name: qutip@qutip-4.7.X os: ubuntu-latest qutip-version: '@qutip-4.7.X' @@ -26,25 +26,19 @@ jobs: os: ubuntu-latest qutip-version: '@master' pyqir-version: '' - python-version: '3.11' - - case-name: qutip@4.6 - os: windows-latest - qutip-version: '==4.6.*' - qiskit-version: '' - pyqir-version: '' - python-version: '3.8' + python-version: '3.12' - case-name: qutip@4.7 os: macOS-latest qutip-version: '==4.7.*' qiskit-version: '' pyqir-version: '' - python-version: '3.9' + python-version: '3.11' - case-name: qiskit+qir os: windows-latest qutip-version: '' qiskit-version: '==0.36.*' pyqir-version: '==0.6.2' - python-version: '3.8' + python-version: '3.9' - case-name: qiskit+qir os: macOS-latest qutip-version: '' @@ -56,7 +50,7 @@ jobs: qutip-version: '' qiskit-version: '==0.36.*' pyqir-version: '==0.6.2' - python-version: '3.7' + python-version: '3.9' steps: - uses: actions/checkout@v3 @@ -111,7 +105,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.11 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/doc/source/installation.rst b/doc/source/installation.rst index 9e073b2a..d4239615 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -24,7 +24,7 @@ Prerequisites This package is built upon QuTiP, of which the installation guide can be found at on `QuTiP Installation `_. The only difference is that C++ compilers are not required here since there is no run-time compiling for qutip-qip. -The minimal Python version supported is Python 3.7. +The minimal Python version supported is Python 3.9. In particular, following packages are necessary for running qutip-qip From 81c4123e3c23e4b3b44c47a390eb7886746b00fc Mon Sep 17 00:00:00 2001 From: BoxiLi Date: Tue, 2 Apr 2024 04:02:53 +0200 Subject: [PATCH 2/6] Install qutip-qtrl except for version 4 --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b1a90e59..fd760a89 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,9 +70,9 @@ jobs: # For qutip-v5 qutip.control is replaced by qutip-qtrl - name: Install qutip-qtrl from PyPI - if: ${{ matrix.qutip-version == '@master' || startsWith( matrix.qutip-version, '==5') }} + if: ${{! startsWith( matrix.qutip-version, '==4') }} run: | - python -m pip install 'git+https://github.com/qutip/qutip-qtrl.git' + python -m pip install qutip-qtrl - name: Install Qiskit from PyPI if: ${{ matrix.qiskit-version != '' }} From ed751633d03666daa7b1076ae82cc89a57920b12 Mon Sep 17 00:00:00 2001 From: BoxiLi Date: Tue, 2 Apr 2024 04:07:04 +0200 Subject: [PATCH 3/6] Add control as an optional dependency --- .github/workflows/test.yml | 6 ------ setup.cfg | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fd760a89..2f1ea7f8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,12 +68,6 @@ jobs: run: | python -m pip install 'git+https://github.com/qutip/qutip.git${{ matrix.qutip-version }}' - # For qutip-v5 qutip.control is replaced by qutip-qtrl - - name: Install qutip-qtrl from PyPI - if: ${{! startsWith( matrix.qutip-version, '==4') }} - run: | - python -m pip install qutip-qtrl - - name: Install Qiskit from PyPI if: ${{ matrix.qiskit-version != '' }} run: python -m pip install 'qiskit${{ matrix.qiskit-version }}' diff --git a/setup.cfg b/setup.cfg index 25944753..eae11a4e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,10 +40,12 @@ where = src [options.extras_require] graphics = matplotlib>=1.3.0 +control = qutip-qtrl tests = pytest>=5.2 full = %(graphics)s %(tests)s + %(control)s qiskit = qiskit>=0.36.2 From c5c8ea78f6f64b1b138e517ec311501838661b99 Mon Sep 17 00:00:00 2001 From: BoxiLi Date: Wed, 3 Apr 2024 04:35:19 +0200 Subject: [PATCH 4/6] Pin qutip version to 4 to let the test pass --- .github/workflows/build_documentation.yml | 3 ++- .github/workflows/test.yml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml index 15f2a5e1..014fc628 100644 --- a/.github/workflows/build_documentation.yml +++ b/.github/workflows/build_documentation.yml @@ -27,7 +27,8 @@ jobs: - name: Install qutip-qip from GitHub run: | - python -mpip install -e .[full] + python -mpip install qutip==4.7.3 + python -mpip install -e . # Install in editable mode so it doesn't matter if we import from # inside the installation directory, otherwise we can get some errors # because we're importing from the wrong location. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2f1ea7f8..2c4ae157 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -104,6 +104,7 @@ jobs: run: | python -m pip install --upgrade pip python -mpip install -r doc/requirements.txt + pip install qutip==4.7.3 pip install . - name: Test code snippets in the documentation run: | From 87aa8811296170db33f6d9689c4ecf1a6662a7c2 Mon Sep 17 00:00:00 2001 From: BoxiLi Date: Wed, 3 Apr 2024 06:23:56 +0200 Subject: [PATCH 5/6] Pin doc test version to 3.9 for this PR --- .github/workflows/build_documentation.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml index 014fc628..63da4050 100644 --- a/.github/workflows/build_documentation.yml +++ b/.github/workflows/build_documentation.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/setup-python@v4 name: Install Python with: - python-version: '3.11' + python-version: '3.9' - name: Install Pandoc run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2c4ae157..4d31aad4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -99,7 +99,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.9 - name: Install dependencies run: | python -m pip install --upgrade pip From 45ae2962f0dcac5dca0f6c61762e93273d5c0060 Mon Sep 17 00:00:00 2001 From: BoxiLi Date: Wed, 3 Apr 2024 06:08:08 +0200 Subject: [PATCH 6/6] Update links to the doc --- README.md | 2 +- doc/source/conf.py | 2 +- doc/source/contribution-code.rst | 2 +- doc/source/tutorials-website/tutorials.html.jinja | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cb6b8e59..727840b5 100755 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The qutip-qip package, QuTiP quantum information processing, aims at providing b Compared to other libraries for quantum information processing, qutip-qip puts additional emphasis on the physics layer and the interaction with the QuTiP package. The package offers two different approaches for simulating quantum circuits, one with `QubitCircuit` calculating unitary evolution under quantum gates by matrix product, another called `Processor` using open system solvers in QuTiP to simulate noisy quantum device. -If you would like to know the future development plan and ideas, have a look at the [discussion panel](https://github.com/qutip/qutip-qip/discussions) as well as the [qutip documentation for ideas](https://qutip.org/docs/latest/development/ideas.html). +If you would like to know the future development plan and ideas, have a look at the [discussion panel](https://github.com/qutip/qutip-qip/discussions) as well as the [qutip documentation for ideas](https://qutip.readthedocs.io/en/stable/development/ideas.html). Quick start ----------- diff --git a/doc/source/conf.py b/doc/source/conf.py index b3137362..0c14f79e 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -185,5 +185,5 @@ def qutip_qip_version(): # -- Options for intersphinx --------------------------------------- intersphinx_mapping = { - 'qutip': ('https://qutip.org/docs/latest/', None), + 'qutip': ('https://qutip.readthedocs.io/en/stable/', None), } \ No newline at end of file diff --git a/doc/source/contribution-code.rst b/doc/source/contribution-code.rst index ed266c98..fb464137 100644 --- a/doc/source/contribution-code.rst +++ b/doc/source/contribution-code.rst @@ -7,7 +7,7 @@ Contributing to the source code Build up an development environment =================================== -Please follow the instruction on the `QuTiP contribution guide `_ to +Please follow the instruction on the `QuTiP contribution guide `_ to build a conda environment. You don't need to build ``qutip`` in the editable mode unless you also want to contribute to `qutip`. Instead, you need to install ``qutip-qip`` by downloading the source code and run diff --git a/doc/source/tutorials-website/tutorials.html.jinja b/doc/source/tutorials-website/tutorials.html.jinja index 2fc559c8..19f17955 100644 --- a/doc/source/tutorials-website/tutorials.html.jinja +++ b/doc/source/tutorials-website/tutorials.html.jinja @@ -5,7 +5,7 @@

Quantum information processing

-

This section contains tutorials for QuTiP Version 5. You can find the tutorials for QuTiP Version 4 here. To check the version of QuTiP, you can use the qutip.about() command.

+

This section contains tutorials for QuTiP Version 5. You can find the tutorials for QuTiP Version 4 here. To check the version of QuTiP, you can use the qutip.about() command.

Quantum circuits and algorithms