Skip to content

Commit

Permalink
Merge branch 'master' into feature/fix-matplotlib-test-flakiness-on-w…
Browse files Browse the repository at this point in the history
…indows
  • Loading branch information
hodgestar committed Nov 17, 2022
2 parents 123163f + b79c7cc commit cb585f2
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 19 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ jobs:
OVERRIDE_VERSION: ${{ github.event.inputs.override_version }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
# For the sdist we should be as conservative as possible with our
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
zip "$zipfile" -r "$stem"
rm -r "$stem"
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: sdist
path: |
Expand All @@ -112,9 +112,9 @@ jobs:
OVERRIDE_VERSION: ${{ github.event.inputs.override_version }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
# This is about the build environment, not the released wheel version.
Expand All @@ -134,7 +134,7 @@ jobs:
if [[ ! -z "$OVERRIDE_VERSION" ]]; then echo "$OVERRIDE_VERSION" > VERSION; fi
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl
Expand All @@ -157,9 +157,9 @@ jobs:

steps:
- name: Download build artifacts to local runner
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.7'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
# -T : display a full traceback if a Python exception occurs
- name: Upload built PDF files
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: qutip_pdf_docs
path: doc/_build/latex/*
Expand All @@ -59,7 +59,7 @@ jobs:
# -T : display a full traceback if a Python exception occurs
- name: Upload built HTML files
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: qutip_html_docs
path: doc/_build/html/*
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
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"]
Expand All @@ -35,6 +35,13 @@ jobs:
# the lack of a variable is _always_ false-y, and the defaults lack all
# the special cases.
include:
# Needs an older version of Python because conda doesn't build old
# SciPy versions for Python 3.9.
- case-name: MacOS
os: macos-latest
python-version: "3.9"
nomkl: 1

# Needs an older version of Python because conda doesn't build old
# SciPy versions for Python 3.9.
- case-name: old SciPy
Expand Down Expand Up @@ -95,7 +102,7 @@ jobs:
pytest-extra-options: "-W ignore::ImportWarning -k 'not (test_correlation or test_interpolate or test_mcsolve)'"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v2
with:
Expand Down
1 change: 1 addition & 0 deletions doc/changes/2011.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the hinton visualization method to plot the matrix instead of its transpose.
1 change: 1 addition & 0 deletions doc/changes/2012.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the hinton visualization method to take into account all the matrix coefficients to set the squares scale, instead of only the diagonal coefficients.
2 changes: 1 addition & 1 deletion qutip/steadystate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ def _pseudo_inverse_dense(L, rhoss, w=None, **pseudo_args):
try:
LIQ = np.linalg.solve(L.full(), Q)
except Exception:
LIQ = np.linalg.lstsq(L.full(), Q)[0]
LIQ = np.linalg.lstsq(L.full(), Q, rcond=None)[0]

R = np.dot(Q, LIQ)

Expand Down
8 changes: 4 additions & 4 deletions qutip/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def _cb_labels(left_dims):
return [
map(fmt.format, basis_labels) for fmt in
(
r"$\langle{}|$",
r"$|{}\rangle$",
r"$\langle{}|$"
)
]

Expand Down Expand Up @@ -303,7 +303,7 @@ def hinton(rho, xlabels=None, ylabels=None, title=None, ax=None, cmap=None,

height, width = W.shape

w_max = 1.25 * max(abs(np.diag(np.array(W))))
w_max = 1.25 * max(abs(np.array(W)).flatten())
if w_max <= 0.0:
w_max = 1.0

Expand Down Expand Up @@ -331,8 +331,8 @@ def color_fn(w):
_x = x + 1
_y = y + 1
_blob(
_x - 0.5, height - _y + 0.5, W[x, y], w_max,
min(1, abs(W[x, y]) / w_max), color_fn=color_fn, ax=ax)
_x - 0.5, height - _y + 0.5, W[y, x], w_max,
min(1, abs(W[y, x]) / w_max), color_fn=color_fn, ax=ax)

# color axis
vmax = np.pi if color_style == "phase" else abs(W).max()
Expand Down

0 comments on commit cb585f2

Please sign in to comment.