Skip to content

Commit 65119be

Browse files
authored
Merge pull request #108 from nwlambert/fix-broken-links
Fix broken links errors from APS block, split environment requirements for v4 and v5 tutorials, fix accumulated errors in various notebooks.
2 parents d512ec2 + 7357d5f commit 65119be

11 files changed

+60
-30
lines changed

.github/workflows/nightly_ci.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@ jobs:
2525
with:
2626
use-quiet-mode: 'yes'
2727
folder-path: tutorials-v${{ matrix.qutip-version }}
28+
#use config file to define 403 and 405 errors as valid links
29+
#(APS blocks this link check)
30+
config-file: mlc_config.json
2831

2932
- name: Setup Mambaforge
3033
uses: conda-incubator/setup-miniconda@v2
3134
with:
3235
miniforge-variant: Mambaforge
3336
miniforge-version: latest
34-
activate-environment: test-environment
37+
activate-environment: test-environment-v${{ matrix.qutip-version }}
3538
use-mamba: true
3639

3740
- name: Get Date
@@ -51,7 +54,7 @@ jobs:
5154

5255
- name: Install environment
5356
if: steps.cache.outputs.cache-hit != 'true'
54-
run: mamba env update -n test-environment -f test_environment.yml
57+
run: mamba env update -n test-environment-v${{ matrix.qutip-version }} -f test_environment-v${{ matrix.qutip-version }}.yml
5558

5659
- name: Install QuTiP
5760
run: |

.github/workflows/notebook_ci.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,16 @@ jobs:
2727
with:
2828
use-quiet-mode: 'yes'
2929
folder-path: tutorials-v${{ matrix.qutip-version }}
30+
#use config file to define 403 and 405 errors as valid links
31+
#(APS blocks this link check)
32+
config-file: mlc_config.json
3033

3134
- name: Setup Mambaforge
3235
uses: conda-incubator/setup-miniconda@v2
3336
with:
3437
miniforge-variant: Mambaforge
3538
miniforge-version: latest
36-
activate-environment: test-environment
39+
activate-environment: test-environment-v${{ matrix.qutip-version }}
3740
use-mamba: true
3841

3942
- name: Get Date
@@ -53,7 +56,7 @@ jobs:
5356

5457
- name: Install environment
5558
if: steps.cache.outputs.cache-hit != 'true'
56-
run: mamba env update -n test-environment -f test_environment.yml
59+
run: mamba env update -n test-environment-v${{ matrix.qutip-version }} -f test_environment-v${{ matrix.qutip-version }}.yml
5760

5861
- name: Install QuTiP
5962
run: |

mlc_config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"projectBaseUrl":"${workspaceFolder}",
3+
"timeout": "20s",
4+
"retryOn429": true,
5+
"retryCount": 5,
6+
"fallbackRetryDelay": "30s",
7+
"aliveStatusCodes": [200, 206, 403, 405]
8+
}

test_environment.yml renamed to test_environment-v4.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: test-environment
1+
name: test-environment-v4
22
channels:
33
- conda-forge
44
dependencies:

test_environment-v5.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: test-environment-v5
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python==3.12
6+
- pip>=22.1.2
7+
- numpy>=2.0.0
8+
- scipy>=1.9
9+
- matplotlib>=3.9
10+
- imagemagick>=7.1.0_36
11+
- mpmath>=1.2.1
12+
- pytest>=7.1.2
13+
- nbmake>=1.3.4
14+
- jupytext>=1.13.8
15+
- jupyter>=1.0.0
16+
- ipykernel>=6.17.1 # 6.18.0 was yanked but is still present on conda-forge

tutorials-v5/lectures/Lecture-5-Parametric-Amplifier.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jupyter:
55
extension: .md
66
format_name: markdown
77
format_version: '1.3'
8-
jupytext_version: 1.13.8
8+
jupytext_version: 1.16.4
99
kernelspec:
1010
display_name: Python 3 (ipykernel)
1111
language: python
@@ -416,12 +416,12 @@ def plot_covariance_matrix(V, ax):
416416

417417
ax.view_init(azim=-40, elev=60)
418418
ax.bar3d(xpos, ypos, zpos, dx, dy, dz, color=colors)
419-
ax.axes.w_xaxis.set_major_locator(plt.IndexLocator(1, -0.5))
420-
ax.axes.w_yaxis.set_major_locator(plt.IndexLocator(1, -0.5))
421-
ax.axes.w_xaxis.set_ticklabels(("$q_-$", "$p_-$", "$q_+$", "$p_+$"),
422-
fontsize=20)
423-
ax.axes.w_yaxis.set_ticklabels(("$q_-$", "$p_-$", "$q_+$", "$p_+$"),
424-
fontsize=20)
419+
ax.axes.xaxis.set_major_locator(plt.IndexLocator(1, -0.5))
420+
ax.axes.yaxis.set_major_locator(plt.IndexLocator(1, -0.5))
421+
ax.axes.xaxis.set_ticklabels(("$q_-$", "$p_-$", "$q_+$", "$p_+$"),
422+
fontsize=12)
423+
ax.axes.yaxis.set_ticklabels(("$q_-$", "$p_-$", "$q_+$", "$p_+$"),
424+
fontsize=12)
425425
```
426426

427427
```python
@@ -430,7 +430,7 @@ t_idx_vec = [0, 20, 40]
430430

