Skip to content

Commit

Permalink
regenerate tutorial docs for v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
piperfw committed Oct 24, 2022
1 parent 882689a commit dc37f75
Show file tree
Hide file tree
Showing 41 changed files with 180 additions and 167 deletions.
10 changes: 5 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ Up to versions 0.1.x this package was called *TimeEvolvingMPO*.
:maxdepth: 1
:caption: Tutorials

pages/tutorials/quickstart/quickstart
pages/tutorials/pt_tempo/pt_tempo
pages/tutorials/bath_dynamics/bath_dynamics
pages/tutorials/pt_tebd/pt_tebd
pages/tutorials/mf_tempo/mf_tempo
pages/tutorials/quickstart
pages/tutorials/pt_tempo
pages/tutorials/bath_dynamics
pages/tutorials/pt_tebd
pages/tutorials/mf_tempo

.. toctree::
:maxdepth: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ matrix elements evolve.
.. image:: output_10_2.png
.. image:: bath_dynamics_files/bath_dynamics_10_2.png


Already the process tensor tells us everything we could want to know
Expand Down Expand Up @@ -254,7 +254,7 @@ frequency, in this case let’s look at ``w = Omega`` and a bandwidth of
.. image:: output_14_2.png
.. image:: bath_dynamics_files/bath_dynamics_14_2.png


…that took quite a while. From the expression for :math:`\Delta Q` is
Expand Down Expand Up @@ -287,14 +287,13 @@ see what happens if we want the energy of another mode now, let’s say
.. image:: output_16_1.png
.. image:: bath_dynamics_files/bath_dynamics_16_1.png


Much quicker! This is because the same set of system correlation
functions can be used to compute any bath correlation function
:math:`\langle \alpha_2(t_2)\alpha_1(t_1)\rangle` where
$:raw-latex:`\alpha`\_2, :raw-latex:`\alpha`\_1
:raw-latex:`\in `{a_k^:raw-latex:`\dagger`,a_k} $ and
:math:`\alpha_2, \alpha_1 \in \{a_k^\dagger,a_k\}` and
:math:`t_1,t_2 < t_N`. So now we see the logic of having a bath_dynamics
object, it allows us to conveniently store the calculated system
correlation functions and re-use them as we like :)
Expand Down Expand Up @@ -331,7 +330,7 @@ exchanged over the process so simply look at the final value of
.. image:: output_18_1.png
.. image:: bath_dynamics_files/bath_dynamics_18_1.png


This is highly oscillatory, perhaps unsurprising from the dynamics we
Expand Down Expand Up @@ -366,7 +365,7 @@ we average over the last :math:`n` timesteps where
.. image:: output_20_1.png
.. image:: bath_dynamics_files/bath_dynamics_20_1.png


Here, as in the paper, we see heat is absorbed by the system from the
Expand All @@ -375,4 +374,3 @@ band of the modes in the vicinity of
as in a Markovian theory the system would sample the environment purely
at its eigensplitting :math:`\tilde{\Omega}`.

--------------
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ We firstly import OQuPy and other useful packages:
import matplotlib.pyplot as plt
Check the current OQuPy version; mean-field functionality was introduced
in version **0.3.0**.
in version **0.3.0** and revised in its current format in **0.4.0.**

