From f4c057f2a3e162da3392dc02cfc99c08a301e252 Mon Sep 17 00:00:00 2001 From: gadhvirushiraj Date: Thu, 22 Aug 2024 11:04:40 +0530 Subject: [PATCH 01/11] added tutorial for MatRenderer --- .../quantum-circuits/matrenderer-circuit.md | 228 ++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 tutorials-v5/quantum-circuits/matrenderer-circuit.md diff --git a/tutorials-v5/quantum-circuits/matrenderer-circuit.md b/tutorials-v5/quantum-circuits/matrenderer-circuit.md new file mode 100644 index 00000000..8ea9efbc --- /dev/null +++ b/tutorials-v5/quantum-circuits/matrenderer-circuit.md @@ -0,0 +1,228 @@ +--- +jupyter: + jupytext: + text_representation: + extension: .md + format_name: markdown + format_version: '1.3' + jupytext_version: 1.13.8 + kernelspec: + display_name: qutip-dev + language: python + name: python3 +--- + +# Plotting and Customizing Quantum Circuits using MatRenderer +Author: Rushiraj Gadhvi (gadhvirushiraj@gmail.com) + +This notebook serves as a comprehensive guide to plotting quantum circuits using QuTiP-QIP's MatRenderer, a Matplotlib-based rendering tool. It explores the various customization options available to users for creating and modifying plots. The content is organized into two main sections: + +- **Circuit-Level Customization** +- **Gate-Level Customization** + +```python +import numpy as np +from qutip_qip.circuit import QubitCircuit +``` + +```python +qc = QubitCircuit(2, num_cbits=1) +qc.add_gate("CNOT", controls=0, targets=1) +qc.add_gate("SNOT", targets=1) +qc.add_gate("ISWAP", targets=[0, 1]) +qc.add_measurement("M0", targets=1, classical_store=0) +``` + +```python +qc.draw() +``` + +--- +### Circuit Level Customization Options +--- + + +##### Changing FontSize + +```python +qc.draw(fontsize=13) +``` + +##### Background Color + +```python +qc.draw(bgcolor="gray") +``` + +##### Gate Bulge Control + +```python +qc.draw(bulge=False) +``` + +##### Custom Wire Labels + +```python +qc.draw(wire_label=["some_name", "some_long_name", "long_long_name"]) +``` + +##### Control extra wire extension at end of circuit + +```python +qc.draw(end_wire_ext=0) +``` + +```python +qc.draw(end_wire_ext=5) +``` + +##### Condense Circuit + +```python +qc.draw(gate_margin=0.1) +``` + +##### Adding Title + +```python +qc.draw(title="QuTiP") +``` + +##### Changing Theme + +```python +qc.draw(theme="light") +``` + +```python +qc.draw(theme="dark", title="QuTiP") +``` + +```python +qc.draw(theme="modern") +``` + +##### Aligning Layer + +```python +qc = QubitCircuit(3) +qc.add_gate("H", targets=[1]) +qc.add_gate("RZ", targets=[2], arg_value=0.5, style={"showarg": True}) +qc.add_gate("RZ", targets=[2], arg_value=0.5, style={"showarg": True}) +qc.add_1q_gate("RX") +qc.add_gate("CNOT", controls=[0], targets=[1], style={"showarg": True}) +qc.add_gate("CNOT", controls=[0], targets=[1], style={"showarg": True}) +qc.add_gate("SWAP", targets=[0, 2]) +``` + +```python +# not-aligned gates +qc.draw(theme="modern") +``` + +```python +# aligned gates +qc.draw(align_layer=True, theme="modern") +``` + +--- +### Gate Level Customization Options +--- + +```python +qc = QubitCircuit(7) +qc.add_gate("H", targets=[0], style={"fontcolor": "red"}) +qc.add_gate("H", targets=[1], style={"fontstyle": "italic"}) +qc.add_gate("H", targets=[2], style={"fontweight": "bold"}) +qc.add_gate("H", targets=[3], style={"color": "green"}) +qc.add_gate("H", targets=[4], style={"fontsize": 12}) +qc.add_gate("H", targets=[5], style={"text": "hadamard gate"}) +qc.add_gate("H", targets=[6], style={"text": "hadamard gate", "fontfamily": "cursive"}) +``` + +```python +qc.draw() +``` + +##### Rendering Argument Value + +```python +qc = QubitCircuit(3) +qc.add_gate("RX", targets=[0], arg_value=np.pi / 12, style={"showarg": True}) +qc.add_gate("RY", targets=[1], arg_value=2 * np.pi / 3, style={"showarg": True}) +qc.add_gate("RY", targets=[2], arg_value=0.3, style={"showarg": True}) +qc.draw() +``` + +#### With User Custom Gates + +```python +from qutip import Qobj +from qutip_qip.operations import rx +``` + +```python +def user_gate1(arg_value): + # controlled rotation X + mat = np.zeros((4, 4), dtype=np.complex) + mat[0, 0] = mat[1, 1] = 1.0 + mat[2:4, 2:4] = rx(arg_value).full() + return Qobj(mat, dims=[[2, 2], [2, 2]]) + + +def user_gate2(): + # S gate + mat = np.array([[1.0, 0], [0.0, 1.0j]]) + return Qobj(mat, dims=[[2], [2]]) +``` + +```python +qc = QubitCircuit(3) +qc.user_gates = {"CTRLRX": user_gate1, "S": user_gate2} + +# qubit 1 controls qubit 0 +qc.add_gate("CTRLRX", targets=[1, 0], arg_value=np.pi / 2) +# qubit 2 is target of S gate +qc.add_gate("S", targets=[2]) +``` + +```python +qc.draw() +``` + + --- +### Some more circuit examples +--- + +```python +trotter_simulation_noisey = QubitCircuit(4) + +trotter_simulation_noisey.add_gate("RZ", targets=[0]) +trotter_simulation_noisey.add_gate("RZ", targets=[1]) + +trotter_simulation_noisey.add_gate("CNOT", controls=0, targets=1) +trotter_simulation_noisey.add_gate("RX", targets=[0]) +trotter_simulation_noisey.add_gate("CNOT", controls=0, targets=1) + +trotter_simulation_noisey.add_gate("CNOT", controls=0, targets=2) +trotter_simulation_noisey.add_gate("RX", targets=[0]) +trotter_simulation_noisey.add_gate("CNOT", controls=0, targets=2) + +trotter_simulation_noisey.add_gate("RZ", targets=[2], arg_value=-np.pi / 2) +trotter_simulation_noisey.add_gate("CNOT", controls=0, targets=2) +trotter_simulation_noisey.add_gate("RY", targets=[0]) +trotter_simulation_noisey.add_gate("CNOT", controls=0, targets=2) +trotter_simulation_noisey.add_gate("RZ", targets=[2], arg_value=np.pi / 2) + +trotter_simulation_noisey.add_gate("CNOT", controls=1, targets=3) +trotter_simulation_noisey.add_gate("RX", targets=[1]) +trotter_simulation_noisey.add_gate("CNOT", controls=1, targets=3) + +trotter_simulation_noisey.add_gate("RZ", targets=[3], arg_value=-np.pi / 2) +trotter_simulation_noisey.add_gate("CNOT", controls=1, targets=3) +trotter_simulation_noisey.add_gate("RY", targets=[1]) +trotter_simulation_noisey.add_gate("CNOT", controls=1, targets=3) +trotter_simulation_noisey.add_gate("RZ", targets=[3], arg_value=np.pi / 2) + +trotter_simulation_noisey.draw(theme="dark", title="Trotter Simulation") +``` From e950ab756c60508bc1acb015b7ebdd07e2461bb0 Mon Sep 17 00:00:00 2001 From: gadhvirushiraj Date: Thu, 22 Aug 2024 11:07:30 +0530 Subject: [PATCH 02/11] file name change --- .../{matrenderer-circuit.md => matrenderer-plot.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tutorials-v5/quantum-circuits/{matrenderer-circuit.md => matrenderer-plot.md} (100%) diff --git a/tutorials-v5/quantum-circuits/matrenderer-circuit.md b/tutorials-v5/quantum-circuits/matrenderer-plot.md similarity index 100% rename from tutorials-v5/quantum-circuits/matrenderer-circuit.md rename to tutorials-v5/quantum-circuits/matrenderer-plot.md From 867d819b45dbf47a92f7b648bd988110adc801c1 Mon Sep 17 00:00:00 2001 From: gadhvirushiraj Date: Thu, 22 Aug 2024 11:31:09 +0530 Subject: [PATCH 03/11] added textrenderer --- .../quantum-circuits/textrenderer-plot.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 tutorials-v5/quantum-circuits/textrenderer-plot.md diff --git a/tutorials-v5/quantum-circuits/textrenderer-plot.md b/tutorials-v5/quantum-circuits/textrenderer-plot.md new file mode 100644 index 00000000..ed8fcdd7 --- /dev/null +++ b/tutorials-v5/quantum-circuits/textrenderer-plot.md @@ -0,0 +1,115 @@ +--- +jupyter: + jupytext: + text_representation: + extension: .md + format_name: markdown + format_version: '1.3' + jupytext_version: 1.13.8 + kernelspec: + display_name: qutip-dev + language: python + name: python3 +--- + +# Plotting and Customizing Quantum Circuits using TextRenderer +Author: Rushiraj Gadhvi (gadhvirushiraj@gmail.com) + +This notebook serves as a comprehensive guide to plotting quantum circuits using QuTiP-QIP's TextRenderer. It explores the various customization options available to users for creating and modifying plots. + +- **Circuit-Level Customization** +- **Gate-Level Customization** + +```python +import numpy as np +from qutip_qip.circuit import QubitCircuit +``` + +```python +qc = QubitCircuit(2, num_cbits=1) +qc.add_gate("CNOT", controls=0, targets=1) +qc.add_gate("SNOT", targets=1) +qc.add_gate("ISWAP", targets=[0, 1]) +qc.add_measurement("M0", targets=1, classical_store=0) +``` + +```python +qc.draw("text") +``` + +--- +### Circuit Level Customization Options +--- + + +##### Custom Wire Labels + +```python +qc.draw("text", wire_label=["some_name", "some_long_name", "long_long_name"]) +``` + +##### Control extra wire extension at end of circuit + +```python +qc.draw("text", end_wire_ext=0) +``` + +```python +qc.draw("text", end_wire_ext=5) +``` + +##### Adjust Gate Padding + +```python +qc.draw("text", gate_pad=3) +``` + +--- +### Gate Level Customization Options +--- + +```python +qc = QubitCircuit(2) +qc.add_gate("H", targets=[0]) +qc.add_gate("H", targets=[1], arg_label="hadamard gate") +``` + +```python +qc.draw("text") +``` + +#### With User Custom Gates + +```python +from qutip import Qobj +from qutip_qip.operations import rx +``` + +```python +def user_gate1(arg_value): + # controlled rotation X + mat = np.zeros((4, 4), dtype=np.complex) + mat[0, 0] = mat[1, 1] = 1.0 + mat[2:4, 2:4] = rx(arg_value).full() + return Qobj(mat, dims=[[2, 2], [2, 2]]) + + +def user_gate2(): + # S gate + mat = np.array([[1.0, 0], [0.0, 1.0j]]) + return Qobj(mat, dims=[[2], [2]]) +``` + +```python +qc = QubitCircuit(3) +qc.user_gates = {"CTRLRX": user_gate1, "S": user_gate2} + +# qubit 1 controls qubit 0 +qc.add_gate("CTRLRX", targets=[1, 0], arg_value=np.pi / 2) +# qubit 2 is target of S gate +qc.add_gate("S", targets=[2]) +``` + +```python +qc.draw("text") +``` From 09b515ef00ee2ed2a67c9e92798001181ab4c425 Mon Sep 17 00:00:00 2001 From: gadhvirushiraj Date: Thu, 22 Aug 2024 11:33:37 +0530 Subject: [PATCH 04/11] edit matrenderer --- .../quantum-circuits/matrenderer-plot.md | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/tutorials-v5/quantum-circuits/matrenderer-plot.md b/tutorials-v5/quantum-circuits/matrenderer-plot.md index 8ea9efbc..85905139 100644 --- a/tutorials-v5/quantum-circuits/matrenderer-plot.md +++ b/tutorials-v5/quantum-circuits/matrenderer-plot.md @@ -4,7 +4,7 @@ jupyter: text_representation: extension: .md format_name: markdown - format_version: '1.3' + format_version: "1.3" jupytext_version: 1.13.8 kernelspec: display_name: qutip-dev @@ -13,6 +13,7 @@ jupyter: --- # Plotting and Customizing Quantum Circuits using MatRenderer + Author: Rushiraj Gadhvi (gadhvirushiraj@gmail.com) This notebook serves as a comprehensive guide to plotting quantum circuits using QuTiP-QIP's MatRenderer, a Matplotlib-based rendering tool. It explores the various customization options available to users for creating and modifying plots. The content is organized into two main sections: @@ -38,9 +39,10 @@ qc.draw() ``` --- + ### Circuit Level Customization Options ---- +--- ##### Changing FontSize @@ -102,7 +104,7 @@ qc.draw(theme="dark", title="QuTiP") qc.draw(theme="modern") ``` -##### Aligning Layer +##### Aligning Layer ```python qc = QubitCircuit(3) @@ -126,7 +128,9 @@ qc.draw(align_layer=True, theme="modern") ``` --- + ### Gate Level Customization Options + --- ```python @@ -136,15 +140,15 @@ qc.add_gate("H", targets=[1], style={"fontstyle": "italic"}) qc.add_gate("H", targets=[2], style={"fontweight": "bold"}) qc.add_gate("H", targets=[3], style={"color": "green"}) qc.add_gate("H", targets=[4], style={"fontsize": 12}) -qc.add_gate("H", targets=[5], style={"text": "hadamard gate"}) -qc.add_gate("H", targets=[6], style={"text": "hadamard gate", "fontfamily": "cursive"}) +qc.add_gate("H", targets=[5], arg_label="hadamard gate") +qc.add_gate("H", targets=[6], style={"fontfamily": "cursive"}) ``` ```python qc.draw() ``` -##### Rendering Argument Value +##### Rendering Argument Value ```python qc = QubitCircuit(3) @@ -190,8 +194,10 @@ qc.add_gate("S", targets=[2]) qc.draw() ``` - --- +--- + ### Some more circuit examples + --- ```python From 0869d94c713a6990129e01d313adcec486778490 Mon Sep 17 00:00:00 2001 From: gadhvirushiraj Date: Wed, 25 Sep 2024 17:22:59 +0530 Subject: [PATCH 05/11] added qutip.about --- tutorials-v5/quantum-circuits/matrenderer-plot.md | 12 +++++++++--- tutorials-v5/quantum-circuits/textrenderer-plot.md | 9 ++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/tutorials-v5/quantum-circuits/matrenderer-plot.md b/tutorials-v5/quantum-circuits/matrenderer-plot.md index 85905139..4f323cff 100644 --- a/tutorials-v5/quantum-circuits/matrenderer-plot.md +++ b/tutorials-v5/quantum-circuits/matrenderer-plot.md @@ -4,8 +4,8 @@ jupyter: text_representation: extension: .md format_name: markdown - format_version: "1.3" - jupytext_version: 1.13.8 + format_version: '1.3' + jupytext_version: 1.16.4 kernelspec: display_name: qutip-dev language: python @@ -22,6 +22,7 @@ This notebook serves as a comprehensive guide to plotting quantum circuits using - **Gate-Level Customization** ```python +import qutip import numpy as np from qutip_qip.circuit import QubitCircuit ``` @@ -111,7 +112,6 @@ qc = QubitCircuit(3) qc.add_gate("H", targets=[1]) qc.add_gate("RZ", targets=[2], arg_value=0.5, style={"showarg": True}) qc.add_gate("RZ", targets=[2], arg_value=0.5, style={"showarg": True}) -qc.add_1q_gate("RX") qc.add_gate("CNOT", controls=[0], targets=[1], style={"showarg": True}) qc.add_gate("CNOT", controls=[0], targets=[1], style={"showarg": True}) qc.add_gate("SWAP", targets=[0, 2]) @@ -232,3 +232,9 @@ trotter_simulation_noisey.add_gate("RZ", targets=[3], arg_value=np.pi / 2) trotter_simulation_noisey.draw(theme="dark", title="Trotter Simulation") ``` + +--- + +```python +qutip.about() +``` diff --git a/tutorials-v5/quantum-circuits/textrenderer-plot.md b/tutorials-v5/quantum-circuits/textrenderer-plot.md index ed8fcdd7..d029bd01 100644 --- a/tutorials-v5/quantum-circuits/textrenderer-plot.md +++ b/tutorials-v5/quantum-circuits/textrenderer-plot.md @@ -5,7 +5,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.3' - jupytext_version: 1.13.8 + jupytext_version: 1.16.4 kernelspec: display_name: qutip-dev language: python @@ -21,6 +21,7 @@ This notebook serves as a comprehensive guide to plotting quantum circuits using - **Gate-Level Customization** ```python +import qutip import numpy as np from qutip_qip.circuit import QubitCircuit ``` @@ -113,3 +114,9 @@ qc.add_gate("S", targets=[2]) ```python qc.draw("text") ``` + +--- + +```python +qutip.about() +``` From 687ef46bbfd106545c4a577151260806abd854a4 Mon Sep 17 00:00:00 2001 From: gadhvirushiraj Date: Wed, 9 Oct 2024 17:07:39 +0530 Subject: [PATCH 06/11] replaced dead links --- tutorials-v4/lectures/Lecture-11-Charge-Qubits.md | 2 +- tutorials-v4/lectures/Lecture-2B-Single-Atom-Lasing.md | 4 ++-- tutorials-v4/lectures/Lecture-3A-Dicke-model.md | 4 ++-- ...ure-3B-Jaynes-Cumming-model-with-ultrastrong-coupling.md | 6 +++--- tutorials-v4/lectures/Lecture-4-Correlation-Functions.md | 4 ++-- tutorials-v5/lectures/Lecture-11-Charge-Qubits.md | 2 +- tutorials-v5/lectures/Lecture-2B-Single-Atom-Lasing.md | 4 ++-- tutorials-v5/lectures/Lecture-3A-Dicke-model.md | 4 ++-- ...ure-3B-Jaynes-Cumming-model-with-ultrastrong-coupling.md | 6 +++--- tutorials-v5/lectures/Lecture-4-Correlation-Functions.md | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tutorials-v4/lectures/Lecture-11-Charge-Qubits.md b/tutorials-v4/lectures/Lecture-11-Charge-Qubits.md index dbc8e279..70ed1617 100644 --- a/tutorials-v4/lectures/Lecture-11-Charge-Qubits.md +++ b/tutorials-v4/lectures/Lecture-11-Charge-Qubits.md @@ -39,7 +39,7 @@ where $E_C$ is the charge energy, $E_J$ is the Josephson energy, and $\left| n\r #### References - * [J. Koch et al, Phys. Rec. A 76, 042319 (2007)](http://link.aps.org/doi/10.1103/PhysRevA.76.042319) + * [J. Koch et al, Phys. Rec. A 76, 042319 (2007)](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.76.042319) * [Y.A. Pashkin et al, Quantum Inf Process 8, 55 (2009)](http://dx.doi.org/10.1007/s11128-009-0101-5) diff --git a/tutorials-v4/lectures/Lecture-2B-Single-Atom-Lasing.md b/tutorials-v4/lectures/Lecture-2B-Single-Atom-Lasing.md index ed5be292..f9efd6ee 100644 --- a/tutorials-v4/lectures/Lecture-2B-Single-Atom-Lasing.md +++ b/tutorials-v4/lectures/Lecture-2B-Single-Atom-Lasing.md @@ -63,9 +63,9 @@ in units where $\hbar = 1$. References: - * [Yi Mu, C.M. Savage, Phys. Rev. A 46, 5944 (1992)](http://dx.doi.org/10.1103/PhysRevA.46.5944) + * [Yi Mu, C.M. Savage, Phys. Rev. A 46, 5944 (1992)](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.46.5944) - * [D.A. Rodrigues, J. Imbers, A.D. Armour, Phys. Rev. Lett. 98, 067204 (2007)](http://dx.doi.org/10.1103/PhysRevLett.98.067204) + * [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) * [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) diff --git a/tutorials-v4/lectures/Lecture-3A-Dicke-model.md b/tutorials-v4/lectures/Lecture-3A-Dicke-model.md index cdee9f4b..3aaae2ab 100644 --- a/tutorials-v4/lectures/Lecture-3A-Dicke-model.md +++ b/tutorials-v4/lectures/Lecture-3A-Dicke-model.md @@ -49,7 +49,7 @@ $\displaystyle J_\pm = \sum_{i=1}^N \sigma_\pm^{(i)}$ ### References - * [R.H. Dicke, Phys. Rev. 93, 99–110 (1954)](http://dx.doi.org/10.1103/PhysRev.93.99) + * [R.H. Dicke, Phys. Rev. 93, 99–110 (1954)](https://journals.aps.org/pr/abstract/10.1103/PhysRev.93.99) ## Setup problem in QuTiP @@ -198,7 +198,7 @@ fig.tight_layout() ### References -* [Lambert et al., Phys. Rev. Lett. 92, 073602 (2004)](http://dx.doi.org/10.1103/PhysRevLett.92.073602). +* [Lambert et al., Phys. Rev. Lett. 92, 073602 (2004)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.92.073602). ```python def calulcate_entropy(M, N, g_vec): diff --git a/tutorials-v4/lectures/Lecture-3B-Jaynes-Cumming-model-with-ultrastrong-coupling.md b/tutorials-v4/lectures/Lecture-3B-Jaynes-Cumming-model-with-ultrastrong-coupling.md index 37d822b6..cce8fc10 100644 --- a/tutorials-v4/lectures/Lecture-3B-Jaynes-Cumming-model-with-ultrastrong-coupling.md +++ b/tutorials-v4/lectures/Lecture-3B-Jaynes-Cumming-model-with-ultrastrong-coupling.md @@ -51,11 +51,11 @@ The regime $g$ is large compared with all other energy scales in the Hamiltonian References: - * [P. Nataf et al., Phys. Rev. Lett. 104, 023601 (2010)](http://dx.doi.org/10.1103/PhysRevLett.104.023601) + * [P. Nataf et al., Phys. Rev. Lett. 104, 023601 (2010)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.104.023601) - * [J. Casanova et al., Phys. Rev. Lett. 105, 26360 (2010)](http://dx.doi.org/10.1103/PhysRevLett.105.263603). + * [J. Casanova et al., Phys. Rev. Lett. 105, 26360 (2010)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.105.263603). - * [S. Ashhab et al., Phys. Rev. A 81, 042311 (2010)](http://dx.doi.org/10.1103/PhysRevA.81.042311) + * [S. Ashhab et al., Phys. Rev. A 81, 042311 (2010)](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.81.042311) diff --git a/tutorials-v4/lectures/Lecture-4-Correlation-Functions.md b/tutorials-v4/lectures/Lecture-4-Correlation-Functions.md index 64313244..fb585463 100644 --- a/tutorials-v4/lectures/Lecture-4-Correlation-Functions.md +++ b/tutorials-v4/lectures/Lecture-4-Correlation-Functions.md @@ -152,7 +152,7 @@ $L(\tau) = 2\langle Q(\tau)Q(0)\rangle - \langle Q(2\tau)Q(0)\rangle \leq 1$ ### References -* [A. J. Leggett and A. Garg, Phys. Rev. Lett. 54, 857 (1985)](http://dx.doi.org/10.1103/PhysRevLett.54.857) +* [A. J. Leggett and A. Garg, Phys. Rev. Lett. 54, 857 (1985)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.54.857) * [A. J. Leggett, J. Phys. Condens. Matter 14, R415 (2002)](http://dx.doi.org/10.1088/0953-8984/14/15/201) @@ -186,7 +186,7 @@ def leggett_garg(c_mat): References: - * [N. Lambert, J.R. Johansson, F. Nori, Phys. Rev. B 82, 245421 (2011)](http://dx.doi.org/10.1103/PhysRevB.84.245421). + * [N. Lambert, J.R. Johansson, F. Nori, Phys. Rev. B 82, 245421 (2011)](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.84.245421). ```python diff --git a/tutorials-v5/lectures/Lecture-11-Charge-Qubits.md b/tutorials-v5/lectures/Lecture-11-Charge-Qubits.md index 3bda7b24..8d3017cd 100644 --- a/tutorials-v5/lectures/Lecture-11-Charge-Qubits.md +++ b/tutorials-v5/lectures/Lecture-11-Charge-Qubits.md @@ -39,7 +39,7 @@ where $E_C$ is the charge energy, $E_J$ is the Josephson energy, and $\left| n\r #### References - * [J. Koch et al, Phys. Rec. A 76, 042319 (2007)](http://link.aps.org/doi/10.1103/PhysRevA.76.042319) + * [J. Koch et al, Phys. Rec. A 76, 042319 (2007)](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.76.042319) * [Y.A. Pashkin et al, Quantum Inf Process 8, 55 (2009)](http://dx.doi.org/10.1007/s11128-009-0101-5) diff --git a/tutorials-v5/lectures/Lecture-2B-Single-Atom-Lasing.md b/tutorials-v5/lectures/Lecture-2B-Single-Atom-Lasing.md index fe501904..56191917 100644 --- a/tutorials-v5/lectures/Lecture-2B-Single-Atom-Lasing.md +++ b/tutorials-v5/lectures/Lecture-2B-Single-Atom-Lasing.md @@ -63,9 +63,9 @@ in units where $\hbar = 1$. References: - * [Yi Mu, C.M. Savage, Phys. Rev. A 46, 5944 (1992)](http://dx.doi.org/10.1103/PhysRevA.46.5944) + * [Yi Mu, C.M. Savage, Phys. Rev. A 46, 5944 (1992)](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.46.5944) - * [D.A. Rodrigues, J. Imbers, A.D. Armour, Phys. Rev. Lett. 98, 067204 (2007)](http://dx.doi.org/10.1103/PhysRevLett.98.067204) + * [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) * [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) diff --git a/tutorials-v5/lectures/Lecture-3A-Dicke-model.md b/tutorials-v5/lectures/Lecture-3A-Dicke-model.md index cdee9f4b..3aaae2ab 100644 --- a/tutorials-v5/lectures/Lecture-3A-Dicke-model.md +++ b/tutorials-v5/lectures/Lecture-3A-Dicke-model.md @@ -49,7 +49,7 @@ $\displaystyle J_\pm = \sum_{i=1}^N \sigma_\pm^{(i)}$ ### References - * [R.H. Dicke, Phys. Rev. 93, 99–110 (1954)](http://dx.doi.org/10.1103/PhysRev.93.99) + * [R.H. Dicke, Phys. Rev. 93, 99–110 (1954)](https://journals.aps.org/pr/abstract/10.1103/PhysRev.93.99) ## Setup problem in QuTiP @@ -198,7 +198,7 @@ fig.tight_layout() ### References -* [Lambert et al., Phys. Rev. Lett. 92, 073602 (2004)](http://dx.doi.org/10.1103/PhysRevLett.92.073602). +* [Lambert et al., Phys. Rev. Lett. 92, 073602 (2004)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.92.073602). ```python def calulcate_entropy(M, N, g_vec): diff --git a/tutorials-v5/lectures/Lecture-3B-Jaynes-Cumming-model-with-ultrastrong-coupling.md b/tutorials-v5/lectures/Lecture-3B-Jaynes-Cumming-model-with-ultrastrong-coupling.md index 37d822b6..cce8fc10 100644 --- a/tutorials-v5/lectures/Lecture-3B-Jaynes-Cumming-model-with-ultrastrong-coupling.md +++ b/tutorials-v5/lectures/Lecture-3B-Jaynes-Cumming-model-with-ultrastrong-coupling.md @@ -51,11 +51,11 @@ The regime $g$ is large compared with all other energy scales in the Hamiltonian References: - * [P. Nataf et al., Phys. Rev. Lett. 104, 023601 (2010)](http://dx.doi.org/10.1103/PhysRevLett.104.023601) + * [P. Nataf et al., Phys. Rev. Lett. 104, 023601 (2010)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.104.023601) - * [J. Casanova et al., Phys. Rev. Lett. 105, 26360 (2010)](http://dx.doi.org/10.1103/PhysRevLett.105.263603). + * [J. Casanova et al., Phys. Rev. Lett. 105, 26360 (2010)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.105.263603). - * [S. Ashhab et al., Phys. Rev. A 81, 042311 (2010)](http://dx.doi.org/10.1103/PhysRevA.81.042311) + * [S. Ashhab et al., Phys. Rev. A 81, 042311 (2010)](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.81.042311) diff --git a/tutorials-v5/lectures/Lecture-4-Correlation-Functions.md b/tutorials-v5/lectures/Lecture-4-Correlation-Functions.md index db8c71b9..3d4990bc 100644 --- a/tutorials-v5/lectures/Lecture-4-Correlation-Functions.md +++ b/tutorials-v5/lectures/Lecture-4-Correlation-Functions.md @@ -157,7 +157,7 @@ $L(\tau) = 2\langle Q(\tau)Q(0)\rangle - \langle Q(2\tau)Q(0)\rangle \leq 1$ ### References -* [A. J. Leggett and A. Garg, Phys. Rev. Lett. 54, 857 (1985)](http://dx.doi.org/10.1103/PhysRevLett.54.857) +* [A. J. Leggett and A. Garg, Phys. Rev. Lett. 54, 857 (1985)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.54.857) * [A. J. Leggett, J. Phys. Condens. Matter 14, R415 (2002)](http://dx.doi.org/10.1088/0953-8984/14/15/201) @@ -191,7 +191,7 @@ def leggett_garg(c_mat): References: - * [N. Lambert, J.R. Johansson, F. Nori, Phys. Rev. B 82, 245421 (2011)](http://dx.doi.org/10.1103/PhysRevB.84.245421). + * [N. Lambert, J.R. Johansson, F. Nori, Phys. Rev. B 82, 245421 (2011)](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.84.245421). ```python From 4a9116cf9dfcfe2d4128ccecaa2994e5b210ee64 Mon Sep 17 00:00:00 2001 From: gadhvirushiraj Date: Wed, 6 Nov 2024 00:28:54 +0530 Subject: [PATCH 07/11] update old qip tutorials --- .../quantum-circuits/qip-toffoli-cnot.md | 8 +-- .../quantum-circuits/quantum-gates.md | 52 +++++++++--------- .../quantum-circuits/qip-toffoli-cnot.md | 8 +-- .../quantum-circuits/quantum-gates.md | 54 +++++++++---------- 4 files changed, 61 insertions(+), 61 deletions(-) diff --git a/tutorials-v4/quantum-circuits/qip-toffoli-cnot.md b/tutorials-v4/quantum-circuits/qip-toffoli-cnot.md index 3d933926..9c0d1f64 100644 --- a/tutorials-v4/quantum-circuits/qip-toffoli-cnot.md +++ b/tutorials-v4/quantum-circuits/qip-toffoli-cnot.md @@ -5,9 +5,9 @@ jupyter: extension: .md format_name: markdown format_version: '1.3' - jupytext_version: 1.13.8 + jupytext_version: 1.16.4 kernelspec: - display_name: Python 3 (ipykernel) + display_name: qutip-dev language: python name: python3 --- @@ -39,7 +39,7 @@ q.add_gate("TOFFOLI", controls=[0, 2], targets=[1]) ``` ```python -q.png +q.draw() ``` ```python @@ -53,7 +53,7 @@ q2 = q.resolve_gates() ``` ```python -q2.png +q2.draw() ``` ```python diff --git a/tutorials-v4/quantum-circuits/quantum-gates.md b/tutorials-v4/quantum-circuits/quantum-gates.md index c35df148..131e7ff9 100644 --- a/tutorials-v4/quantum-circuits/quantum-gates.md +++ b/tutorials-v4/quantum-circuits/quantum-gates.md @@ -5,7 +5,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.3' - jupytext_version: 1.13.8 + jupytext_version: 1.16.4 kernelspec: display_name: Python 3 (ipykernel) language: python @@ -63,7 +63,7 @@ cphase(pi / 2) ```python q = QubitCircuit(2, reverse_states=False) q.add_gate("CSIGN", controls=[0], targets=[1]) -q.png +q.draw() ``` ### Rotation about X-axis @@ -74,8 +74,8 @@ rx(pi / 2) ```python q = QubitCircuit(1, reverse_states=False) -q.add_gate("RX", targets=[0], arg_value=pi / 2, arg_label=r"\frac{\pi}{2}") -q.png +q.add_gate("RX", targets=[0], arg_value=pi / 2, style={"showarg": True}) +q.draw() ``` ### Rotation about Y-axis @@ -86,8 +86,8 @@ ry(pi / 2) ```python q = QubitCircuit(1, reverse_states=False) -q.add_gate("RY", targets=[0], arg_value=pi / 2, arg_label=r"\frac{\pi}{2}") -q.png +q.add_gate("RY", targets=[0], arg_value=pi / 2, style={"showarg": True}) +q.draw() ``` ### Rotation about Z-axis @@ -98,8 +98,8 @@ rz(pi / 2) ```python q = QubitCircuit(1, reverse_states=False) -q.add_gate("RZ", targets=[0], arg_value=pi / 2, arg_label=r"\frac{\pi}{2}") -q.png +q.add_gate("RZ", targets=[0], arg_value=pi / 2, style={"showarg": True}) +q.draw() ``` ### CNOT @@ -111,7 +111,7 @@ cnot() ```python q = QubitCircuit(2, reverse_states=False) q.add_gate("CNOT", controls=[0], targets=[1]) -q.png +q.draw() ``` ### CSIGN @@ -123,7 +123,7 @@ csign() ```python q = QubitCircuit(2, reverse_states=False) q.add_gate("CSIGN", controls=[0], targets=[1]) -q.png +q.draw() ``` ### Berkeley @@ -135,7 +135,7 @@ berkeley() ```python q = QubitCircuit(2, reverse_states=False) q.add_gate("BERKELEY", targets=[0, 1]) -q.png +q.draw() ``` ### SWAPalpha @@ -162,7 +162,7 @@ toffoli() swap() q = QubitCircuit(2, reverse_states=False) q.add_gate("SWAP", targets=[0, 1]) -q.png +q.draw() ``` ### ISWAP @@ -171,7 +171,7 @@ q.png iswap() q = QubitCircuit(2, reverse_states=False) q.add_gate("ISWAP", targets=[0, 1]) -q.png +q.draw() ``` ### SQRTiSWAP @@ -234,7 +234,7 @@ cnot(N=3) ```python q = QubitCircuit(3, reverse_states=False) q.add_gate("CNOT", controls=[1], targets=[2]) -q.png +q.draw() ``` 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) ```python q = QubitCircuit(3, reverse_states=False) q.add_gate("CNOT", controls=[0], targets=[2]) -q.png +q.draw() ``` ## 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 N = 2 qc0 = QubitCircuit(N) qc0.add_gate("ISWAP", [0, 1], None) -qc0.png +qc0.draw() ``` ```python @@ -275,7 +275,7 @@ qc1 = QubitCircuit(N) qc1.add_gate("CNOT", 0, 1) qc1.add_gate("CNOT", 1, 0) qc1.add_gate("CNOT", 0, 1) -qc1.png +qc1.draw() ``` ```python @@ -288,7 +288,7 @@ In place of manually converting the SWAP gate to CNOTs, it can be automatically ```python qc2 = qc0.resolve_gates("CNOT") -qc2.png +qc2.draw() ``` ```python @@ -301,7 +301,7 @@ From QuTiP 4.4, we can also add gate at arbitrary position in a circuit. ```python qc1.add_gate("CSIGN", index=[1], targets=[0], controls=[1]) -qc1.png +qc1.draw() ``` ## Example of basis transformation @@ -313,7 +313,7 @@ qc3.add_gate("RX", 0, None, pi / 2, r"\pi/2") qc3.add_gate("RY", 1, None, pi / 2, r"\pi/2") qc3.add_gate("RZ", 2, None, pi / 2, r"\pi/2") qc3.add_gate("ISWAP", [1, 2]) -qc3.png +qc3.draw() ``` ```python @@ -325,7 +325,7 @@ U3 ```python qc4 = qc3.resolve_gates("CNOT") -qc4.png +qc4.draw() ``` ```python @@ -335,7 +335,7 @@ U4 ```python qc5 = qc3.resolve_gates("ISWAP") -qc5.png +qc5.draw() ``` ```python @@ -347,7 +347,7 @@ U5 ```python qc6 = qc3.resolve_gates(["ISWAP", "RX", "RY"]) -qc6.png +qc6.draw() ``` ```python @@ -357,7 +357,7 @@ U6 ```python qc7 = qc3.resolve_gates(["CNOT", "RZ", "RX"]) -qc7.png +qc7.draw() ``` ```python @@ -373,7 +373,7 @@ Interactions between non-adjacent qubits can be resolved by QubitCircuit to a se ```python qc8 = QubitCircuit(3) qc8.add_gate("CNOT", 2, 0) -qc8.png +qc8.draw() ``` ```python @@ -393,7 +393,7 @@ U9 ```python qc10 = qc9.resolve_gates("CNOT") -qc10.png +qc10.draw() ``` ```python diff --git a/tutorials-v5/quantum-circuits/qip-toffoli-cnot.md b/tutorials-v5/quantum-circuits/qip-toffoli-cnot.md index 3d933926..9c0d1f64 100644 --- a/tutorials-v5/quantum-circuits/qip-toffoli-cnot.md +++ b/tutorials-v5/quantum-circuits/qip-toffoli-cnot.md @@ -5,9 +5,9 @@ jupyter: extension: .md format_name: markdown format_version: '1.3' - jupytext_version: 1.13.8 + jupytext_version: 1.16.4 kernelspec: - display_name: Python 3 (ipykernel) + display_name: qutip-dev language: python name: python3 --- @@ -39,7 +39,7 @@ q.add_gate("TOFFOLI", controls=[0, 2], targets=[1]) ``` ```python -q.png +q.draw() ``` ```python @@ -53,7 +53,7 @@ q2 = q.resolve_gates() ``` ```python -q2.png +q2.draw() ``` ```python diff --git a/tutorials-v5/quantum-circuits/quantum-gates.md b/tutorials-v5/quantum-circuits/quantum-gates.md index ce71bb2a..a0d4b450 100644 --- a/tutorials-v5/quantum-circuits/quantum-gates.md +++ b/tutorials-v5/quantum-circuits/quantum-gates.md @@ -5,9 +5,9 @@ jupyter: extension: .md format_name: markdown format_version: '1.3' - jupytext_version: 1.13.8 + jupytext_version: 1.16.4 kernelspec: - display_name: Python 3 (ipykernel) + display_name: qutip-dev language: python name: python3 --- @@ -63,7 +63,7 @@ cphase(pi / 2) ```python q = QubitCircuit(2, reverse_states=False) q.add_gate("CSIGN", controls=[0], targets=[1]) -q.png +q.draw() ``` ### Rotation about X-axis @@ -74,8 +74,8 @@ rx(pi / 2) ```python q = QubitCircuit(1, reverse_states=False) -q.add_gate("RX", targets=[0], arg_value=pi / 2, arg_label=r"\frac{\pi}{2}") -q.png +q.add_gate("RX", targets=[0], arg_value=pi / 2, style={"showarg": True}) +q.draw() ``` ### Rotation about Y-axis @@ -86,8 +86,8 @@ ry(pi / 2) ```python q = QubitCircuit(1, reverse_states=False) -q.add_gate("RY", targets=[0], arg_value=pi / 2, arg_label=r"\frac{\pi}{2}") -q.png +q.add_gate("RY", targets=[0], arg_value=pi / 2, style={"showarg": True}) +q.draw() ``` ### Rotation about Z-axis @@ -98,8 +98,8 @@ rz(pi / 2) ```python q = QubitCircuit(1, reverse_states=False) -q.add_gate("RZ", targets=[0], arg_value=pi / 2, arg_label=r"\frac{\pi}{2}") -q.png +q.add_gate("RZ", targets=[0], arg_value=pi / 2, style={"showarg": True}) +q.draw() ``` ### CNOT @@ -111,7 +111,7 @@ cnot() ```python q = QubitCircuit(2, reverse_states=False) q.add_gate("CNOT", controls=[0], targets=[1]) -q.png +q.draw() ``` ### CSIGN @@ -123,7 +123,7 @@ csign() ```python q = QubitCircuit(2, reverse_states=False) q.add_gate("CSIGN", controls=[0], targets=[1]) -q.png +q.draw() ``` ### Berkeley @@ -135,7 +135,7 @@ berkeley() ```python q = QubitCircuit(2, reverse_states=False) q.add_gate("BERKELEY", targets=[0, 1]) -q.png +q.draw() ``` ### SWAPalpha @@ -162,7 +162,7 @@ toffoli() swap() q = QubitCircuit(2, reverse_states=False) q.add_gate("SWAP", targets=[0, 1]) -q.png +q.draw() ``` ### ISWAP @@ -171,7 +171,7 @@ q.png iswap() q = QubitCircuit(2, reverse_states=False) q.add_gate("ISWAP", targets=[0, 1]) -q.png +q.draw() ``` ### SQRTiSWAP @@ -234,7 +234,7 @@ cnot(N=3) ```python q = QubitCircuit(3, reverse_states=False) q.add_gate("CNOT", controls=[1], targets=[2]) -q.png +q.draw() ``` 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) ```python q = QubitCircuit(3, reverse_states=False) q.add_gate("CNOT", controls=[0], targets=[2]) -q.png +q.draw() ``` ## 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 N = 2 qc0 = QubitCircuit(N) qc0.add_gate("ISWAP", [0, 1], None) -qc0.png +qc0.draw() ``` ```python @@ -275,7 +275,7 @@ qc1 = QubitCircuit(N) qc1.add_gate("CNOT", 0, 1) qc1.add_gate("CNOT", 1, 0) qc1.add_gate("CNOT", 0, 1) -qc1.png +qc1.draw() ``` ```python @@ -288,7 +288,7 @@ In place of manually converting the SWAP gate to CNOTs, it can be automatically ```python qc2 = qc0.resolve_gates("CNOT") -qc2.png +qc2.draw() ``` ```python @@ -301,7 +301,7 @@ From QuTiP 4.4, we can also add gate at arbitrary position in a circuit. ```python qc1.add_gate("CSIGN", index=[1], targets=[0], controls=[1]) -qc1.png +qc1.draw() ``` ## Example of basis transformation @@ -313,7 +313,7 @@ qc3.add_gate("RX", 0, None, pi / 2, r"\pi/2") qc3.add_gate("RY", 1, None, pi / 2, r"\pi/2") qc3.add_gate("RZ", 2, None, pi / 2, r"\pi/2") qc3.add_gate("ISWAP", [1, 2]) -qc3.png +qc3.draw() ``` ```python @@ -325,7 +325,7 @@ U3 ```python qc4 = qc3.resolve_gates("CNOT") -qc4.png +qc4.draw() ``` ```python @@ -335,7 +335,7 @@ U4 ```python qc5 = qc3.resolve_gates("ISWAP") -qc5.png +qc5.draw() ``` ```python @@ -347,7 +347,7 @@ U5 ```python qc6 = qc3.resolve_gates(["ISWAP", "RX", "RY"]) -qc6.png +qc6.draw() ``` ```python @@ -357,7 +357,7 @@ U6 ```python qc7 = qc3.resolve_gates(["CNOT", "RZ", "RX"]) -qc7.png +qc7.draw() ``` ```python @@ -373,7 +373,7 @@ Interactions between non-adjacent qubits can be resolved by QubitCircuit to a se ```python qc8 = QubitCircuit(3) qc8.add_gate("CNOT", 2, 0) -qc8.png +qc8.draw() ``` ```python @@ -393,7 +393,7 @@ U9 ```python qc10 = qc9.resolve_gates("CNOT") -qc10.png +qc10.draw() ``` ```python From c485d373ff993f2496e7c558072cf52a3ddd7279 Mon Sep 17 00:00:00 2001 From: gadhvirushiraj Date: Sun, 10 Nov 2024 01:10:55 +0530 Subject: [PATCH 08/11] fixed pep8 formating error --- tutorials-v5/quantum-circuits/matrenderer-plot.md | 11 +++++------ tutorials-v5/quantum-circuits/textrenderer-plot.md | 7 ++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/tutorials-v5/quantum-circuits/matrenderer-plot.md b/tutorials-v5/quantum-circuits/matrenderer-plot.md index 4f323cff..f18a24b1 100644 --- a/tutorials-v5/quantum-circuits/matrenderer-plot.md +++ b/tutorials-v5/quantum-circuits/matrenderer-plot.md @@ -24,6 +24,8 @@ This notebook serves as a comprehensive guide to plotting quantum circuits using ```python import qutip import numpy as np +from qutip import Qobj +from qutip_qip.operations import rx from qutip_qip.circuit import QubitCircuit ``` @@ -153,18 +155,15 @@ qc.draw() ```python qc = QubitCircuit(3) qc.add_gate("RX", targets=[0], arg_value=np.pi / 12, style={"showarg": True}) -qc.add_gate("RY", targets=[1], arg_value=2 * np.pi / 3, style={"showarg": True}) +qc.add_gate( + "RY", targets=[1], arg_value=2 * np.pi / 3, style={"showarg": True} +) qc.add_gate("RY", targets=[2], arg_value=0.3, style={"showarg": True}) qc.draw() ``` #### With User Custom Gates -```python -from qutip import Qobj -from qutip_qip.operations import rx -``` - ```python def user_gate1(arg_value): # controlled rotation X diff --git a/tutorials-v5/quantum-circuits/textrenderer-plot.md b/tutorials-v5/quantum-circuits/textrenderer-plot.md index d029bd01..fa773619 100644 --- a/tutorials-v5/quantum-circuits/textrenderer-plot.md +++ b/tutorials-v5/quantum-circuits/textrenderer-plot.md @@ -23,6 +23,8 @@ This notebook serves as a comprehensive guide to plotting quantum circuits using ```python import qutip import numpy as np +from qutip import Qobj +from qutip_qip.operations import rx from qutip_qip.circuit import QubitCircuit ``` @@ -81,11 +83,6 @@ qc.draw("text") #### With User Custom Gates -```python -from qutip import Qobj -from qutip_qip.operations import rx -``` - ```python def user_gate1(arg_value): # controlled rotation X From 1f50f1213c7e87f318715600a4cbadfc8c3cd1c8 Mon Sep 17 00:00:00 2001 From: gadhvirushiraj Date: Wed, 13 Nov 2024 22:36:02 +0530 Subject: [PATCH 09/11] changed v4-env numpy version --- test_environment-v4.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_environment-v4.yml b/test_environment-v4.yml index daa190f3..ee820532 100644 --- a/test_environment-v4.yml +++ b/test_environment-v4.yml @@ -4,7 +4,7 @@ channels: dependencies: - python==3.10.4 - pip==22.1.2 -- numpy==1.22.4 +- numpy<1.20 - scipy==1.8.1 - matplotlib==3.5.2 - imagemagick==7.1.0_36 From 9d2054713cbf10bec3d3345dff552a29accf84eb Mon Sep 17 00:00:00 2001 From: gadhvirushiraj Date: Mon, 18 Nov 2024 18:16:30 +0530 Subject: [PATCH 10/11] Revert "changed v4-env numpy version" This reverts commit 1f50f1213c7e87f318715600a4cbadfc8c3cd1c8. --- test_environment-v4.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_environment-v4.yml b/test_environment-v4.yml index ee820532..daa190f3 100644 --- a/test_environment-v4.yml +++ b/test_environment-v4.yml @@ -4,7 +4,7 @@ channels: dependencies: - python==3.10.4 - pip==22.1.2 -- numpy<1.20 +- numpy==1.22.4 - scipy==1.8.1 - matplotlib==3.5.2 - imagemagick==7.1.0_36 From 8d5d9be7010c5e7b6b71e30007259666bb755cba Mon Sep 17 00:00:00 2001 From: Neill Lambert Date: Fri, 6 Dec 2024 12:47:42 +0900 Subject: [PATCH 11/11] Update quantum-gates.md dtype issue --- tutorials-v4/quantum-circuits/quantum-gates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials-v4/quantum-circuits/quantum-gates.md b/tutorials-v4/quantum-circuits/quantum-gates.md index 131e7ff9..be7a4d0b 100644 --- a/tutorials-v4/quantum-circuits/quantum-gates.md +++ b/tutorials-v4/quantum-circuits/quantum-gates.md @@ -418,7 +418,7 @@ From QuTiP 4.4 on, user defined gates can be defined by a python function that t ```python def user_gate1(arg_value): # controlled rotation X - mat = np.zeros((4, 4), dtype=np.complex) + mat = np.zeros((4, 4), dtype=complex) mat[0, 0] = mat[1, 1] = 1.0 mat[2:4, 2:4] = rx(arg_value) return Qobj(mat, dims=[[2, 2], [2, 2]])