431431
fig, axes = plt.subplots(
432432
len(t_idx_vec), 1, subplot_kw={"projection": "3d"},
433-
figsize=(6, 3 * len(t_idx_vec))
433+
figsize=(10, 3 * len(t_idx_vec))
434434
)
435435

436436
for idx, t_idx in enumerate(t_idx_vec):

tutorials-v5/time-evolution/008_brmesolve_time_dependence.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jupyter:
55
extension: .md
66
format_name: markdown
77
format_version: '1.3'
8-
jupytext_version: 1.13.8
8+
jupytext_version: 1.16.4
99
kernelspec:
1010
display_name: Python 3 (ipykernel)
1111
language: python
@@ -86,8 +86,9 @@ $$ J(\omega, t) = \kappa * e^{-t} \quad \text{for} \; \omega \geq 0$$
8686
```python
8787
# setup dissipation
8888
kappa = 0.2
89-
a_ops = [[a + a.dag(), "{kappa}*exp(-t)*(w>=0)".format(kappa=kappa)]]
90-
89+
a_ops = [
90+
([a+a.dag(), f'sqrt({kappa}*exp(-t))'], '(w>=0)')
91+
]
9192
# solve
9293
result_brme_aops = brmesolve(H, psi0, times, a_ops, e_ops=[a.dag() * a])
9394

tutorials-v5/time-evolution/009_brmesolve-cavity-QED.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jupyter:
55
extension: .md
66
format_name: markdown
77
format_version: '1.3'
8-
jupytext_version: 1.13.8
8+
jupytext_version: 1.16.4
99
kernelspec:
1010
display_name: Python 3 (ipykernel)
1111
language: python
@@ -134,7 +134,7 @@ The `qutip.brmesolve()` function automatically uses the secular approximation, i
134134

135135
```python
136136
result_brme_nonsec = brmesolve(H_strong, psi0, times, a_ops,
137-
e_ops, sec_cutoff=-1)
137+
sec_cutoff=-1, e_ops=e_ops)
138138
fig, axes = plot_expectation_values(
139139
[result_brme_strong, result_brme_nonsec], ylabels=["<n_cav>", "<n_atom>"]
140140
)

tutorials-v5/time-evolution/013_nonmarkovian_monte_carlo.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jupyter:
55
extension: .md
66
format_name: markdown
77
format_version: '1.3'
8-
jupytext_version: 1.16.1
8+
jupytext_version: 1.16.4
99
kernelspec:
1010
display_name: Python 3 (ipykernel)
1111
language: python
@@ -207,7 +207,7 @@ options = {"progress_bar": "enhanced"} # options shared by all solvers
207207
ntraj = 5500
208208

209209
H = 2 * qt.sigmap() * qt.sigmam()
210-
ops_and_rates = [[qt.sigmam(), Gamma_int]]
210+
ops_and_rates = [[qt.sigmam(), qt.coefficient(Gamma_int)]]
211211
psi0 = qt.basis(2, 0)
212212
e_ops = [H]
213213
```
@@ -766,8 +766,8 @@ if results_folder_exists and NUM_BATCHES > 0:
766766
fit = np.polyfit(np.log(xval), yval, 1)
767767
print(('Approximate number of trajectories required for convergence until '
768768
'time t (according to linear fit):\n'
769-
f'N = {np.exp(-fit[1] / fit[0]) :.2f} * '
770-
f'exp( {1 / fit[0] / times3[-1] :.2f} * t )\n'))
769+
f'N = {np.exp(-fit[1] / fit[0]):.2f} * '
770+
f'exp( {1 / fit[0] / times3[-1]:.2f} * t )\n'))
771771

772772
plt.semilogx(xval, yval, label='Simulation result')
773773
plt.semilogx(xval, fit[0] * np.log(xval) + fit[1], '--', label='Fit')

tutorials-v5/time-evolution/020_homodyned-Jaynes-Cummings-emission.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jupyter:
55
extension: .md
66
format_name: markdown
77
format_version: '1.3'
8-
jupytext_version: 1.13.8
8+
jupytext_version: 1.16.4
99
kernelspec:
1010
display_name: Python 3 (ipykernel)
1111
language: python
@@ -280,7 +280,7 @@ def calculate_rho_ss_c(Om):
280280
rho_ss_c = [calculate_rho_ss_c(Om) for Om in Om_list]
281281

282282
# calculate list of interference values for all driving strengths
283-
alpha_list = -expect(rho_ss_c, a_r)
283+
alpha_list = -np.array(expect(rho_ss_c, a_r))
284284
alpha_c_list = alpha_list.conjugate()
285285

286286
# decompose emission for all driving strengths

0 commit comments

Comments
 (0)