Skip to content

Commit

Permalink
Merge branch 'master' into feature.dims.in.creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericgig committed Feb 13, 2024
2 parents 058bda2 + 4f6231a commit 4d67ad9
Show file tree
Hide file tree
Showing 66 changed files with 1,290 additions and 1,548 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,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.8'
python-version: '3.9'

- name: Install pip build
run: |
Expand Down Expand Up @@ -107,11 +107,11 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
env:
# Set up wheels matrix. This is CPython 3.8--3.10 for all OS targets.
CIBW_BUILD: "cp3{8,9,10,11}-*"
# Set up wheels matrix. This is CPython 3.9--3.12 for all OS targets.
CIBW_BUILD: "cp3{9,10,11,12}-*"
# Numpy and SciPy do not supply wheels for i686 or win32 for
# Python 3.10+, so we skip those:
CIBW_SKIP: "*-musllinux* cp3{8,9,10,11}-manylinux_i686 cp3{8,9,10,11}-win32"
CIBW_SKIP: "*-musllinux* cp3{10,11,12}-manylinux_i686 cp3{10,11,12}-win32"
OVERRIDE_VERSION: ${{ github.event.inputs.override_version }}

steps:
Expand All @@ -121,7 +121,7 @@ jobs:
name: Install Python
with:
# This is about the build environment, not the released wheel version.
python-version: '3.8'
python-version: '3.9'

- name: Install cibuildwheel
run: |
Expand Down Expand Up @@ -165,12 +165,12 @@ jobs:
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'
python-version: '3.9'

