Skip to content

Commit 305e0da

Browse files
committed
Merge remote-tracking branch 'upstream/main' into feature/ntbk_smesolve
2 parents cd8b688 + 71ad984 commit 305e0da

21 files changed

+447
-89
lines changed

tutorials-v4/lectures/Lecture-11-Charge-Qubits.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ where $E_C$ is the charge energy, $E_J$ is the Josephson energy, and $\left| n\r
3939

4040
#### References
4141

42-
* [J. Koch et al, Phys. Rec. A 76, 042319 (2007)](http://link.aps.org/doi/10.1103/PhysRevA.76.042319)
42+
* [J. Koch et al, Phys. Rec. A 76, 042319 (2007)](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.76.042319)
4343
* [Y.A. Pashkin et al, Quantum Inf Process 8, 55 (2009)](http://dx.doi.org/10.1007/s11128-009-0101-5)
4444

4545

tutorials-v4/lectures/Lecture-2B-Single-Atom-Lasing.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ in units where $\hbar = 1$.
6363

6464
References:
6565

66-
* [Yi Mu, C.M. Savage, Phys. Rev. A 46, 5944 (1992)](http://dx.doi.org/10.1103/PhysRevA.46.5944)
66+
* [Yi Mu, C.M. Savage, Phys. Rev. A 46, 5944 (1992)](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.46.5944)
6767

68-
* [D.A. Rodrigues, J. Imbers, A.D. Armour, Phys. Rev. Lett. 98, 067204 (2007)](http://dx.doi.org/10.1103/PhysRevLett.98.067204)
68+
* [D.A. Rodrigues, J. Imbers, A.D. Armour, Phys. Rev. Lett. 98, 067204 (2007)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.98.067204)
6969

7070
* [S. Ashhab, J.R. Johansson, A.M. Zagoskin, F. Nori, New J. Phys. 11, 023030 (2009)](http://dx.doi.org/10.1088/1367-2630/11/2/023030)
7171

tutorials-v4/lectures/Lecture-3A-Dicke-model.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ $\displaystyle J_\pm = \sum_{i=1}^N \sigma_\pm^{(i)}$
4949

5050
### References
5151

52-
* [R.H. Dicke, Phys. Rev. 93, 99–110 (1954)](http://dx.doi.org/10.1103/PhysRev.93.99)
52+
* [R.H. Dicke, Phys. Rev. 93, 99–110 (1954)](https://journals.aps.org/pr/abstract/10.1103/PhysRev.93.99)
5353

5454

5555
## Setup problem in QuTiP
@@ -198,7 +198,7 @@ fig.tight_layout()
198198

199199
### References
200200

201-
* [Lambert et al., Phys. Rev. Lett. 92, 073602 (2004)](http://dx.doi.org/10.1103/PhysRevLett.92.073602).
201+
* [Lambert et al., Phys. Rev. Lett. 92, 073602 (2004)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.92.073602).
202202

203203
```python
204204
def calulcate_entropy(M, N, g_vec):

tutorials-v4/lectures/Lecture-3B-Jaynes-Cumming-model-with-ultrastrong-coupling.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ The regime $g$ is large compared with all other energy scales in the Hamiltonian
5151

5252
References:
5353

54-
* [P. Nataf et al., Phys. Rev. Lett. 104, 023601 (2010)](http://dx.doi.org/10.1103/PhysRevLett.104.023601)
54+
* [P. Nataf et al., Phys. Rev. Lett. 104, 023601 (2010)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.104.023601)
5555

56-
* [J. Casanova et al., Phys. Rev. Lett. 105, 26360 (2010)](http://dx.doi.org/10.1103/PhysRevLett.105.263603).
56+
* [J. Casanova et al., Phys. Rev. Lett. 105, 26360 (2010)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.105.263603).
5757

58-
* [S. Ashhab et al., Phys. Rev. A 81, 042311 (2010)](http://dx.doi.org/10.1103/PhysRevA.81.042311)
58+
* [S. Ashhab et al., Phys. Rev. A 81, 042311 (2010)](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.81.042311)
5959
<!-- #endregion -->
6060

6161
<!-- #region -->

tutorials-v4/lectures/Lecture-4-Correlation-Functions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ $L(\tau) = 2\langle Q(\tau)Q(0)\rangle - \langle Q(2\tau)Q(0)\rangle \leq 1$
152152

153153
### References
154154

155-
* [A. J. Leggett and A. Garg, Phys. Rev. Lett. 54, 857 (1985)](http://dx.doi.org/10.1103/PhysRevLett.54.857)
155+
* [A. J. Leggett and A. Garg, Phys. Rev. Lett. 54, 857 (1985)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.54.857)
156156
* [A. J. Leggett, J. Phys. Condens. Matter 14, R415 (2002)](http://dx.doi.org/10.1088/0953-8984/14/15/201)
157157
<!-- #endregion -->
158158

@@ -186,7 +186,7 @@ def leggett_garg(c_mat):
186186

187187
References:
188188

189-
* [N. Lambert, J.R. Johansson, F. Nori, Phys. Rev. B 82, 245421 (2011)](http://dx.doi.org/10.1103/PhysRevB.84.245421).
189+
* [N. Lambert, J.R. Johansson, F. Nori, Phys. Rev. B 82, 245421 (2011)](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.84.245421).
190190
<!-- #endregion -->
191191

192192
```python

tutorials-v4/quantum-circuits/qip-toffoli-cnot.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ 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:
10-
display_name: Python 3 (ipykernel)
10+
display_name: qutip-dev
1111
language: python
1212
name: python3
1313
---
@@ -39,7 +39,7 @@ q.add_gate("TOFFOLI", controls=[0, 2], targets=[1])
3939
```
4040

4141
```python
42-
q.png
42+
q.draw()
4343
```
4444

4545
```python
@@ -53,7 +53,7 @@ q2 = q.resolve_gates()
5353
```
5454

5555
```python
56-
q2.png
56+
q2.draw()
5757
```
5858

5959
```python

tutorials-v4/quantum-circuits/quantum-gates.md

+27-27
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
@@ -63,7 +63,7 @@ cphase(pi / 2)
6363
```python
6464
q = QubitCircuit(2, reverse_states=False)
6565
q.add_gate("CSIGN", controls=[0], targets=[1])
66-
q.png
66+
q.draw()
6767
```
6868

6969
### Rotation about X-axis
@@ -74,8 +74,8 @@ rx(pi / 2)
7474

7575
```python
7676
q = QubitCircuit(1, reverse_states=False)
77-
q.add_gate("RX", targets=[0], arg_value=pi / 2, arg_label=r"\frac{\pi}{2}")
78-
q.png
77+
q.add_gate("RX", targets=[0], arg_value=pi / 2, style={"showarg": True})
78+
q.draw()
7979
```
8080

8181
### Rotation about Y-axis
@@ -86,8 +86,8 @@ ry(pi / 2)
8686

8787
```python
8888
q = QubitCircuit(1, reverse_states=False)
89-
q.add_gate("RY", targets=[0], arg_value=pi / 2, arg_label=r"\frac{\pi}{2}")
90-
q.png
89+
q.add_gate("RY", targets=[0], arg_value=pi / 2, style={"showarg": True})
90+
q.draw()
9191
```
9292

9393
### Rotation about Z-axis
@@ -98,8 +98,8 @@ rz(pi / 2)
9898

9999
```python
100100
q = QubitCircuit(1, reverse_states=False)
101-
q.add_gate("RZ", targets=[0], arg_value=pi / 2, arg_label=r"\frac{\pi}{2}")
102-
q.png
101+
q.add_gate("RZ", targets=[0], arg_value=pi / 2, style={"showarg": True})
102+
q.draw()
103103
```
104104

105105
### CNOT
@@ -111,7 +111,7 @@ cnot()
111111
```python
112112
q = QubitCircuit(2, reverse_states=False)
113113
q.add_gate("CNOT", controls=[0], targets=[1])
114-
q.png
114+
q.draw()
115115
```
116116

117117
### CSIGN
@@ -123,7 +123,7 @@ csign()
123123
```python
124124
q = QubitCircuit(2, reverse_states=False)
125125
q.add_gate("CSIGN", controls=[0], targets=[1])
126-
q.png
126+
q.draw()
127127
```
128128

129129
### Berkeley
@@ -135,7 +135,7 @@ berkeley()
135135
```python
136136
q = QubitCircuit(2, reverse_states=False)
137137
q.add_gate("BERKELEY", targets=[0, 1])
138-
q.png
138+
q.draw()
139139
```
140140

141141
### SWAPalpha
@@ -162,7 +162,7 @@ toffoli()
162162
swap()
163163
q = QubitCircuit(2, reverse_states=False)
164164
q.add_gate("SWAP", targets=[0, 1])
165-
q.png
165+
q.draw()
166166
```
167167

168168
### ISWAP
@@ -171,7 +171,7 @@ q.png
171171
iswap()
172172
q = QubitCircuit(2, reverse_states=False)
173173
q.add_gate("ISWAP", targets=[0, 1])
174-
q.png
174+
q.draw()
175175
```
176176

177177
### SQRTiSWAP
@@ -234,7 +234,7 @@ cnot(N=3)
234234
```python
235235
q = QubitCircuit(3, reverse_states=False)
236236
q.add_gate("CNOT", controls=[1], targets=[2])
237-
q.png
237+
q.draw()
238238
```
239239

240240
Furthermore, the control and target qubits (when applicable) can also be similarly specified using keyword arguments `control` and `target` (or in some cases `controls` or `targets`):
@@ -246,7 +246,7 @@ cnot(N=3, control=2, target=0)
246246
```python
247247
q = QubitCircuit(3, reverse_states=False)
248248
q.add_gate("CNOT", controls=[0], targets=[2])
249-
q.png
249+
q.draw()
250250
```
251251

252252
## Setup of a Qubit Circuit
@@ -261,7 +261,7 @@ In the following example, we take a SWAP gate. It is known that a swap gate is e
261261
N = 2
262262
qc0 = QubitCircuit(N)
263263
qc0.add_gate("ISWAP", [0, 1], None)
264-
qc0.png
264+
qc0.draw()
265265
```
266266

267267
```python
@@ -275,7 +275,7 @@ qc1 = QubitCircuit(N)
275275
qc1.add_gate("CNOT", 0, 1)
276276
qc1.add_gate("CNOT", 1, 0)
277277
qc1.add_gate("CNOT", 0, 1)
278-
qc1.png
278+
qc1.draw()
279279
```
280280

281281
```python
@@ -288,7 +288,7 @@ In place of manually converting the SWAP gate to CNOTs, it can be automatically
288288

289289
```python
290290
qc2 = qc0.resolve_gates("CNOT")
291-
qc2.png
291+
qc2.draw()
292292
```
293293

294294
```python
@@ -301,7 +301,7 @@ From QuTiP 4.4, we can also add gate at arbitrary position in a circuit.
301301

302302
```python
303303
qc1.add_gate("CSIGN", index=[1], targets=[0], controls=[1])
304-
qc1.png
304+
qc1.draw()
305305
```
306306

307307
## Example of basis transformation
@@ -313,7 +313,7 @@ qc3.add_gate("RX", 0, None, pi / 2, r"\pi/2")
313313
qc3.add_gate("RY", 1, None, pi / 2, r"\pi/2")
314314
qc3.add_gate("RZ", 2, None, pi / 2, r"\pi/2")
315315
qc3.add_gate("ISWAP", [1, 2])
316-
qc3.png
316+
qc3.draw()
317317
```
318318

319319
```python
@@ -325,7 +325,7 @@ U3
325325

326326
```python
327327
qc4 = qc3.resolve_gates("CNOT")
328-
qc4.png
328+
qc4.draw()
329329
```
330330

331331
```python
@@ -335,7 +335,7 @@ U4
335335

336336
```python
337337
qc5 = qc3.resolve_gates("ISWAP")
338-
qc5.png
338+
qc5.draw()
339339
```
340340

341341
```python
@@ -347,7 +347,7 @@ U5
347347

348348
```python
349349
qc6 = qc3.resolve_gates(["ISWAP", "RX", "RY"])
350-
qc6.png
350+
qc6.draw()
351351
```
352352

353353
```python
@@ -357,7 +357,7 @@ U6
357357

358358
```python
359359
qc7 = qc3.resolve_gates(["CNOT", "RZ", "RX"])
360-
qc7.png
360+
qc7.draw()
361361
```
362362

363363
```python
@@ -373,7 +373,7 @@ Interactions between non-adjacent qubits can be resolved by QubitCircuit to a se
373373
```python
374374
qc8 = QubitCircuit(3)
375375
qc8.add_gate("CNOT", 2, 0)
376-
qc8.png
376+
qc8.draw()
377377
```
378378

379379
```python
@@ -393,7 +393,7 @@ U9
393393

394394
```python
395395
qc10 = qc9.resolve_gates("CNOT")
396-
qc10.png
396+
qc10.draw()
397397
```
398398

399399
```python
@@ -418,7 +418,7 @@ From QuTiP 4.4 on, user defined gates can be defined by a python function that t
418418
```python
419419
def user_gate1(arg_value):
420420
# controlled rotation X
421-
mat = np.zeros((4, 4), dtype=np.complex)
421+
mat = np.zeros((4, 4), dtype=complex)
422422
mat[0, 0] = mat[1, 1] = 1.0
423423
mat[2:4, 2:4] = rx(arg_value)
424424
return Qobj(mat, dims=[[2, 2], [2, 2]])

tutorials-v4/time-evolution/002_larmor-precession.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Author: C. Staufenbiel, 2022
2121
This notebook guides you through the process of setting up a Schrödinger
2222
equation in QuTiP and using the corresponding solver to obtain the time
2323
evolution. We will investigate the example of the Larmor precession to
24-
explore the functionality of [`qutip.sesolve()`](https://qutip.readthedocs.io/en/latest/apidoc/functions.html?highlight=sesolve#module-qutip.sesolve).
24+
explore the functionality of [`qutip.sesolve()`](https://qutip.readthedocs.io/en/latest/apidoc/solver.html#module-qutip.solver.sesolve).
2525

2626
You can also find more on time evolutions with QuTiP [here](https://qutip.readthedocs.io/en/latest/guide/guide-dynamics.html).
2727

@@ -85,7 +85,7 @@ b.show()
8585

8686
## Simulation with varying magnetic field
8787

88-
Above we passed a constant Hamiltonian to `sesolve`. In QuTiP these constant operators are represented by `Qobj`. However, `sesolve` can also take time-dependent operators as an argument, which are represented by [`QobjEvo`](https://qutip.readthedocs.io/en/latest/apidoc/classes.html?highlight=qobjevo#qutip.QobjEvo) in QuTiP. In this section we define the magnetic field with a linear and a periodic field strength, and observe the changes in the expecation value of $\sigma_y$.
88+
Above we passed a constant Hamiltonian to `sesolve`. In QuTiP these constant operators are represented by `Qobj`. However, `sesolve` can also take time-dependent operators as an argument, which are represented by [`QobjEvo`](https://qutip.readthedocs.io/en/latest/apidoc/time_dep.html#qutip.core.cy.qobjevo.QobjEvo) in QuTiP. In this section we define the magnetic field with a linear and a periodic field strength, and observe the changes in the expecation value of $\sigma_y$.
8989
You can find more information on `QobjEvo` in [this notebook](https://nbviewer.jupyter.org/github/qutip/qutip-notebooks/blob/master/examples/qobjevo.ipynb).
9090

9191
We start by defining two functions for the field strength of the magnetic field. To be passed on to `QobjEvo` the functions need two arguments: the times and optional arguments.

tutorials-v4/time-evolution/003_qubit-dynamics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Modified by: C. Staufebiel (2022)
2121
### Introduction
2222
In this notebook we will explore the dynamics of a single-qubit interacting with an environment. The evolution of the qubit state is governed by the Master equation. We will make use of the master equation solver `qutip.mesolve` implemented in qutip, to obtain the time-evolution of the qubit for different settings.
2323

24-
You can read more about the master equation solver (and the theory behind it) in the [QuTiP docs](https://qutip.readthedocs.io/en/latest/apidoc/functions.html?highlight=sesolve#module-qutip.sesolve).
24+
You can read more about the master equation solver (and the theory behind it) in the [QuTiP docs](https://qutip.readthedocs.io/en/latest/apidoc/time_dep.html#qutip.core.cy.qobjevo.QobjEvo).
2525

2626
### Import
2727
Here we import the required modules for this example.

tutorials-v5/heom/heom-5b-fermions-discrete-boson-model.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ kernelspec:
2020

2121
Here we model a single fermion coupled to two electronic leads or reservoirs (e.g., this can describe a single quantum dot, a molecular transistor, etc), also coupled to a discrete bosonic (vibronic) mode.
2222

23-
Note that in this implementation we primarily follow the definitions used by Christian Schinabeck in his Dissertation https://opus4.kobv.de/opus4-fau/files/10984/DissertationChristianSchinabeck.pdf and related publications. In particular this example reproduces some results from https://journals.aps.org/prb/abstract/10.1103/PhysRevB.94.201407
23+
Note that in this implementation we primarily follow the definitions used by Christian Schinabeck in his Dissertation https://open.fau.de/items/36fdd708-a467-4b59-bf4e-4a2110fbc431 and related publications. In particular this example reproduces some results from https://journals.aps.org/prb/abstract/10.1103/PhysRevB.94.201407
2424

2525
Notation:
2626

tutorials-v5/lectures/Lecture-11-Charge-Qubits.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ where $E_C$ is the charge energy, $E_J$ is the Josephson energy, and $\left| n\r
3939

4040
#### References
4141

42-
* [J. Koch et al, Phys. Rec. A 76, 042319 (2007)](http://link.aps.org/doi/10.1103/PhysRevA.76.042319)
42+
* [J. Koch et al, Phys. Rec. A 76, 042319 (2007)](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.76.042319)
4343
* [Y.A. Pashkin et al, Quantum Inf Process 8, 55 (2009)](http://dx.doi.org/10.1007/s11128-009-0101-5)
4444

4545

tutorials-v5/lectures/Lecture-2B-Single-Atom-Lasing.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ in units where $\hbar = 1$.
6363

6464
References:
6565

66-
* [Yi Mu, C.M. Savage, Phys. Rev. A 46, 5944 (1992)](http://dx.doi.org/10.1103/PhysRevA.46.5944)
66+
* [Yi Mu, C.M. Savage, Phys. Rev. A 46, 5944 (1992)](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.46.5944)
6767

68-
* [D.A. Rodrigues, J. Imbers, A.D. Armour, Phys. Rev. Lett. 98, 067204 (2007)](http://dx.doi.org/10.1103/PhysRevLett.98.067204)
68+
* [D.A. Rodrigues, J. Imbers, A.D. Armour, Phys. Rev. Lett. 98, 067204 (2007)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.98.067204)
6969

7070
* [S. Ashhab, J.R. Johansson, A.M. Zagoskin, F. Nori, New J. Phys. 11, 023030 (2009)](http://dx.doi.org/10.1088/1367-2630/11/2/023030)
7171

tutorials-v5/lectures/Lecture-3A-Dicke-model.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ $\displaystyle J_\pm = \sum_{i=1}^N \sigma_\pm^{(i)}$
4949

5050
### References
5151

52-
* [R.H. Dicke, Phys. Rev. 93, 99–110 (1954)](http://dx.doi.org/10.1103/PhysRev.93.99)
52+
* [R.H. Dicke, Phys. Rev. 93, 99–110 (1954)](https://journals.aps.org/pr/abstract/10.1103/PhysRev.93.99)
5353

5454

5555
## Setup problem in QuTiP
@@ -198,7 +198,7 @@ fig.tight_layout()
198198

199199
### References
200200

201-
* [Lambert et al., Phys. Rev. Lett. 92, 073602 (2004)](http://dx.doi.org/10.1103/PhysRevLett.92.073602).
201+
* [Lambert et al., Phys. Rev. Lett. 92, 073602 (2004)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.92.073602).
202202

203203
```python
204204
def calulcate_entropy(M, N, g_vec):

0 commit comments

Comments
 (0)