Skip to content

Commit ad896bb

Browse files
authored
Merge pull request #137 from pmenczel/bugfix
Fix failing tests
2 parents cf812c5 + 31392e4 commit ad896bb

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

.github/workflows/notebook_ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- name: Install QuTiP
6060
run: |
6161
pip install --upgrade pip
62-
python -m pip install jax jax[cpu] equinox diffrax
62+
python -m pip install "jax<0.7.0" "jax[cpu]<0.7.0" equinox diffrax
6363
git clone -b ${{ matrix.qutip-branch }} https://github.com/qutip/qutip.git
6464
cd qutip
6565
pip install -r requirements.txt

tutorials-v5/heom/heom-2-fmo-example.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ def timer(label):
6666
options = {
6767
"nsteps": 15000,
6868
"store_states": True,
69-
"rtol": 1e-12,
70-
"atol": 1e-12,
71-
"min_step": 1e-18,
7269
"method": "vern9",
7370
"progress_bar": "enhanced",
7471
}
@@ -83,9 +80,9 @@ And let us set up the system Hamiltonian and bath parameters:
8380
#
8481
# We use the Hamiltonian employed in
8582
# https://www.pnas.org/content/106/41/17255 and operate
86-
# in units of Hz:
83+
# in units of GHz:
8784
88-
Hsys = 3e10 * 2 * np.pi * Qobj([
85+
Hsys = 30 * 2 * np.pi * Qobj([
8986
[200, -87.7, 5.5, -5.9, 6.7, -13.7, -9.9],
9087
[-87.7, 320, 30.8, 8.2, 0.7, 11.8, 4.3],
9188
[5.5, 30.8, 0, -53.5, -2.2, -9.6, 6.0],
@@ -99,9 +96,9 @@ Hsys = 3e10 * 2 * np.pi * Qobj([
9996
```{code-cell} ipython3
10097
# Bath parameters
10198
102-
lam = 35 * 3e10 * 2 * np.pi
103-
gamma = 1 / 166e-15
104-
T = 300 * 0.6949 * 3e10 * 2 * np.pi
99+
lam = 35 * 30 * 2 * np.pi
100+
gamma = 1 / 166e-6
101+
T = 300 * 0.6949 * 30 * 2 * np.pi
105102
beta = 1 / T
106103
```
107104

@@ -114,18 +111,18 @@ env = DrudeLorentzEnvironment(T=T, lam=lam, gamma=gamma)
114111
```
115112

116113
```{code-cell} ipython3
117-
wlist = np.linspace(0, 200 * 3e10 * 2 * np.pi, 100)
118-
tlist = np.linspace(0, 1e-12, 1000)
114+
wlist = np.linspace(0, 200 * 30 * 2 * np.pi, 100)
115+
tlist = np.linspace(0, 1e-3, 1000)
119116
120-
J = env.spectral_density(wlist) / (3e10 * 2 * np.pi)
117+
J = env.spectral_density(wlist) / (30 * 2 * np.pi)
121118
122119
fig, axes = plt.subplots(1, 2, sharex=False, figsize=(10, 3))
123120
124121
fig.subplots_adjust(hspace=0.1) # reduce space between plots
125122
126123
# Spectral density plot:
127124
128-
axes[0].plot(wlist / (3e10 * 2 * np.pi), J, color='r', ls='--', label="J(w)")
125+
axes[0].plot(wlist / (30 * 2 * np.pi), J, color='r', ls='--', label="J(w)")
129126
axes[0].set_xlabel(r'$\omega$ (cm$^{-1}$)', fontsize=20)
130127
axes[0].set_ylabel(r"$J(\omega)$ (cm$^{-1}$)", fontsize=16)
131128
axes[0].legend()
@@ -193,7 +190,7 @@ linestyles = [
193190
for m in range(7):
194191
Q = basis(7, m) * basis(7, m).dag()
195192
axes.plot(
196-
np.array(tlist) * 1e15,
193+
np.array(tlist) * 1e6,
197194
np.real(expect(outputFMO_HEOM.states, Q)),
198195
label=m + 1,
199196
color=colors[m % len(colors)],
@@ -232,7 +229,7 @@ And now let's plot the Bloch-Redfield solver results:
232229
fig, axes = plt.subplots(1, 1, figsize=(12, 8))
233230
234231
for m, Q in enumerate(Q_list):
235-
axes.plot(tlist * 1e15, expect(outputFMO_BR.states, Q), label=m + 1)
232+
axes.plot(tlist * 1e6, expect(outputFMO_BR.states, Q), label=m + 1)
236233
237234
axes.set_xlabel(r'$t$ (fs)', fontsize=30)
238235
axes.set_ylabel(r"Population", fontsize=30)
@@ -334,7 +331,7 @@ with timer("ME ODE solver"):
334331
fig, axes = plt.subplots(1, 1, figsize=(12, 8))
335332
336333
for m, Q in enumerate(Q_list):
337-
axes.plot(tlist * 1e15, expect(outputFMO_ME.states, Q), label=m + 1)
334+
axes.plot(tlist * 1e6, expect(outputFMO_ME.states, Q), label=m + 1)
338335
339336
axes.set_xlabel(r'$t$', fontsize=20)
340337
axes.set_ylabel(r"Population", fontsize=16)
@@ -363,7 +360,7 @@ with timer("ME ODE solver"):
363360
fig, axes = plt.subplots(1, 1, figsize=(12, 8))
364361
for m, Q in enumerate(Q_list):
365362
axes.plot(
366-
tlist * 1e15,
363+
tlist * 1e6,
367364
expect(outputFMO_ME_nodephase.states, Q),
368365
label=m + 1,
369366
)

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

Lines changed: 3 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.16.4
8+
jupytext_version: 1.17.0
99
kernelspec:
1010
display_name: Python 3 (ipykernel)
1111
language: python
@@ -241,7 +241,7 @@ We will compare our results to the following exact `mesolve` simulation:
241241

242242
```python
243243
d_ops = [[qt.lindblad_dissipator(qt.sigmam(), qt.sigmam()), Gamma]]
244-
MESol = qt.mesolve([H, S], psi0, times, d_ops, e_ops, options=options)
244+
MESol = qt.mesolve([H, S], psi0, times, d_ops, e_ops=e_ops, options=options)
245245
```
246246

247247
##### Results
@@ -285,7 +285,7 @@ For clarity, we consider the same example as before, but with a shorter time int
285285

286286
```python
287287
times_is = np.linspace(ti, ti + duration / 2, steps + 1)
288-
ntraj_is = ntraj / 10
288+
ntraj_is = int(ntraj / 10)
289289

290290
MCSol_is = solver.run(psi0, tlist=times_is, ntraj=ntraj_is, e_ops=e_ops)
291291
MESol_is = qt.mesolve([H, S], psi0, times_is, d_ops, e_ops, options=options)

0 commit comments

Comments
 (0)