Skip to content

Commit

Permalink
Merge 03b24a1 into d37098b
Browse files Browse the repository at this point in the history
  • Loading branch information
BoxiLi committed Apr 3, 2024
2 parents d37098b + 03b24a1 commit 845fcd2
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 51 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'
python-version: '3.9'

- name: Install Pandoc
run: |
Expand All @@ -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.
Expand Down
37 changes: 13 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -26,37 +26,31 @@ 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.*'
qiskit-version: '==0.46.*'
pyqir-version: '==0.6.2'
python-version: '3.8'
python-version: '3.9'
- case-name: qiskit+qir
os: macOS-latest
qutip-version: ''
qiskit-version: '==0.36.*'
qiskit-version: '==0.46.*'
pyqir-version: '==0.6.2'
python-version: '3.9'
- case-name: qiskit+qir
os: ubuntu-latest
qutip-version: ''
qiskit-version: '==0.36.*'
qiskit-version: '==0.46.*'
pyqir-version: '==0.6.2'
python-version: '3.7'
python-version: '3.9'

steps:
- uses: actions/checkout@v3
Expand All @@ -74,15 +68,9 @@ 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: ${{ matrix.qutip-version == '@master' || startsWith( matrix.qutip-version, '==5') }}
run: |
python -m pip install 'git+https://github.com/qutip/qutip-qtrl.git'
- name: Install Qiskit from PyPI
if: ${{ matrix.qiskit-version != '' }}
run: python -m pip install 'qiskit${{ matrix.qiskit-version }}'
run: python -m pip install 'qiskit${{ matrix.qiskit-version }}' 'qiskit-aer==0.14.0.1'

- name: Install PyQIR from PyPI
if: ${{ matrix.pyqir-version != '' }}
Expand Down Expand Up @@ -111,11 +99,12 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
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: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------
Expand Down
3 changes: 2 additions & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ docutils==0.17.1
sphinxcontrib-bibtex==2.4.2
pyqir-generator==0.6.2
pyqir-parser==0.6.2
qiskit==0.37.2
qiskit==0.46.1
qiskit-aer==0.14.0.1
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
2 changes: 1 addition & 1 deletion doc/source/contribution-code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Contributing to the source code
Build up an development environment
===================================

Please follow the instruction on the `QuTiP contribution guide <https://qutip.org/docs/latest/development/contributing.html#building>`_ to
Please follow the instruction on the `QuTiP contribution guide <https://qutip.readthedocs.io/en/stable/development/contributing.html#building>`_ 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
Expand Down
2 changes: 1 addition & 1 deletion doc/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Prerequisites
This package is built upon QuTiP, of which the installation guide can be found at on `QuTiP Installation <http://qutip.org/docs/latest/installation.html>`_.
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
Expand Down
2 changes: 1 addition & 1 deletion doc/source/tutorials-website/tutorials.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</div>

<h4 id="quantum-information-processing">Quantum information processing</h4>
<p>This section contains tutorials for QuTiP Version 5. You can find the tutorials for QuTiP Version 4 <a href="https://qutip.org/qutip-tutorials/">here</a>. To check the version of QuTiP, you can use the <code>qutip.about()</code> command.</p>
<p>This section contains tutorials for QuTiP Version 5. You can find the tutorials for QuTiP Version 4 <a href="https://qutip.org/qutip-tutorials/index-v4">here</a>. To check the version of QuTiP, you can use the <code>qutip.about()</code> command.</p>

<h5 id="qip-circuits">Quantum circuits and algorithms</h5>
<ul>
Expand Down
5 changes: 4 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ 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
qiskit<1.0.0
qiskit_aer
2 changes: 2 additions & 0 deletions tests/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ filterwarnings =
ignore:matplotlib not found:UserWarning
ignore:the imp module is deprecated in favour of importlib:DeprecationWarning
ignore:Dedicated options class are no longer needed, options should be passed as dict to solvers.:FutureWarning
ignore::DeprecationWarning:qiskit.utils.algorithm_globals:

26 changes: 11 additions & 15 deletions tests/test_qiskit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,21 @@
DispersiveCavityQED,
)

try:
from qiskit import QuantumCircuit
from qiskit.providers.aer import AerSimulator
from qutip_qip.qiskit.provider import (
QiskitCircuitSimulator,
QiskitPulseSimulator,
)
from qutip_qip.qiskit.converter import (
convert_qiskit_circuit,
_get_qutip_index,
)
except ImportError:
pass


# will skip tests in this entire file
# if qiskit is not installed
pytest.importorskip("qiskit")

from qiskit import QuantumCircuit
from qiskit_aer import AerSimulator
from qutip_qip.qiskit.provider import (
QiskitCircuitSimulator,
QiskitPulseSimulator,
)
from qutip_qip.qiskit.converter import (
convert_qiskit_circuit,
_get_qutip_index,
)


class TestConverter:
"""
Expand Down

0 comments on commit 845fcd2

Please sign in to comment.