- name: Verify this is not a dev version
shell: bash
run: |
python -m pip install wheels/*-cp38-cp38-manylinux*.whl
python -m pip install wheels/*-cp39-cp39-manylinux*.whl
python -c 'import qutip; print(qutip.__version__); assert "dev" not in qutip.__version__; assert "+" not in qutip.__version__'
# We built the zipfile for convenience distributing to Windows users on
Expand Down Expand Up @@ -198,12 +198,12 @@ jobs:
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'
python-version: '3.9'

- name: Verify this is not a dev version
shell: bash
run: |
python -m pip install wheels/*-cp38-cp38-manylinux*.whl
python -m pip install wheels/*-cp39-cp39-manylinux*.whl
python -c 'import qutip; print(qutip.__version__); assert "dev" not in qutip.__version__; assert "+" not in qutip.__version__'
# We built the zipfile for convenience distributing to Windows users on
Expand Down
102 changes: 63 additions & 39 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,58 +27,51 @@ jobs:
os: [ubuntu-latest]
# Test other versions of Python in special cases to avoid exploding the
# matrix size; make sure to test all supported versions in some form.
python-version: ["3.9"]
python-version: ["3.11"]
case-name: [defaults]
numpy-requirement: [">=1.20,<1.21"]
numpy-requirement: [">=1.22"]
scipy-requirement: [">=1.8"]
coverage-requirement: ["==6.5"]
# Extra special cases. In these, the new variable defined should always
# be a truth-y value (hence 'nomkl: 1' rather than 'mkl: 0'), because
# the lack of a variable is _always_ false-y, and the defaults lack all
# the special cases.
include:
# Mac
# Mac has issues with MKL since september 2022.
- case-name: macos
os: macos-latest
python-version: "3.10"
condaforge: 1
nomkl: 1

# Scipy 1.5
- case-name: old SciPy
# Python 3.9, Scipy 1.7, numpy 1.22
# On more version than suggested by SPEC 0
# https://scientific-python.org/specs/spec-0000/
# There are deprecation warnings when using cython 0.29.X
- case-name: Old setup
os: ubuntu-latest
python-version: "3.8"
numpy-requirement: ">=1.20,<1.21"
scipy-requirement: ">=1.5,<1.6"
python-version: "3.9"
scipy-requirement: ">=1.8,<1.9"
numpy-requirement: ">=1.22,<1.23"
condaforge: 1
oldcython: 1
pytest-extra-options: "-W ignore:dep_util:DeprecationWarning"

# No MKL runs. MKL is now the default for conda installations, but
# not necessarily for pip.
- case-name: no MKL
os: ubuntu-latest
python-version: "3.9"
numpy-requirement: ">=1.20,<1.21"
nomkl: 1

# Builds without Cython at runtime. This is a core feature;
# everything should be able to run this.
- case-name: no Cython
os: ubuntu-latest
python-version: "3.8"
nocython: 1

# Python 3.10 and numpy 1.22
# Use conda-forge to provide numpy 1.22
- case-name: Python 3.10
# Python 3.10, no mkl, scipy 1.9, numpy 1.23
# Scipy 1.9 did not support cython 3.0 yet.
# cython#17234
- case-name: no mkl
os: ubuntu-latest
python-version: "3.10"
scipy-requirement: ">=1.9,<1.10"
numpy-requirement: ">=1.23,<1.24"
condaforge: 1
oldcython: 1
nomkl: 1
pytest-extra-options: "-W ignore:dep_util:DeprecationWarning"

# Python 3.11 and latest numpy
# Python 3.10, no cython, scipy 1.10, numpy 1.24
- case-name: no cython
os: ubuntu-latest
python-version: "3.10"
scipy-requirement: ">=1.10,<1.11"
numpy-requirement: ">=1.24,<1.25"
nocython: 1

# Python 3.11 and recent numpy
# Use conda-forge to provide Python 3.11 and latest numpy
# Ignore deprecation of the cgi module in Python 3.11 that is
# still imported by Cython.Tempita. This was addressed in
Expand All @@ -88,22 +81,43 @@ jobs:
os: ubuntu-latest
python-version: "3.11"
condaforge: 1
scipy-requirement: ">=1.11,<1.12"
numpy-requirement: ">=1.25,<1.26"
conda-extra-pkgs: "suitesparse" # for compiling cvxopt
pytest-extra-options: "-W ignore::DeprecationWarning:Cython.Tempita"

# Python 3.12 and latest numpy
# Use conda-forge to provide Python 3.11 and latest numpy
- case-name: Python 3.12
os: ubuntu-latest
python-version: "3.12"
scipy-requirement: ">=1.12,<1.13"
numpy-requirement: ">=1.26,<1.27"
condaforge: 1
pytest-extra-options: "-W ignore:datetime:DeprecationWarning"
# Install mpi4py to test mpi_pmap
# Should be enough to include this in one of the runs
includempi: 1

# Mac
# Mac has issues with MKL since september 2022.
- case-name: macos
os: macos-latest
python-version: "3.11"
condaforge: 1
nomkl: 1

# Windows. Once all tests pass without special options needed, this
# can be moved to the main os list in the test matrix. All the tests
# that fail currently seem to do so because mcsolve uses
# multiprocessing under the hood. Windows does not support fork()
# well, which makes transfering objects to the child processes
# error prone. See, e.g., https://github.com/qutip/qutip/issues/1202
- case-name: Windows Latest
- case-name: Windows
os: windows-latest
python-version: "3.10"
python-version: "3.11"

steps:
- uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
Expand All @@ -115,7 +129,7 @@ jobs:
# rather than in the GitHub Actions file directly, because bash gives us
# a proper programming language to use.
run: |
QUTIP_TARGET="tests,graphics,semidefinite,ipython"
QUTIP_TARGET="tests,graphics,semidefinite,ipython,extras"
if [[ -z "${{ matrix.nocython }}" ]]; then
QUTIP_TARGET="$QUTIP_TARGET,runtime_compilation"
fi
Expand All @@ -135,6 +149,10 @@ jobs:
if [[ -n "${{ matrix.conda-extra-pkgs }}" ]]; then
conda install "${{ matrix.conda-extra-pkgs }}"
fi
if [[ "${{ matrix.includempi }}" ]]; then
# Use openmpi because mpich causes problems. Note, environment variable names change in v5
conda install "openmpi<5" mpi4py
fi
python -m pip install -e .[$QUTIP_TARGET]
python -m pip install "coverage${{ matrix.coverage-requirement }}"
python -m pip install pytest-cov coveralls pytest-fail-slow
Expand Down Expand Up @@ -166,6 +184,12 @@ jobs:
# truly being executed.
export QUTIP_NUM_PROCESSES=2
fi
if [[ "${{ matrix.includempi }}" ]]; then
# By default, the max. number of allowed worker processes in openmpi is
# (number of physical cpu cores) - 1.
# We only have 2 physical cores, but we want to test mpi_pmap with 2 workers.
export OMPI_MCA_rmaps_base_oversubscribe=true
fi
pytest -Werror --strict-config --strict-markers --fail-slow=300 --durations=0 --durations-min=1.0 --verbosity=1 --cov=qutip --cov-report= --color=yes ${{ matrix.pytest-extra-options }} qutip/tests
# Above flags are:
# -Werror
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ Support
[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org)

We are proud to be affiliated with [Unitary Fund](https://unitary.fund) and [numFOCUS](https://numfocus.org).
QuTiP development is supported by [Nori's lab](https://dml.riken.jp/) at RIKEN, by the University of Sherbrooke, and by Aberystwyth University, [among other supporting organizations](https://qutip.org/#supporting-organizations).

We are grateful for [Nori's lab](https://dml.riken.jp/) at RIKEN and [Blais' lab](https://www.physique.usherbrooke.ca/blais/) at the Institut Quantique
for providing developer positions to work on QuTiP.

We also thank Google for supporting us by financing GSoC students to work on the QuTiP as well as [other supporting organizations](https://qutip.org/#supporting-organizations) that have been supporting QuTiP over the years.


Installation
Expand Down
2 changes: 1 addition & 1 deletion doc/QuTiP_tree_plot/qutip-structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
("#043c6b", {"settings", "configrc", "solver"}),
# Visualisation
("#3f8fd2", {
"bloch", "bloch3d", "sphereplot", "orbital", "visualization", "wigner",
"bloch", "sphereplot", "orbital", "visualization", "wigner",
"distributions", "tomography", "topology",
}),
# Operators
Expand Down
3 changes: 0 additions & 3 deletions doc/apidoc/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ Bloch sphere
.. autoclass:: qutip.bloch.Bloch
:members:

.. autoclass:: qutip.bloch3d.Bloch3d
:members:

Distributions
-------------

Expand Down
4 changes: 2 additions & 2 deletions doc/apidoc/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Random Operators and States
---------------------------

.. automodule:: qutip.random_objects
:members: rand_dm, rand_herm, rand_ket, rand_stochastic, rand_unitary, rand_super, rand_super_bcsz
:members: rand_dm, rand_herm, rand_ket, rand_stochastic, rand_unitary, rand_super, rand_super_bcsz, rand_kraus_map


Superoperators and Liouvillians
Expand Down Expand Up @@ -297,7 +297,7 @@ Parallelization
---------------

.. automodule:: qutip.solver.parallel
:members: parallel_map, serial_map, loky_pmap
:members: parallel_map, serial_map, loky_pmap, mpi_pmap


.. _functions-ipython:
Expand Down
19 changes: 8 additions & 11 deletions doc/biblio.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. _biblo:

Bibliography
============

Expand All @@ -14,7 +14,7 @@ Bibliography
.. The trick with |text|_ is to get an italic link, and is described in the
Docutils FAQ at https://docutils.sourceforge.net/FAQ.html#is-nested-inline-markup-possible.
.. |theory-qi| replace:: *Theory of Quantum Information*
.. _theory-qi: https://cs.uwaterloo.ca/~watrous/TQI-notes/

Expand All @@ -39,10 +39,10 @@ Bibliography
.. [WBC11]
C. Wood, J. Biamonte, D. G. Cory, *Tensor networks and graphical calculus for
open quantum systems*. :arxiv:`1111.6950`
.. [dAless08]
D. d’Alessandro, *Introduction to Quantum Control and Dynamics*, (Chapman & Hall/CRC, 2008).
.. [Byrd95]
R. H. Byrd, P. Lu, J. Nocedal, and C. Zhu, *A Limited Memory Algorithm for Bound Constrained Optimization*, SIAM J. Sci. Comput. **16**, 1190 (1995). :doi:`10.1137/0916069`
Expand All @@ -51,19 +51,16 @@ Bibliography
.. [Lloyd14]
S. Lloyd and S. Montangero, *Information theoretical analysis of quantum optimal control*, Phys. Rev. Lett. **113**, 010502 (2014). :doi:`10.1103/PhysRevLett.113.010502`
.. [Doria11]
P. Doria, T. Calarco & S. Montangero, *Optimal Control Technique for Many-Body Quantum Dynamics*, Phys. Rev. Lett. **106**, 190501 (2011). :doi:`10.1103/PhysRevLett.106.190501`
.. [Caneva11]
T. Caneva, T. Calarco, & S. Montangero, *Chopped random-basis quantum optimization*, Phys. Rev. A **84**, 022326 (2011). :doi:`10.1103/PhysRevA.84.022326`
.. [Rach15]
N. Rach, M. M. Müller, T. Calarco, and S. Montangero, *Dressing the chopped-random-basis optimization: A bandwidth-limited access to the trap-free landscape*, Phys. Rev. A. **92**, 062343 (2015). :doi:`10.1103/PhysRevA.92.062343`
.. [DYNAMO]
S. Machnes, U. Sander, S. J. Glaser, P. De Fouquieres, A. Gruslys, S. Schirmer, and T. Schulte-Herbrueggen, *Comparing, Optimising and Benchmarking Quantum Control Algorithms in a Unifying Programming Framework*, Phys. Rev. A. **84**, 022305 (2010). :arxiv:`1011.4874`
.. [Wis09]
Wiseman, H. M. & Milburn, G. J. *Quantum Measurement and Control*, (Cambridge University Press, 2009).
Expand All @@ -76,4 +73,4 @@ Bibliography
B. Donvil, P. Muratore-Ginanneschi, *Quantum trajectory framework for general time-local master equations*, Nat Commun **13**, 4140 (2022). :doi:`10.1038/s41467-022-31533-8`.
.. [Abd19]
M. Abdelhafez, D. I. Schuster, J. Koch, *Gradient-based optimal control of open quantum systems using quantumtrajectories and automatic differentiation*, Phys. Rev. A **99**, 052327 (2019). :doi:`10.1103/PhysRevA.99.052327`.
M. Abdelhafez, D. I. Schuster, J. Koch, *Gradient-based optimal control of open quantum systems using quantumtrajectories and automatic differentiation*, Phys. Rev. A **99**, 052327 (2019). :doi:`10.1103/PhysRevA.99.052327`.
1 change: 1 addition & 0 deletions doc/changes/1974.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add the possibility to customize point colors as in V4 and fix point plot behavior for 'l' style
1 change: 1 addition & 0 deletions doc/changes/2284.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rework `kraus_to_choi` making it faster
1 change: 1 addition & 0 deletions doc/changes/2296.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added mpi_pmap, which uses the mpi4py module to run computations in parallel through the MPI interface.
1 change: 1 addition & 0 deletions doc/changes/2303.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Only pre-compute density matricies if keep_runs_results is False
1 change: 1 addition & 0 deletions doc/changes/2306.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove Bloch3D: redundant to Bloch
1 change: 1 addition & 0 deletions doc/changes/2311.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow tests to run without matplotlib and ipython.
1 change: 1 addition & 0 deletions doc/changes/2313.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add too small step warnings in fixed dt SODE solver
Binary file removed doc/guide/figures/bloch3d+data.png
Binary file not shown.
Binary file removed doc/guide/figures/bloch3d+points.png
Binary file not shown.
Binary file removed doc/guide/figures/bloch3d-blank.png
Binary file not shown.

0 comments on commit 4d67ad9

Please sign in to comment.