.. code:: ipython3
Expand Down Expand Up @@ -352,8 +352,8 @@ used to compute the dynamics for an ordinary ``System``:
.. parsed-literal::
--> TEMPO-with-field computation:
100.0% 93 of 93 [########################################] 00:00:19
Elapsed time: 20.0s
100.0% 93 of 93 [########################################] 00:00:13
Elapsed time: 13.3s
``MeanFieldTempo.compute`` returns a ``MeanFieldDynamics`` object
Expand Down Expand Up @@ -385,12 +385,12 @@ producing the first part of a single line of **Fig. 2a.**:
.. parsed-literal::
<matplotlib.legend.Legend at 0x7f6c669133c8>
<matplotlib.legend.Legend at 0x7f848ff957e0>
.. image:: output_34_1.png
.. image:: mf_tempo_files/mf_tempo_34_1.png


If you have the time you can calculate the dynamics to
Expand Down Expand Up @@ -428,8 +428,8 @@ bath via
.. parsed-literal::
--> PT-TEMPO computation:
100.0% 93 of 93 [########################################] 00:00:06
Elapsed time: 6.6s
100.0% 93 of 93 [########################################] 00:00:02
Elapsed time: 2.8s
Refer the Time Dependence and PT-TEMPO tutorial for further discussion
Expand Down Expand Up @@ -482,17 +482,17 @@ using the process tensor (now in a list) calculated above:
.. parsed-literal::
--> Compute dynamics with field:
100.0% 93 of 93 [########################################] 00:00:15
Elapsed time: 15.0s
100.0% 93 of 93 [########################################] 00:00:09
Elapsed time: 9.6s
--> Compute dynamics with field:
100.0% 93 of 93 [########################################] 00:00:14
Elapsed time: 14.0s
100.0% 93 of 93 [########################################] 00:00:09
Elapsed time: 9.9s
--> Compute dynamics with field:
100.0% 93 of 93 [########################################] 00:00:15
Elapsed time: 15.8s
100.0% 93 of 93 [########################################] 00:00:09
Elapsed time: 9.9s
--> Compute dynamics with field:
100.0% 93 of 93 [########################################] 00:00:14
Elapsed time: 14.6s
100.0% 93 of 93 [########################################] 00:00:08
Elapsed time: 8.7s
Finally, plotting the results:
Expand All @@ -513,12 +513,12 @@ Finally, plotting the results:
.. parsed-literal::
<matplotlib.legend.Legend at 0x7f6c66697b38>
<matplotlib.legend.Legend at 0x7f848f7e88b0>
.. image:: output_43_1.png
.. image:: mf_tempo_files/mf_tempo_43_1.png


5. Summary
Expand All @@ -535,4 +535,3 @@ dynamics:
(process tensor) may be used to calculate ``MeanFieldDynamics``
- ``MeanFieldDynamics`` comprises one of more system ``Dynamics`` and a
set of field values ``fields``.

Binary file removed docs/pages/tutorials/mf_tempo/output_34_1.png
Binary file not shown.
Binary file removed docs/pages/tutorials/mf_tempo/output_43_1.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ density matrices.
down_dm = oqupy.operators.spin_dm("z-")
mixed_dm = oqupy.operators.spin_dm("mixed")
--------------

Example - Heisenberg spin chain
Expand All @@ -91,8 +90,6 @@ coupling we first consider the closed chain with the Hamiltonian
with :math:`N=5`, :math:`\epsilon=1.0`, :math:`J^x = 1.3`,
:math:`J^y = 0.7`, and :math:`J^z = 1.2`.



.. code:: ipython3
N = 5
Expand Down Expand Up @@ -179,7 +176,7 @@ time steps.
PT-TEBD computation (closed spin chain):
--> PT-TEBD computation:
100.0% 20 of 20 [########################################] 00:00:01
Elapsed time: 1.1s
Elapsed time: 1.2s
The computation returns a results dictionary which in addition to the
Expand Down Expand Up @@ -208,20 +205,20 @@ We can use the dynamics results to then compute the evolution of the
plt.plot(
*dynamics.expectations(sz, real=True),
color=f"C{site}", linestyle="solid",
label=f"$<s_{site}^z>$")
label=f"$\\langle s_{site}^z \\rangle$")
plt.legend()
.. parsed-literal::
<matplotlib.legend.Legend at 0x7f672e2d7588>
<matplotlib.legend.Legend at 0x7f7b31700f40>
.. image:: output_23_1.png
.. image:: pt_tebd_files/pt_tebd_22_1.png


Yay! We can observe how the excitation travels along the chain.
Expand Down Expand Up @@ -288,7 +285,7 @@ computation (see Tutorial 02 - Time dependence and PT-TEMPO).
Process tensor (PT) computation:
--> PT-TEMPO computation:
100.0% 20 of 20 [########################################] 00:00:00
Elapsed time: 0.6s
Elapsed time: 0.4s
To see the effect of the environment clearly we start in a fully mixed
Expand Down Expand Up @@ -326,29 +323,29 @@ keep them free by setting them to ``None``.
PT-TEBD computation (open spin chain):
--> PT-TEBD computation:
100.0% 20 of 20 [########################################] 00:00:04
Elapsed time: 4.3s
100.0% 20 of 20 [########################################] 00:00:02
Elapsed time: 2.9s
.. code:: ipython3
for site, dyn in results_open['dynamics'].items():
plt.plot(*dyn.expectations(sz, real=True),
color=f"C{site}", linestyle="solid",
label=f"$<s_{site}^z>$")
label=f"$\\langle s_{site}^z \\rangle$")
plt.legend()
.. parsed-literal::
<matplotlib.legend.Legend at 0x7f671cf195f8>
<matplotlib.legend.Legend at 0x7f7b30febca0>
.. image:: output_35_1.png
.. image:: pt_tebd_files/pt_tebd_34_1.png


We can see that the environment starts to hybridize with the first spin
Expand Down
Binary file removed docs/pages/tutorials/pt_tebd/output_23_1.png
Binary file not shown.
Binary file removed docs/pages/tutorials/pt_tebd/output_35_1.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ detuning, we can check the shape of the laser pulse.
.. parsed-literal::
<matplotlib.legend.Legend at 0x7f42993e3278>
<matplotlib.legend.Legend at 0x7fab3d70bb20>
.. image:: output_16_1.png
.. image:: pt_tempo_files/pt_tempo_16_1.png


3. Create time dependent system object
Expand Down Expand Up @@ -216,7 +216,7 @@ parameters):
--> TEMPO computation:
100.0% 50 of 50 [########################################] 00:00:02
Elapsed time: 2.3s
Elapsed time: 2.6s
and extract the expectation values
Expand All @@ -230,7 +230,7 @@ for plotting:
s_xy = np.sqrt(s_x**2 + s_y**2)
plt.plot(t, s_xy, label=r'$\Delta = 0.0$')
plt.xlabel(r'$t\,\Omega$')
plt.ylabel(r'$<\sigma_xy>$')
plt.ylabel(r'$<\sigma_{xy}>$')
plt.ylim((0.0,1.0))
plt.legend(loc=4)
Expand All @@ -239,12 +239,12 @@ for plotting:
.. parsed-literal::
<matplotlib.legend.Legend at 0x7f42980cb898>
<matplotlib.legend.Legend at 0x7fab3ab8f430>
.. image:: output_23_1.png
.. image:: pt_tempo_files/pt_tempo_23_1.png


5. Using PT-TEMPO to explore many different laser pulses
Expand Down Expand Up @@ -331,7 +331,7 @@ and plot :math:`\langle\sigma_{xy}\rangle(t)` for each:
for t, s_xy, delta in zip(t_list, s_xy_list, deltas):
plt.plot(t, s_xy, label=r"$\Delta = $"+f"{delta:0.1f}")
plt.xlabel(r'$t/$ps')
plt.ylabel(r'$<\sigma_xy>$')
plt.ylabel(r'$<\sigma_{xy}>$')
plt.ylim((0.0,1.0))
plt.legend()
Expand All @@ -340,11 +340,11 @@ and plot :math:`\langle\sigma_{xy}\rangle(t)` for each:
.. parsed-literal::
<matplotlib.legend.Legend at 0x7f42991f66d8>
<matplotlib.legend.Legend at 0x7fab3abec4c0>
.. image:: output_31_1.png
.. image:: pt_tempo_files/pt_tempo_31_1.png


Binary file removed docs/pages/tutorials/pt_tempo/output_16_1.png
Binary file not shown.
Binary file removed docs/pages/tutorials/pt_tempo/output_23_1.png
Binary file not shown.
Binary file removed docs/pages/tutorials/pt_tempo/output_31_1.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit dc37f75

Please sign in to comment.