diff --git a/assets/js/alps-download.js b/assets/js/alps-download.js
new file mode 100644
index 00000000..0a018631
--- /dev/null
+++ b/assets/js/alps-download.js
@@ -0,0 +1,44 @@
+// Download tutorial scripts without navigating away from the page.
+//
+// The scripts live in ALPSim/ALPS, so the links are cross-origin and the HTML
+// `download` attribute is ignored. raw.githubusercontent.com sends
+// `access-control-allow-origin: *`, so we can fetch the file and hand the
+// browser a same-origin blob to save instead.
+//
+// If the fetch fails (offline, rate limited, file moved) we fall back to
+// opening the raw URL in a new tab, so the link is never a dead end.
+(function () {
+ "use strict";
+
+ document.addEventListener("click", function (event) {
+ if (event.defaultPrevented || event.button !== 0) return;
+ if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
+
+ var link = event.target.closest("a.alps-download");
+ if (!link) return;
+
+ event.preventDefault();
+
+ var url = link.href;
+ var filename = link.dataset.filename || url.split("/").pop();
+
+ fetch(url)
+ .then(function (response) {
+ if (!response.ok) throw new Error("HTTP " + response.status);
+ return response.blob();
+ })
+ .then(function (blob) {
+ var objectURL = URL.createObjectURL(blob);
+ var temp = document.createElement("a");
+ temp.href = objectURL;
+ temp.download = filename;
+ document.body.appendChild(temp);
+ temp.click();
+ temp.remove();
+ URL.revokeObjectURL(objectURL);
+ })
+ .catch(function () {
+ window.open(url, "_blank", "noopener");
+ });
+ });
+})();
diff --git a/content/en/tutorials/mcs/mc01a.md b/content/en/tutorials/mcs/mc01a.md
index f12b3149..8f2079b4 100644
--- a/content/en/tutorials/mcs/mc01a.md
+++ b/content/en/tutorials/mcs/mc01a.md
@@ -23,7 +23,7 @@ This tutorial can be run either on the command line or in Python. We recommend t
### Setting up and running the simulation on the command line
-To set up and run the simulation on the command line, we first create a parameter file that specifies the parameters of the simulation(s). The downloadable file will be titled `parm1a`, with the following contents:
+To set up and run the simulation on the command line, we first create a parameter file that specifies the parameters of the simulation(s). The downloadable file will be titled `parm1a`, with the following contents:
```
LATTICE="square lattice"
@@ -100,7 +100,7 @@ Look at all six tasks and, by studying the binning analysis in the files `parm1a
The `pyalps` package is a wrapper for ALPS: All it does is call the commands described in the previous section as if they were run in a terminal. It is superior for plotting because the output of the simulation can be read directly into a Python data structure and accessed by `matplotlib`. It also comes with a wrapper `pyalps.plot` for certain matplotlib functions to neatly plot data generated by `pyalps`.
-To set up and run the simulation in Python, we create a script named `tutorial1a.py`. The first part of this script must import the required modules and prepare the input job and task files. Instead of writing a parameter file and using `convert2xml`, we store a list containing each task's parameters as a dictionary, like so:
+To set up and run the simulation in Python, we create a script named `tutorial1a.py`. The first part of this script must import the required modules and prepare the input job and task files. Instead of writing a parameter file and using `convert2xml`, we store a list containing each task's parameters as a dictionary, like so:
```Python
import pyalps
@@ -197,7 +197,7 @@ We therefore repeat the simulations with cluster updates, using fewer thermaliza
### Command line
-The downloadable parameter file `parm1b` has the following contents:
+The downloadable parameter file `parm1b` has the following contents:
```
LATTICE="square lattice"
@@ -224,7 +224,7 @@ spinmc --Tmin 10 --write-xml parm1b.in.xml
### Python
-The script `tutorial1b.py` follows the same structure as `tutorial1a.py`, with the updated parameters and `parm1b` as the file prefix:
+The script `tutorial1b.py` follows the same structure as `tutorial1a.py`, with the updated parameters and `parm1b` as the file prefix:
```Python
import pyalps
diff --git a/content/en/tutorials/mcs/mc01b.md b/content/en/tutorials/mcs/mc01b.md
index 35503c86..5939c746 100644
--- a/content/en/tutorials/mcs/mc01b.md
+++ b/content/en/tutorials/mcs/mc01b.md
@@ -22,7 +22,7 @@ Both are checked by inspecting the time series of a measured observable — in t
### Preparing and running the simulation on the command line
-The parameter file `parm1a` sets up a single simulation of the Ising model on a $48 \times 48$ square lattice at the critical temperature:
+The parameter file `parm1a` sets up a single simulation of the Ising model on a $48 \times 48$ square lattice at the critical temperature:
```
LATTICE="square lattice"
@@ -44,7 +44,7 @@ spinmc --Tmin 10 --write-xml parm1a.in.xml
### Preparing and running the simulation in Python
-The full script is available as `tutorial1a.py`.
+The full script is available as `tutorial1a.py`.
It begins by importing the required modules and defining the simulation parameters:
```Python
diff --git a/content/en/tutorials/mcs/mc02.md b/content/en/tutorials/mcs/mc02.md
index 760506c0..871f2580 100644
--- a/content/en/tutorials/mcs/mc02.md
+++ b/content/en/tutorials/mcs/mc02.md
@@ -20,7 +20,7 @@ The comparison highlights two key contrasts: how quantum fluctuations modify the
#### Setting up and running on the command line
-The parameter file `parm2a` sets up simulations of the classical ferromagnetic Heisenberg model on a chain of 60 sites across a range of temperatures:
+The parameter file `parm2a` sets up simulations of the classical ferromagnetic Heisenberg model on a chain of 60 sites across a range of temperatures:
```
LATTICE="chain lattice"
@@ -56,7 +56,7 @@ spinmc --Tmin 10 --write-xml parm2a.in.xml
#### Setting up and running in Python
-The script `tutorial2a.py` sets up and runs the same simulation. Place it in the same folder as `parm2a`:
+The script `tutorial2a.py` sets up and runs the same simulation. Place it in the same folder as `parm2a`:
```Python
import pyalps
@@ -110,7 +110,7 @@ Aside from the lattice change and the two couplings, the simulation setup is ide
#### Setting up and running on the command line
-Download `parm2b` and place it in the same folder:
+Download `parm2b` and place it in the same folder:
```
LATTICE="ladder"
@@ -147,7 +147,7 @@ spinmc --Tmin 10 --write-xml parm2b.in.xml
#### Setting up and running in Python
-The script `tutorial2b.py` is a copy of `tutorial2a.py` with three changes: the prefix renamed to `parm2b`, `LATTICE` set to `"ladder"`, and `J` replaced by `J0` and `J1` (both `-1`).
+The script `tutorial2b.py` is a copy of `tutorial2a.py` with three changes: the prefix renamed to `parm2b`, `LATTICE` set to `"ladder"`, and `J` replaced by `J0` and `J1` (both `-1`).
## Quantum Heisenberg models
@@ -162,7 +162,7 @@ The key parameter changes, relative to the classical case, are:
#### Setting up and running on the command line
-Download `parm2c`:
+Download `parm2c`:
```
LATTICE="chain lattice"
@@ -200,7 +200,7 @@ loop parm2c.in.xml
#### Setting up and running in Python
-The script `tutorial2c.py` adapts `tutorial2a.py` to the quantum parameters and calls `loop` instead of `spinmc`:
+The script `tutorial2c.py` adapts `tutorial2a.py` to the quantum parameters and calls `loop` instead of `spinmc`:
```Python
input_file = pyalps.writeInputFiles('parm2c', parms)
@@ -223,7 +223,7 @@ Unlike the gapless chain, the two-leg antiferromagnetic Heisenberg ladder has a
#### Setting up and running on the command line
-Download `parm2d`:
+Download `parm2d`:
```
LATTICE="ladder"
@@ -257,11 +257,11 @@ loop parm2d.in.xml
#### Setting up and running in Python
-The script `tutorial2d.py` adapts `tutorial2c.py`: rename the prefix to `parm2d`, change `LATTICE` to `"ladder"`, and replace `J` with `J0` and `J1` (both `1`).
+The script `tutorial2d.py` adapts `tutorial2c.py`: rename the prefix to `parm2d`, change `LATTICE` to `"ladder"`, and replace `J` with `J0` and `J1` (both `1`).
## Combining all four simulations
-After running all four simulations in the same folder, the script `tutorial2full.py` loads all results together and overlays them on a single plot.
+After running all four simulations in the same folder, the script `tutorial2full.py` loads all results together and overlays them on a single plot.
```Python
import pyalps
diff --git a/content/en/tutorials/mcs/mc03.md b/content/en/tutorials/mcs/mc03.md
index 14b56500..26825e41 100644
--- a/content/en/tutorials/mcs/mc03.md
+++ b/content/en/tutorials/mcs/mc03.md
@@ -20,7 +20,7 @@ The temperature is low enough that the results are close to the ground-state mag
#### Setting up and running on the command line
-The parameter file `parm3a`:
+The parameter file `parm3a`:
```
LATTICE="chain lattice"
@@ -61,7 +61,7 @@ dirloop_sse --Tmin 10 --write-xml parm3a.in.xml
#### Setting up and running in Python
-The script `tutorial3a.py`:
+The script `tutorial3a.py`:
```Python
import pyalps
@@ -114,7 +114,7 @@ We use 20 rungs (40 sites total) and extend the field range to $h = 3.5$ to reac
#### Setting up and running on the command line
-The parameter file `parm3b` uses the same structure as `parm3a` with these changes:
+The parameter file `parm3b` uses the same structure as `parm3a` with these changes:
```
LATTICE="ladder"
@@ -154,7 +154,7 @@ dirloop_sse --Tmin 10 --write-xml parm3b.in.xml
#### Setting up and running in Python
-The script `tutorial3b.py` adapts `tutorial3a.py`: rename the prefix to `parm3b`, change `LATTICE` to `"ladder"`, replace `J` with `J0=J1=1`, and extend the field scan to 3.5.
+The script `tutorial3b.py` adapts `tutorial3a.py`: rename the prefix to `parm3b`, change `LATTICE` to `"ladder"`, replace `J` with `J0=J1=1`, and extend the field scan to 3.5.
#### Evaluating and plotting
@@ -175,7 +175,7 @@ In contrast to the chain, the ladder magnetization is zero up to a finite lower
## Combining both simulations
-After running both simulations in the same folder, the script `tutorial3full.py` overlays the two magnetization curves on a single plot:
+After running both simulations in the same folder, the script `tutorial3full.py` overlays the two magnetization curves on a single plot:
```Python
import pyalps
diff --git a/content/en/tutorials/mcs/mc04.md b/content/en/tutorials/mcs/mc04.md
index 626cf0e0..016d6b3c 100644
--- a/content/en/tutorials/mcs/mc04.md
+++ b/content/en/tutorials/mcs/mc04.md
@@ -20,7 +20,7 @@ The small system size allows a fast simulation; finite-size effects are signific
### Command line
-The parameter file `parm4` enables three additional measurement flags alongside the standard parameters:
+The parameter file `parm4` enables three additional measurement flags alongside the standard parameters:
```
MODEL="spin"
@@ -53,7 +53,7 @@ dirloop_sse --Tmin 10 --write-xml parm4.in.xml
### Python
-The script `tutorial4.py`:
+The script `tutorial4.py`:
```Python
import pyalps
diff --git a/content/en/tutorials/mcs/mc05.md b/content/en/tutorials/mcs/mc05.md
index 98cffae6..1c126757 100644
--- a/content/en/tutorials/mcs/mc05.md
+++ b/content/en/tutorials/mcs/mc05.md
@@ -22,7 +22,7 @@ The Hilbert space is truncated at `Nmax=2` bosons per site, which is a good appr
### Command line
-The parameter file `parm5a`:
+The parameter file `parm5a`:
```
LATTICE="square lattice"
@@ -58,7 +58,7 @@ worm --Tmin 10 --write-xml parm5a.in.xml
### Python
-The script `tutorial5a.py`:
+The script `tutorial5a.py`:
```Python
import pyalps
@@ -115,7 +115,7 @@ We simulate three system sizes $L = 4, 6, 8$ on a fine grid of hopping values ar
### Command line
-The parameter file `parm5b`:
+The parameter file `parm5b`:
```
LATTICE="square lattice"
@@ -159,7 +159,7 @@ worm --Tmin 10 --write-xml parm5b.in.xml
### Python
-The script `tutorial5b.py`:
+The script `tutorial5b.py`:
```Python
import pyalps
diff --git a/content/en/tutorials/mcs/mc06.md b/content/en/tutorials/mcs/mc06.md
index ae713c5c..8b54100e 100644
--- a/content/en/tutorials/mcs/mc06.md
+++ b/content/en/tutorials/mcs/mc06.md
@@ -14,7 +14,7 @@ From a single simulation one can then evaluate thermodynamic observables — ene
### The ferromagnetic Heisenberg chain
-The parameter file `parm6a` sets up a QWL simulation of the $S=\frac{1}{2}$ Heisenberg ferromagnet on a chain of 40 sites:
+The parameter file `parm6a` sets up a QWL simulation of the $S=\frac{1}{2}$ Heisenberg ferromagnet on a chain of 40 sites:
```
LATTICE="chain lattice"
@@ -64,7 +64,7 @@ The tools `plot2xmgr` (Grace) and `plot2gp` (Gnuplot) produce equivalent output
### Python
-The script `tutorial6a.py` sets up and runs the simulation, then evaluates all observables in one call:
+The script `tutorial6a.py` sets up and runs the simulation, then evaluates all observables in one call:
```python
import pyalps
@@ -85,7 +85,7 @@ For the ferromagnet ($J=-1$) you should see a broad specific-heat peak at low te
### The antiferromagnetic Heisenberg chain
To simulate the antiferromagnetic chain set $J=1$ instead of $J=-1$.
-The parameters are in `parm6b` and the Python script in `tutorial6b.py`; everything else is identical to the ferromagnetic case.
+The parameters are in `parm6b` and the Python script in `tutorial6b.py`; everything else is identical to the ferromagnetic case.
For the antiferromagnet the uniform susceptibility remains finite as $T\to 0$ (a signature of the spin-liquid ground state of the 1D antiferromagnet), while the specific-heat peak shifts and broadens differently.
@@ -93,8 +93,8 @@ For the antiferromagnet the uniform susceptibility remains finite as $T\to 0$ (a
### Simulating the 3D quantum Heisenberg antiferromagnet
-The parameter file `parm6c` sets up a QWL simulation of the $S=\frac{1}{2}$ Heisenberg antiferromagnet on a simple cubic lattice with $4^3=64$ sites.
-The Python script is `tutorial6c.py`.
+The parameter file `parm6c` sets up a QWL simulation of the $S=\frac{1}{2}$ Heisenberg antiferromagnet on a simple cubic lattice with $4^3=64$ sites.
+The Python script is `tutorial6c.py`.
Run and evaluate exactly as for the chain above.
The staggered structure factor $S(\pi,\pi,\pi)$ should start rising steeply near $T\approx 1$, signaling the onset of antiferromagnetic correlations.
@@ -105,7 +105,7 @@ The specific heat shows a corresponding peak and the entropy decreases rapidly i
Finite-size scaling predicts that the staggered structure factor at the critical point scales as $S(L) \propto L^{2-\eta}$ with $\eta \approx 0.034$ (3D classical Heisenberg universality class).
A plot of $S(L)/L^{2-\eta}$ vs. temperature should show curves for different $L$ crossing at the critical temperature $T_c$.
-The parameter file `parm6d` (or `tutorial6d.py`) runs the cubic antiferromagnet for two system sizes ($L=4$ and $L=6$) with a larger `CUTOFF=1000` to maintain accuracy at lower temperatures.
+The parameter file `parm6d` (or `tutorial6d.py`) runs the cubic antiferromagnet for two system sizes ($L=4$ and $L=6$) with a larger `CUTOFF=1000` to maintain accuracy at lower temperatures.
After running, load the results:
```python
diff --git a/content/en/tutorials/mcs/mc07.md b/content/en/tutorials/mcs/mc07.md
index a3c6d420..1b3b8dce 100644
--- a/content/en/tutorials/mcs/mc07.md
+++ b/content/en/tutorials/mcs/mc07.md
@@ -19,7 +19,7 @@ Start the fine-grid simulations now so they run while you work through the rest
### Command line
-Download `parm7b` and run:
+Download `parm7b` and run:
```
parameter2xml parm7b
@@ -30,7 +30,7 @@ The `--Tmin 10` flag sets a checkpoint interval of 10 seconds, allowing the simu
### Python
-The first part of `tutorial7b.py` sets up and launches the same simulation:
+The first part of `tutorial7b.py` sets up and launches the same simulation:
```Python
import pyalps
@@ -65,7 +65,7 @@ We first make a coarse temperature scan on small systems to locate the critical
### Command line
-Download `parm7a` and run:
+Download `parm7a` and run:
```
parameter2xml parm7a
@@ -74,7 +74,7 @@ spinmc --Tmin 5 parm7a.in.xml
### Python
-Using `tutorial7a.py`:
+Using `tutorial7a.py`:
```Python
import pyalps
diff --git a/content/en/tutorials/mcs/mc08.md b/content/en/tutorials/mcs/mc08.md
index 092a4886..c9c7cde5 100644
--- a/content/en/tutorials/mcs/mc08.md
+++ b/content/en/tutorials/mcs/mc08.md
@@ -38,7 +38,7 @@ Start it now so it runs in the background while you work through the rest of the
### Command line
-Download `parm8b` and run:
+Download `parm8b` and run:
```
parameter2xml parm8b
@@ -47,20 +47,20 @@ loop parm8b.in.xml &
### Python
-Run the first part of `tutorial8b.py` (the setup and `pyalps.runApplication` call) in a separate terminal or as a background process before continuing.
+Run the first part of `tutorial8b.py` (the setup and `pyalps.runApplication` call) in a separate terminal or as a background process before continuing.
## Identify the different phases
We begin by considering the two simple limits: decoupled ladders ($J_2=0$) and the isotropic square lattice ($J_2=1$). The decoupled ladders have a ground state with short-range correlations and exhibit a finite spin gap: this is a spin liquid phase. The square lattice, by contrast, displays long-range order with a finite staggered magnetization: this is an antiferromagnetic Néel phase.
-A clear way to probe these two phases is through the magnetic susceptibility $\chi$. Simulate an $8\times 8$ system over a range of temperatures for both cases and compare the results. For decoupled ladders the susceptibility exhibits activated behavior at low temperature due to the spin gap; on the square lattice it tends to a finite constant as $T\to 0$. Note that on any finite system $\chi$ will eventually tend to zero at low enough temperature due to the finite-size gap, but this is not our focus here. Run the simulation on the command line with parameter file `parm8a`:
+A clear way to probe these two phases is through the magnetic susceptibility $\chi$. Simulate an $8\times 8$ system over a range of temperatures for both cases and compare the results. For decoupled ladders the susceptibility exhibits activated behavior at low temperature due to the spin gap; on the square lattice it tends to a finite constant as $T\to 0$. Note that on any finite system $\chi$ will eventually tend to zero at low enough temperature due to the finite-size gap, but this is not our focus here. Run the simulation on the command line with parameter file `parm8a`:
```
parameter2xml parm8a
loop parm8a.in.xml
```
-or with the Python script `tutorial8a.py`.
+or with the Python script `tutorial8a.py`.
```Python
import pyalps
@@ -201,7 +201,7 @@ Both observables crossing (rather than one diverging) confirms that the transiti
You have obtained a rough estimate of the quantum critical point $J_2^c$. As in the classical case, extracting the critical exponents requires a more precise determination of $J_2^c$.
-This is done by running larger system sizes on a finer grid of $J_2$ values, as set up in `parm8d` and `tutorial8d.py`. Note that these simulations are CPU-intensive and are left as an exercise. Plot the Binder cumulant $U_4$ and the rescaled stiffness $\rho_s L$ for different system sizes; the crossing point gives a refined estimate of $J_2^c$. To extract $\nu$, consider how the derivatives of these quantities with respect to $J_2$, evaluated at $J_2^c$, scale with system size. These derivatives can in principle be measured directly in the Monte Carlo, but for this tutorial it is sufficient to compute them by numerical differentiation using the fine $J_2$ grid.
+This is done by running larger system sizes on a finer grid of $J_2$ values, as set up in `parm8d` and `tutorial8d.py`. Note that these simulations are CPU-intensive and are left as an exercise. Plot the Binder cumulant $U_4$ and the rescaled stiffness $\rho_s L$ for different system sizes; the crossing point gives a refined estimate of $J_2^c$. To extract $\nu$, consider how the derivatives of these quantities with respect to $J_2$, evaluated at $J_2^c$, scale with system size. These derivatives can in principle be measured directly in the Monte Carlo, but for this tutorial it is sufficient to compute them by numerical differentiation using the fine $J_2$ grid.
Perform the numerical differentiations for the different system sizes for both quantities, and plot their values at $J_2^c$ as a function of system size. Data should scale as a power law:
@@ -225,7 +225,7 @@ When $J_2$ is very large, the inter-ladder coupling dominates over the intra-lad
This is again a gapped spin liquid phase, so the phase diagram has the structure: spin liquid → Néel AFM → spin liquid as $J_2$ increases from 0 to large values.
There must therefore be a second quantum critical point $J_2^{c_2}$ at which the Néel order is destroyed.
-We repeat the finite-size scaling analysis in the parameter regime $J_2 \in [1.8, 2.1]$ using the parameter file `parm8c` or the script `tutorial8c.py`, which use the same system sizes and $\beta=2L$ as `parm8b` but scan the higher-$J_2$ range.
+We repeat the finite-size scaling analysis in the parameter regime $J_2 \in [1.8, 2.1]$ using the parameter file `parm8c` or the script `tutorial8c.py`, which use the same system sizes and $\beta=2L$ as `parm8b` but scan the higher-$J_2$ range.
### Command line
diff --git a/content/ja/tutorials/mcs/mc01a.md b/content/ja/tutorials/mcs/mc01a.md
index 162abc8d..9c016b62 100644
--- a/content/ja/tutorials/mcs/mc01a.md
+++ b/content/ja/tutorials/mcs/mc01a.md
@@ -23,7 +23,7 @@ This tutorial can be run either on the command line or in Python. We recommend t
### Setting up and running the simulation on the command line
-To set up and run the simulation on the command line, we first create a parameter file that specifies the parameters of the simulation(s). The downloadable file will be titled `parm1a`, with the following contents:
+To set up and run the simulation on the command line, we first create a parameter file that specifies the parameters of the simulation(s). The downloadable file will be titled `parm1a`, with the following contents:
```
LATTICE="square lattice"
@@ -100,7 +100,7 @@ Look at all six tasks and, by studying the binning analysis in the files `parm1a
The `pyalps` package is a wrapper for ALPS: All it does is call the commands described in the previous section as if they were run in a terminal. It is superior for plotting because the output of the simulation can be read directly into a Python data structure and accessed by `matplotlib`, and it also comes with a wrapper `pyalps.plot` for certain matplotlib functions to neatly plot data generated by `pyalps`.
-To set up and run the simulation in Python, we create a script named `tutorial1a.py`. The first part of this script must import the required modules and prepare the input job and task files. Instead of writing a parameter file and using `convert2xml`, we store a list containing each task's parameters as a dictionary, like so:
+To set up and run the simulation in Python, we create a script named `tutorial1a.py`. The first part of this script must import the required modules and prepare the input job and task files. Instead of writing a parameter file and using `convert2xml`, we store a list containing each task's parameters as a dictionary, like so:
```Python
import pyalps
@@ -197,7 +197,7 @@ We therefore repeat the simulations with cluster updates, using fewer thermaliza
### Command line
-The downloadable parameter file `parm1b` has the following contents:
+The downloadable parameter file `parm1b` has the following contents:
```
LATTICE="square lattice"
@@ -224,7 +224,7 @@ spinmc --Tmin 10 --write-xml parm1b.in.xml
### Python
-The script `tutorial1b.py` follows the same structure as `tutorial1a.py`, with the updated parameters and `parm1b` as the file prefix:
+The script `tutorial1b.py` follows the same structure as `tutorial1a.py`, with the updated parameters and `parm1b` as the file prefix:
```Python
import pyalps
diff --git a/content/ja/tutorials/mcs/mc01b.md b/content/ja/tutorials/mcs/mc01b.md
index e9583814..e13351ad 100644
--- a/content/ja/tutorials/mcs/mc01b.md
+++ b/content/ja/tutorials/mcs/mc01b.md
@@ -22,7 +22,7 @@ Both are checked by inspecting the time series of a measured observable — in t
### Preparing and running the simulation on the command line
-The parameter file `parm1a` sets up a single simulation of the Ising model on a $48 \times 48$ square lattice at the critical temperature:
+The parameter file `parm1a` sets up a single simulation of the Ising model on a $48 \times 48$ square lattice at the critical temperature:
```
LATTICE="square lattice"
@@ -44,7 +44,7 @@ spinmc --Tmin 10 --write-xml parm1a.in.xml
### Preparing and running the simulation in Python
-The full script is available as `tutorial1a.py`.
+The full script is available as `tutorial1a.py`.
It begins by importing the required modules and defining the simulation parameters:
```Python
diff --git a/content/ja/tutorials/mcs/mc02.md b/content/ja/tutorials/mcs/mc02.md
index cad2a240..0bc0fcd0 100644
--- a/content/ja/tutorials/mcs/mc02.md
+++ b/content/ja/tutorials/mcs/mc02.md
@@ -20,7 +20,7 @@ The comparison highlights two key contrasts: how quantum fluctuations modify the
#### Setting up and running on the command line
-The parameter file `parm2a` sets up simulations of the classical ferromagnetic Heisenberg model on a chain of 60 sites across a range of temperatures:
+The parameter file `parm2a` sets up simulations of the classical ferromagnetic Heisenberg model on a chain of 60 sites across a range of temperatures:
```
LATTICE="chain lattice"
@@ -56,7 +56,7 @@ spinmc --Tmin 10 --write-xml parm2a.in.xml
#### Setting up and running in Python
-The script `tutorial2a.py` sets up and runs the same simulation. Place it in the same folder as `parm2a`:
+The script `tutorial2a.py` sets up and runs the same simulation. Place it in the same folder as `parm2a`:
```Python
import pyalps
@@ -110,7 +110,7 @@ Aside from the lattice change and the two couplings, the simulation setup is ide
#### Setting up and running on the command line
-Download `parm2b` and place it in the same folder:
+Download `parm2b` and place it in the same folder:
```
LATTICE="ladder"
@@ -147,7 +147,7 @@ spinmc --Tmin 10 --write-xml parm2b.in.xml
#### Setting up and running in Python
-The script `tutorial2b.py` is a copy of `tutorial2a.py` with three changes: the prefix renamed to `parm2b`, `LATTICE` set to `"ladder"`, and `J` replaced by `J0` and `J1` (both `-1`).
+The script `tutorial2b.py` is a copy of `tutorial2a.py` with three changes: the prefix renamed to `parm2b`, `LATTICE` set to `"ladder"`, and `J` replaced by `J0` and `J1` (both `-1`).
## Quantum Heisenberg models
@@ -162,7 +162,7 @@ The key parameter changes from the classical case are:
#### Setting up and running on the command line
-Download `parm2c`:
+Download `parm2c`:
```
LATTICE="chain lattice"
@@ -200,7 +200,7 @@ loop parm2c.in.xml
#### Setting up and running in Python
-The script `tutorial2c.py` adapts `tutorial2a.py` to the quantum parameters and calls `loop` instead of `spinmc`:
+The script `tutorial2c.py` adapts `tutorial2a.py` to the quantum parameters and calls `loop` instead of `spinmc`:
```Python
input_file = pyalps.writeInputFiles('parm2c', parms)
@@ -214,7 +214,7 @@ Unlike the gapless chain, the two-leg antiferromagnetic Heisenberg ladder has a
#### Setting up and running on the command line
-Download `parm2d`:
+Download `parm2d`:
```
LATTICE="ladder"
@@ -248,11 +248,11 @@ loop parm2d.in.xml
#### Setting up and running in Python
-The script `tutorial2d.py` adapts `tutorial2c.py`: rename the prefix to `parm2d`, change `LATTICE` to `"ladder"`, and replace `J` with `J0` and `J1` (both `1`).
+The script `tutorial2d.py` adapts `tutorial2c.py`: rename the prefix to `parm2d`, change `LATTICE` to `"ladder"`, and replace `J` with `J0` and `J1` (both `1`).
## Combining all four simulations
-After running all four simulations in the same folder, the script `tutorial2full.py` loads all results together and overlays them on a single plot.
+After running all four simulations in the same folder, the script `tutorial2full.py` loads all results together and overlays them on a single plot.
```Python
import pyalps
diff --git a/content/ja/tutorials/mcs/mc03.md b/content/ja/tutorials/mcs/mc03.md
index 191169b9..b374abc3 100644
--- a/content/ja/tutorials/mcs/mc03.md
+++ b/content/ja/tutorials/mcs/mc03.md
@@ -14,7 +14,7 @@ In this tutorial we will look at magnetization curves of quantum spin models usi
#### Preparing and running the simulation from the command line
-The parameter file `parm3a` sets up Monte Carlo simulations of the quantum mechanical S=1/2 Heisenberg model on a one-dimensional chain with 20 sites at fixed temperature T=0.08 for a couple of magnetic fields (h=0, 0.1, ..., 2.5).
+The parameter file `parm3a` sets up Monte Carlo simulations of the quantum mechanical S=1/2 Heisenberg model on a one-dimensional chain with 20 sites at fixed temperature T=0.08 for a couple of magnetic fields (h=0, 0.1, ..., 2.5).
```Python
LATTICE="chain lattice"
@@ -55,7 +55,7 @@ dirloop_sse --Tmin 10 --write-xml parm3a.in.xml
#### Preparing and running the simulation using Python
-Setting up and running the simulation in Python is as before, with the script `tutorial3a.py`:
+Setting up and running the simulation in Python is as before, with the script `tutorial3a.py`:
```Python
import pyalps
@@ -107,7 +107,7 @@ plt.show()
### One-dimensional Heisenberg ladder in a magnetic field
-The parameter file `parm3b` sets up Monte Carlo simulations of the quantum mechanical S=1/2 Heisenberg model on a one-dimensional ladder with 40 sites at fixed temperature T=0.08 for a couple of magnetic fields (h=0, 0.1, ..., 3.5).
+The parameter file `parm3b` sets up Monte Carlo simulations of the quantum mechanical S=1/2 Heisenberg model on a one-dimensional ladder with 40 sites at fixed temperature T=0.08 for a couple of magnetic fields (h=0, 0.1, ..., 3.5).
```Python
LATTICE="ladder"
@@ -119,11 +119,11 @@ J1=1
T=0.08
```
-The rest of the input file is as above and simulations are run in the same way. The corresponding script is downloadable here.
+The rest of the input file is as above and simulations are run in the same way. The corresponding script is downloadable here.
### Combining all simulations
-The procedure to combine all results into one plot after running both simulations is extremely similar to the previous tutorial. The script is downloadable here. Here is the combined plot:
+The procedure to combine all results into one plot after running both simulations is extremely similar to the previous tutorial. The script is downloadable here. Here is the combined plot:

diff --git a/content/ja/tutorials/mcs/mc04.md b/content/ja/tutorials/mcs/mc04.md
index 4d6dbe8a..148b69eb 100644
--- a/content/ja/tutorials/mcs/mc04.md
+++ b/content/ja/tutorials/mcs/mc04.md
@@ -14,7 +14,7 @@ In this tutorial, we will measure correlation functions with the directed loop a
#### Preparing and running the simulation from the command line
-The parameter file `parm4` sets up Monte Carlo simulations of the quantum mechanical S=1/2 Heisenberg model on a square lattice, and enables various measurement options:
+The parameter file `parm4` sets up Monte Carlo simulations of the quantum mechanical S=1/2 Heisenberg model on a square lattice, and enables various measurement options:
```
MODEL="spin";
@@ -41,7 +41,7 @@ dirloop_sse --Tmin 10 --write-xml parm4.in.xml
#### Preparing and running the simulation using Python
-To set up and run the simulation in Python we use the script `tutorial4.py`:
+To set up and run the simulation in Python we use the script `tutorial4.py`:
```
import pyalps
diff --git a/content/ja/tutorials/mcs/mc05.md b/content/ja/tutorials/mcs/mc05.md
index 79f4a8a3..6fb34b1e 100644
--- a/content/ja/tutorials/mcs/mc05.md
+++ b/content/ja/tutorials/mcs/mc05.md
@@ -14,7 +14,7 @@ As an example of the worm QMC code, we will study a quantum phase transition in
#### Preparing and running the simulation from the command line
-The parameter file `parm5a` with the following contents sets up Monte Carlo simulations of the quantum Bose Hubbard model on a square lattice with 4x4 sites for a couple of hopping parameters (t=0.01, 0.02, ..., 0.1) using the worm code.
+The parameter file `parm5a` with the following contents sets up Monte Carlo simulations of the quantum Bose Hubbard model on a square lattice with 4x4 sites for a couple of hopping parameters (t=0.01, 0.02, ..., 0.1) using the worm code.
```
LATTICE="square lattice";
@@ -39,7 +39,7 @@ THERMALIZATION=10000;
{ t=0.1; }
```
-The corresponding Python script is found at `tutorial5a.py`.
+The corresponding Python script is found at `tutorial5a.py`.
#### Evaluating the simulation and preparing plots using Python
@@ -70,7 +70,7 @@ We next want to pin down the location of the phase transition more accurately. F
#### Preparing and running the simulation from the command line
-In the parameter file `parm5b` we focus on the region around the critical point for three system sizes L=4, 6, and 8:
+In the parameter file `parm5b` we focus on the region around the critical point for three system sizes L=4, 6, and 8:
```
LATTICE="square lattice";
@@ -105,7 +105,7 @@ THERMALIZATION=150000;
{ L=8; t=0.065; }
```
-The corresponding Python script is found at `tutorial5b.py`.
+The corresponding Python script is found at `tutorial5b.py`.
#### Evaluating the simulation using Python
diff --git a/content/ja/tutorials/mcs/mc06.md b/content/ja/tutorials/mcs/mc06.md
index cca44f63..50d7601b 100644
--- a/content/ja/tutorials/mcs/mc06.md
+++ b/content/ja/tutorials/mcs/mc06.md
@@ -16,7 +16,7 @@ We will start with a quick tutorial on using the ALPS qwl code for a spin chain.
#### Using the command line
-The parameter file `parm6a` sets up a Monte Carlo simulation of the quantum mechanical Heisenberg ferromagnet on a one-dimensional chain with 40 sites, using the quantum Wang-Landau (QWL) method.
+The parameter file `parm6a` sets up a Monte Carlo simulation of the quantum mechanical Heisenberg ferromagnet on a one-dimensional chain with 40 sites, using the quantum Wang-Landau (QWL) method.
```
LATTICE="chain lattice"
@@ -70,7 +70,7 @@ Similarly the tool `plot2gp` produces Gnuplot scripts and `plot2text` converts t
#### Using Python
-To set up and run the simulation in Python we use the script `tutorial6a.py`, which imports modules, prepares the parameters, and runs the simulation as usual. Then, it runs the evaluation program on all output files
+To set up and run the simulation in Python we use the script `tutorial6a.py`, which imports modules, prepares the parameters, and runs the simulation as usual. Then, it runs the evaluation program on all output files
```
data = pyalps.evaluateQWL(pyalps.getResultFiles(prefix='parm6a'),DELTA_T=0.1, T_MIN=0.1, T_MAX=10.0)
@@ -88,7 +88,7 @@ for s in pyalps.flatten(data):
### The antiferromagnetic Heisenberg chain
-To simulate the antiferromagnetic chain, we prepare new simulations setting J=1 instead of J=-1. The parameters should be in `parm6b`, the Python script in `tutorial6b.py`.
+To simulate the antiferromagnetic chain, we prepare new simulations setting J=1 instead of J=-1. The parameters should be in `parm6b`, the Python script in `tutorial6b.py`.
#### Questions
@@ -102,7 +102,7 @@ To simulate the antiferromagnetic chain, we prepare new simulations setting J=1
### Simulating the 3D quantum Heisenberg antiferromegnet
-The parameter file `parm6c` should set up a Monte Carlo simulation of the quantum mechanical Heisenberg antiferromagnet on a three-dimensional simple cubic lattice with $4^3$ sites, using the QWL method. The Python script should be `tutorial6c.py`.
+The parameter file `parm6c` should set up a Monte Carlo simulation of the quantum mechanical Heisenberg antiferromagnet on a three-dimensional simple cubic lattice with $4^3$ sites, using the QWL method. The Python script should be `tutorial6c.py`.
The simulations are set up and run as above.
#### Questions
@@ -112,7 +112,7 @@ The simulations are set up and run as above.
### Finite size scaling analysis to determine the critical point
-Finite size scaling theory predics the staggered structure factor $S(L)$ for this transition to scale at the critical point as $L^{2-\eta}$, where $\eta\approx 0.034$. A scaling plot of $S(L)/L^{2-\eta}$ vs. temperature is expected to show a crossing of curves for different linear system sizes L at the critical temperature $T_c$. In order to produce such a scaling plot, we set up a further simulation of the cubic antiferromagnet, for a larger system with $L=4$ and a cutoff at 1000, in the parameter file `parm6d` or the Python script `tutorial6d.py`.
+Finite size scaling theory predics the staggered structure factor $S(L)$ for this transition to scale at the critical point as $L^{2-\eta}$, where $\eta\approx 0.034$. A scaling plot of $S(L)/L^{2-\eta}$ vs. temperature is expected to show a crossing of curves for different linear system sizes L at the critical temperature $T_c$. In order to produce such a scaling plot, we set up a further simulation of the cubic antiferromagnet, for a larger system with $L=4$ and a cutoff at 1000, in the parameter file `parm6d` or the Python script `tutorial6d.py`.
Evaluation now requires multiplication of the results with $L^{2-\eta}$ which is easiest done in Python. After running the simulation we first load the results:
```
diff --git a/content/ja/tutorials/mcs/mc07.md b/content/ja/tutorials/mcs/mc07.md
index d6848798..63f895cf 100644
--- a/content/ja/tutorials/mcs/mc07.md
+++ b/content/ja/tutorials/mcs/mc07.md
@@ -12,14 +12,14 @@ The goal of this tutorial is to learn how to detect a second-order phase transit
Almost everything is known about the phase transition in the 2d Ising model since it is exactly solvable. In this tutotial, we will try to recover the location of the critical point, as well as critical exponents as if we would not know them in order to illustrate the methods. To make precise estimations requires quite some time. For this let us start the final simulation parameters in the background while doing the first part of the tutorial.
-You can start the second simulation in the background with the parameter file `parm7b` and type:
+You can start the second simulation in the background with the parameter file `parm7b` and type:
```
parameter2xml parm7b
spinmc --Tmin 10 parm7b.in.xml &
```
-or run the first part of `tutorial7b.py`:
+or run the first part of `tutorial7b.py`:
```
import pyalps
@@ -59,14 +59,14 @@ pyalps.runApplication('spinmc',input_file,Tmin=5)
## Locate roughly the phase transition
-First, we make a rough temperature scan on small systems, in order to locate roughly the critical range. We use the parameter file `parm7a` and the command
+First, we make a rough temperature scan on small systems, in order to locate roughly the critical range. We use the parameter file `parm7a` and the command
```
parameter2xml parm7a
spinmc --Tmin 5 parm7a.in.xml
```
-Alternatively, we can run the simulations in Python with the file `tutorial7a.py`:
+Alternatively, we can run the simulations in Python with the file `tutorial7a.py`:
```
import pyalps
diff --git a/content/ja/tutorials/mcs/mc08.md b/content/ja/tutorials/mcs/mc08.md
index 9289a8e7..caa8a66a 100644
--- a/content/ja/tutorials/mcs/mc08.md
+++ b/content/ja/tutorials/mcs/mc08.md
@@ -12,14 +12,14 @@ In this tutorial we will learn how to detect quantum critical points in a quantu
First of all, we consider the two simple limits of decoupled ladders ($J_2=0$) and of the isotropic square lattice ($J_2=1$). The decoupled ladders have a ground-state with short-range correlations and exhibit a finite spin gap: this is a spin liquid phase. On the other hand, the square lattice displays long-range order with a finite staggered magnetization: this is an antiferromagnetic Néel phase.
-A simple and illustrative way of probing these two different physics is by looking at the magnetic susceptibility $\chi$. Let us simulate an 8x8 system using the following set of temperatures in the two different cases. Plot and compare the magnetic susceptibility in both the decoupled ($J_2=0$) and isotropic ($J_2=1$) situations. For decoupled ladders, the susceptibility exhibits an activated behaviour at low temperature due to the presence of the spin gap, whereas on the square lattice the susceptibility tends to a constant at low T. Please note that on a finite system, $\chi$ will always eventually tend to zero at small enough temperature due to the presence of a finite-size gap - this is however not our topic of interest here. You can run the simulation on the command line using a parameter file `parm8a`:
+A simple and illustrative way of probing these two different physics is by looking at the magnetic susceptibility $\chi$. Let us simulate an 8x8 system using the following set of temperatures in the two different cases. Plot and compare the magnetic susceptibility in both the decoupled ($J_2=0$) and isotropic ($J_2=1$) situations. For decoupled ladders, the susceptibility exhibits an activated behaviour at low temperature due to the presence of the spin gap, whereas on the square lattice the susceptibility tends to a constant at low T. Please note that on a finite system, $\chi$ will always eventually tend to zero at small enough temperature due to the presence of a finite-size gap - this is however not our topic of interest here. You can run the simulation on the command line using a parameter file `parm8a`:
```
parameter2xml parm8a
loop parm8a.in.xml
```
-or by creating a python script `tutorial8a.py`.
+or by creating a python script `tutorial8a.py`.
```Python
import pyalps
@@ -92,7 +92,7 @@ plt.show()
## Locate the phase transition
-Having identified two different phases at $J_2=0$ and $J_2=1$, there must be (at least) one quantum phase transition separating them. We scan the coupling range $J_2 \in [0.2,0.4]$ for system sizes $L=8,10,12,16$ and simulate the model at an inverse temperate $\beta=2L$ using the parameter-file `parm8b` or the python script `tutorial8b.py`:
+Having identified two different phases at $J_2=0$ and $J_2=1$, there must be (at least) one quantum phase transition separating them. We scan the coupling range $J_2 \in [0.2,0.4]$ for system sizes $L=8,10,12,16$ and simulate the model at an inverse temperate $\beta=2L$ using the parameter-file `parm8b` or the python script `tutorial8b.py`:
```python
import pyalps
@@ -170,7 +170,7 @@ Second, why did we choose inverse temperature $\beta$ to be proportionnal to $L$
You have obtained a rough estimate of the quantum critical point $J_2^c$. As in the classical case, extracting the critical exponents require more work and in particular a more precise determination of $J_2^c$.
-We will obtain one by considering larger system sizes on a finer grid of $J_2^c$. The parameters for this should be specified in `parm8d` and the script in `tutorial8d.py`. Please note that these simulations will take quite some CPU time and we therefore leave it to you as an exercise. Plot again the Binder cumulant of the staggered magnetization $U_4$ as well as the stiffness multiplied by system size $\rho_s L$ for different system sizes. The crossings of these curves should allow a more precise estimate of $J_2^c$. To obtain the critical exponent $\nu$ related to the divergence of the correlation length, it is useful to consider the scaling with system size of the derivative (with respect to $J_2^c$) of these quantities, when taken precisely at $J_2^c$. These derivatives $\frac{dU_4}{d J_2}$ and $L \frac{d\rho_s}{d J_2}$ can be obtained in principle as a Monte Carlo measurement, however for this tutorial, it is sufficient to perform a numerical differentiation which is possible thanks to the fine grid in $J_2$.
+We will obtain one by considering larger system sizes on a finer grid of $J_2^c$. The parameters for this should be specified in `parm8d` and the script in `tutorial8d.py`. Please note that these simulations will take quite some CPU time and we therefore leave it to you as an exercise. Plot again the Binder cumulant of the staggered magnetization $U_4$ as well as the stiffness multiplied by system size $\rho_s L$ for different system sizes. The crossings of these curves should allow a more precise estimate of $J_2^c$. To obtain the critical exponent $\nu$ related to the divergence of the correlation length, it is useful to consider the scaling with system size of the derivative (with respect to $J_2^c$) of these quantities, when taken precisely at $J_2^c$. These derivatives $\frac{dU_4}{d J_2}$ and $L \frac{d\rho_s}{d J_2}$ can be obtained in principle as a Monte Carlo measurement, however for this tutorial, it is sufficient to perform a numerical differentiation which is possible thanks to the fine grid in $J_2$.
Perform the numerical differentiations for the different system sizes for both quantities, and plot their values at $J_2^c$ as a function of system size. Data should scale as a power law : $\frac{dU_4}{d J_2}(J_2^c) \propto L \frac{d\rho_s}{d J_2}(J_2^c) \propto L^{1/\nu}$. Which value of $\nu$ do you obtain?
diff --git a/content/zh-cn/tutorials/mcs/mc01a.md b/content/zh-cn/tutorials/mcs/mc01a.md
index 162abc8d..9c016b62 100644
--- a/content/zh-cn/tutorials/mcs/mc01a.md
+++ b/content/zh-cn/tutorials/mcs/mc01a.md
@@ -23,7 +23,7 @@ This tutorial can be run either on the command line or in Python. We recommend t
### Setting up and running the simulation on the command line
-To set up and run the simulation on the command line, we first create a parameter file that specifies the parameters of the simulation(s). The downloadable file will be titled `parm1a`, with the following contents:
+To set up and run the simulation on the command line, we first create a parameter file that specifies the parameters of the simulation(s). The downloadable file will be titled `parm1a`, with the following contents:
```
LATTICE="square lattice"
@@ -100,7 +100,7 @@ Look at all six tasks and, by studying the binning analysis in the files `parm1a
The `pyalps` package is a wrapper for ALPS: All it does is call the commands described in the previous section as if they were run in a terminal. It is superior for plotting because the output of the simulation can be read directly into a Python data structure and accessed by `matplotlib`, and it also comes with a wrapper `pyalps.plot` for certain matplotlib functions to neatly plot data generated by `pyalps`.
-To set up and run the simulation in Python, we create a script named `tutorial1a.py`. The first part of this script must import the required modules and prepare the input job and task files. Instead of writing a parameter file and using `convert2xml`, we store a list containing each task's parameters as a dictionary, like so:
+To set up and run the simulation in Python, we create a script named `tutorial1a.py`. The first part of this script must import the required modules and prepare the input job and task files. Instead of writing a parameter file and using `convert2xml`, we store a list containing each task's parameters as a dictionary, like so:
```Python
import pyalps
@@ -197,7 +197,7 @@ We therefore repeat the simulations with cluster updates, using fewer thermaliza
### Command line
-The downloadable parameter file `parm1b` has the following contents:
+The downloadable parameter file `parm1b` has the following contents:
```
LATTICE="square lattice"
@@ -224,7 +224,7 @@ spinmc --Tmin 10 --write-xml parm1b.in.xml
### Python
-The script `tutorial1b.py` follows the same structure as `tutorial1a.py`, with the updated parameters and `parm1b` as the file prefix:
+The script `tutorial1b.py` follows the same structure as `tutorial1a.py`, with the updated parameters and `parm1b` as the file prefix:
```Python
import pyalps
diff --git a/content/zh-cn/tutorials/mcs/mc01b.md b/content/zh-cn/tutorials/mcs/mc01b.md
index e9583814..e13351ad 100644
--- a/content/zh-cn/tutorials/mcs/mc01b.md
+++ b/content/zh-cn/tutorials/mcs/mc01b.md
@@ -22,7 +22,7 @@ Both are checked by inspecting the time series of a measured observable — in t
### Preparing and running the simulation on the command line
-The parameter file `parm1a` sets up a single simulation of the Ising model on a $48 \times 48$ square lattice at the critical temperature:
+The parameter file `parm1a` sets up a single simulation of the Ising model on a $48 \times 48$ square lattice at the critical temperature:
```
LATTICE="square lattice"
@@ -44,7 +44,7 @@ spinmc --Tmin 10 --write-xml parm1a.in.xml
### Preparing and running the simulation in Python
-The full script is available as `tutorial1a.py`.
+The full script is available as `tutorial1a.py`.
It begins by importing the required modules and defining the simulation parameters:
```Python
diff --git a/content/zh-cn/tutorials/mcs/mc02.md b/content/zh-cn/tutorials/mcs/mc02.md
index cad2a240..0bc0fcd0 100644
--- a/content/zh-cn/tutorials/mcs/mc02.md
+++ b/content/zh-cn/tutorials/mcs/mc02.md
@@ -20,7 +20,7 @@ The comparison highlights two key contrasts: how quantum fluctuations modify the
#### Setting up and running on the command line
-The parameter file `parm2a` sets up simulations of the classical ferromagnetic Heisenberg model on a chain of 60 sites across a range of temperatures:
+The parameter file `parm2a` sets up simulations of the classical ferromagnetic Heisenberg model on a chain of 60 sites across a range of temperatures:
```
LATTICE="chain lattice"
@@ -56,7 +56,7 @@ spinmc --Tmin 10 --write-xml parm2a.in.xml
#### Setting up and running in Python
-The script `tutorial2a.py` sets up and runs the same simulation. Place it in the same folder as `parm2a`:
+The script `tutorial2a.py` sets up and runs the same simulation. Place it in the same folder as `parm2a`:
```Python
import pyalps
@@ -110,7 +110,7 @@ Aside from the lattice change and the two couplings, the simulation setup is ide
#### Setting up and running on the command line
-Download `parm2b` and place it in the same folder:
+Download `parm2b` and place it in the same folder:
```
LATTICE="ladder"
@@ -147,7 +147,7 @@ spinmc --Tmin 10 --write-xml parm2b.in.xml
#### Setting up and running in Python
-The script `tutorial2b.py` is a copy of `tutorial2a.py` with three changes: the prefix renamed to `parm2b`, `LATTICE` set to `"ladder"`, and `J` replaced by `J0` and `J1` (both `-1`).
+The script `tutorial2b.py` is a copy of `tutorial2a.py` with three changes: the prefix renamed to `parm2b`, `LATTICE` set to `"ladder"`, and `J` replaced by `J0` and `J1` (both `-1`).
## Quantum Heisenberg models
@@ -162,7 +162,7 @@ The key parameter changes from the classical case are:
#### Setting up and running on the command line
-Download `parm2c`:
+Download `parm2c`:
```
LATTICE="chain lattice"
@@ -200,7 +200,7 @@ loop parm2c.in.xml
#### Setting up and running in Python
-The script `tutorial2c.py` adapts `tutorial2a.py` to the quantum parameters and calls `loop` instead of `spinmc`:
+The script `tutorial2c.py` adapts `tutorial2a.py` to the quantum parameters and calls `loop` instead of `spinmc`:
```Python
input_file = pyalps.writeInputFiles('parm2c', parms)
@@ -214,7 +214,7 @@ Unlike the gapless chain, the two-leg antiferromagnetic Heisenberg ladder has a
#### Setting up and running on the command line
-Download `parm2d`:
+Download `parm2d`:
```
LATTICE="ladder"
@@ -248,11 +248,11 @@ loop parm2d.in.xml
#### Setting up and running in Python
-The script `tutorial2d.py` adapts `tutorial2c.py`: rename the prefix to `parm2d`, change `LATTICE` to `"ladder"`, and replace `J` with `J0` and `J1` (both `1`).
+The script `tutorial2d.py` adapts `tutorial2c.py`: rename the prefix to `parm2d`, change `LATTICE` to `"ladder"`, and replace `J` with `J0` and `J1` (both `1`).
## Combining all four simulations
-After running all four simulations in the same folder, the script `tutorial2full.py` loads all results together and overlays them on a single plot.
+After running all four simulations in the same folder, the script `tutorial2full.py` loads all results together and overlays them on a single plot.
```Python
import pyalps
diff --git a/content/zh-cn/tutorials/mcs/mc03.md b/content/zh-cn/tutorials/mcs/mc03.md
index 191169b9..b374abc3 100644
--- a/content/zh-cn/tutorials/mcs/mc03.md
+++ b/content/zh-cn/tutorials/mcs/mc03.md
@@ -14,7 +14,7 @@ In this tutorial we will look at magnetization curves of quantum spin models usi
#### Preparing and running the simulation from the command line
-The parameter file `parm3a` sets up Monte Carlo simulations of the quantum mechanical S=1/2 Heisenberg model on a one-dimensional chain with 20 sites at fixed temperature T=0.08 for a couple of magnetic fields (h=0, 0.1, ..., 2.5).
+The parameter file `parm3a` sets up Monte Carlo simulations of the quantum mechanical S=1/2 Heisenberg model on a one-dimensional chain with 20 sites at fixed temperature T=0.08 for a couple of magnetic fields (h=0, 0.1, ..., 2.5).
```Python
LATTICE="chain lattice"
@@ -55,7 +55,7 @@ dirloop_sse --Tmin 10 --write-xml parm3a.in.xml
#### Preparing and running the simulation using Python
-Setting up and running the simulation in Python is as before, with the script `tutorial3a.py`:
+Setting up and running the simulation in Python is as before, with the script `tutorial3a.py`:
```Python
import pyalps
@@ -107,7 +107,7 @@ plt.show()
### One-dimensional Heisenberg ladder in a magnetic field
-The parameter file `parm3b` sets up Monte Carlo simulations of the quantum mechanical S=1/2 Heisenberg model on a one-dimensional ladder with 40 sites at fixed temperature T=0.08 for a couple of magnetic fields (h=0, 0.1, ..., 3.5).
+The parameter file `parm3b` sets up Monte Carlo simulations of the quantum mechanical S=1/2 Heisenberg model on a one-dimensional ladder with 40 sites at fixed temperature T=0.08 for a couple of magnetic fields (h=0, 0.1, ..., 3.5).
```Python
LATTICE="ladder"
@@ -119,11 +119,11 @@ J1=1
T=0.08
```
-The rest of the input file is as above and simulations are run in the same way. The corresponding script is downloadable here.
+The rest of the input file is as above and simulations are run in the same way. The corresponding script is downloadable here.
### Combining all simulations
-The procedure to combine all results into one plot after running both simulations is extremely similar to the previous tutorial. The script is downloadable here. Here is the combined plot:
+The procedure to combine all results into one plot after running both simulations is extremely similar to the previous tutorial. The script is downloadable here. Here is the combined plot:

diff --git a/content/zh-cn/tutorials/mcs/mc04.md b/content/zh-cn/tutorials/mcs/mc04.md
index 4d6dbe8a..148b69eb 100644
--- a/content/zh-cn/tutorials/mcs/mc04.md
+++ b/content/zh-cn/tutorials/mcs/mc04.md
@@ -14,7 +14,7 @@ In this tutorial, we will measure correlation functions with the directed loop a
#### Preparing and running the simulation from the command line
-The parameter file `parm4` sets up Monte Carlo simulations of the quantum mechanical S=1/2 Heisenberg model on a square lattice, and enables various measurement options:
+The parameter file `parm4` sets up Monte Carlo simulations of the quantum mechanical S=1/2 Heisenberg model on a square lattice, and enables various measurement options:
```
MODEL="spin";
@@ -41,7 +41,7 @@ dirloop_sse --Tmin 10 --write-xml parm4.in.xml
#### Preparing and running the simulation using Python
-To set up and run the simulation in Python we use the script `tutorial4.py`:
+To set up and run the simulation in Python we use the script `tutorial4.py`:
```
import pyalps
diff --git a/content/zh-cn/tutorials/mcs/mc05.md b/content/zh-cn/tutorials/mcs/mc05.md
index 79f4a8a3..6fb34b1e 100644
--- a/content/zh-cn/tutorials/mcs/mc05.md
+++ b/content/zh-cn/tutorials/mcs/mc05.md
@@ -14,7 +14,7 @@ As an example of the worm QMC code, we will study a quantum phase transition in
#### Preparing and running the simulation from the command line
-The parameter file `parm5a` with the following contents sets up Monte Carlo simulations of the quantum Bose Hubbard model on a square lattice with 4x4 sites for a couple of hopping parameters (t=0.01, 0.02, ..., 0.1) using the worm code.
+The parameter file `parm5a` with the following contents sets up Monte Carlo simulations of the quantum Bose Hubbard model on a square lattice with 4x4 sites for a couple of hopping parameters (t=0.01, 0.02, ..., 0.1) using the worm code.
```
LATTICE="square lattice";
@@ -39,7 +39,7 @@ THERMALIZATION=10000;
{ t=0.1; }
```
-The corresponding Python script is found at `tutorial5a.py`.
+The corresponding Python script is found at `tutorial5a.py`.
#### Evaluating the simulation and preparing plots using Python
@@ -70,7 +70,7 @@ We next want to pin down the location of the phase transition more accurately. F
#### Preparing and running the simulation from the command line
-In the parameter file `parm5b` we focus on the region around the critical point for three system sizes L=4, 6, and 8:
+In the parameter file `parm5b` we focus on the region around the critical point for three system sizes L=4, 6, and 8:
```
LATTICE="square lattice";
@@ -105,7 +105,7 @@ THERMALIZATION=150000;
{ L=8; t=0.065; }
```
-The corresponding Python script is found at `tutorial5b.py`.
+The corresponding Python script is found at `tutorial5b.py`.
#### Evaluating the simulation using Python
diff --git a/content/zh-cn/tutorials/mcs/mc06.md b/content/zh-cn/tutorials/mcs/mc06.md
index cca44f63..50d7601b 100644
--- a/content/zh-cn/tutorials/mcs/mc06.md
+++ b/content/zh-cn/tutorials/mcs/mc06.md
@@ -16,7 +16,7 @@ We will start with a quick tutorial on using the ALPS qwl code for a spin chain.
#### Using the command line
-The parameter file `parm6a` sets up a Monte Carlo simulation of the quantum mechanical Heisenberg ferromagnet on a one-dimensional chain with 40 sites, using the quantum Wang-Landau (QWL) method.
+The parameter file `parm6a` sets up a Monte Carlo simulation of the quantum mechanical Heisenberg ferromagnet on a one-dimensional chain with 40 sites, using the quantum Wang-Landau (QWL) method.
```
LATTICE="chain lattice"
@@ -70,7 +70,7 @@ Similarly the tool `plot2gp` produces Gnuplot scripts and `plot2text` converts t
#### Using Python
-To set up and run the simulation in Python we use the script `tutorial6a.py`, which imports modules, prepares the parameters, and runs the simulation as usual. Then, it runs the evaluation program on all output files
+To set up and run the simulation in Python we use the script `tutorial6a.py`, which imports modules, prepares the parameters, and runs the simulation as usual. Then, it runs the evaluation program on all output files
```
data = pyalps.evaluateQWL(pyalps.getResultFiles(prefix='parm6a'),DELTA_T=0.1, T_MIN=0.1, T_MAX=10.0)
@@ -88,7 +88,7 @@ for s in pyalps.flatten(data):
### The antiferromagnetic Heisenberg chain
-To simulate the antiferromagnetic chain, we prepare new simulations setting J=1 instead of J=-1. The parameters should be in `parm6b`, the Python script in `tutorial6b.py`.
+To simulate the antiferromagnetic chain, we prepare new simulations setting J=1 instead of J=-1. The parameters should be in `parm6b`, the Python script in `tutorial6b.py`.
#### Questions
@@ -102,7 +102,7 @@ To simulate the antiferromagnetic chain, we prepare new simulations setting J=1
### Simulating the 3D quantum Heisenberg antiferromegnet
-The parameter file `parm6c` should set up a Monte Carlo simulation of the quantum mechanical Heisenberg antiferromagnet on a three-dimensional simple cubic lattice with $4^3$ sites, using the QWL method. The Python script should be `tutorial6c.py`.
+The parameter file `parm6c` should set up a Monte Carlo simulation of the quantum mechanical Heisenberg antiferromagnet on a three-dimensional simple cubic lattice with $4^3$ sites, using the QWL method. The Python script should be `tutorial6c.py`.
The simulations are set up and run as above.
#### Questions
@@ -112,7 +112,7 @@ The simulations are set up and run as above.
### Finite size scaling analysis to determine the critical point
-Finite size scaling theory predics the staggered structure factor $S(L)$ for this transition to scale at the critical point as $L^{2-\eta}$, where $\eta\approx 0.034$. A scaling plot of $S(L)/L^{2-\eta}$ vs. temperature is expected to show a crossing of curves for different linear system sizes L at the critical temperature $T_c$. In order to produce such a scaling plot, we set up a further simulation of the cubic antiferromagnet, for a larger system with $L=4$ and a cutoff at 1000, in the parameter file `parm6d` or the Python script `tutorial6d.py`.
+Finite size scaling theory predics the staggered structure factor $S(L)$ for this transition to scale at the critical point as $L^{2-\eta}$, where $\eta\approx 0.034$. A scaling plot of $S(L)/L^{2-\eta}$ vs. temperature is expected to show a crossing of curves for different linear system sizes L at the critical temperature $T_c$. In order to produce such a scaling plot, we set up a further simulation of the cubic antiferromagnet, for a larger system with $L=4$ and a cutoff at 1000, in the parameter file `parm6d` or the Python script `tutorial6d.py`.
Evaluation now requires multiplication of the results with $L^{2-\eta}$ which is easiest done in Python. After running the simulation we first load the results:
```
diff --git a/content/zh-cn/tutorials/mcs/mc07.md b/content/zh-cn/tutorials/mcs/mc07.md
index d6848798..63f895cf 100644
--- a/content/zh-cn/tutorials/mcs/mc07.md
+++ b/content/zh-cn/tutorials/mcs/mc07.md
@@ -12,14 +12,14 @@ The goal of this tutorial is to learn how to detect a second-order phase transit
Almost everything is known about the phase transition in the 2d Ising model since it is exactly solvable. In this tutotial, we will try to recover the location of the critical point, as well as critical exponents as if we would not know them in order to illustrate the methods. To make precise estimations requires quite some time. For this let us start the final simulation parameters in the background while doing the first part of the tutorial.
-You can start the second simulation in the background with the parameter file `parm7b` and type:
+You can start the second simulation in the background with the parameter file `parm7b` and type:
```
parameter2xml parm7b
spinmc --Tmin 10 parm7b.in.xml &
```
-or run the first part of `tutorial7b.py`:
+or run the first part of `tutorial7b.py`:
```
import pyalps
@@ -59,14 +59,14 @@ pyalps.runApplication('spinmc',input_file,Tmin=5)
## Locate roughly the phase transition
-First, we make a rough temperature scan on small systems, in order to locate roughly the critical range. We use the parameter file `parm7a` and the command
+First, we make a rough temperature scan on small systems, in order to locate roughly the critical range. We use the parameter file `parm7a` and the command
```
parameter2xml parm7a
spinmc --Tmin 5 parm7a.in.xml
```
-Alternatively, we can run the simulations in Python with the file `tutorial7a.py`:
+Alternatively, we can run the simulations in Python with the file `tutorial7a.py`:
```
import pyalps
diff --git a/content/zh-cn/tutorials/mcs/mc08.md b/content/zh-cn/tutorials/mcs/mc08.md
index 9289a8e7..caa8a66a 100644
--- a/content/zh-cn/tutorials/mcs/mc08.md
+++ b/content/zh-cn/tutorials/mcs/mc08.md
@@ -12,14 +12,14 @@ In this tutorial we will learn how to detect quantum critical points in a quantu
First of all, we consider the two simple limits of decoupled ladders ($J_2=0$) and of the isotropic square lattice ($J_2=1$). The decoupled ladders have a ground-state with short-range correlations and exhibit a finite spin gap: this is a spin liquid phase. On the other hand, the square lattice displays long-range order with a finite staggered magnetization: this is an antiferromagnetic Néel phase.
-A simple and illustrative way of probing these two different physics is by looking at the magnetic susceptibility $\chi$. Let us simulate an 8x8 system using the following set of temperatures in the two different cases. Plot and compare the magnetic susceptibility in both the decoupled ($J_2=0$) and isotropic ($J_2=1$) situations. For decoupled ladders, the susceptibility exhibits an activated behaviour at low temperature due to the presence of the spin gap, whereas on the square lattice the susceptibility tends to a constant at low T. Please note that on a finite system, $\chi$ will always eventually tend to zero at small enough temperature due to the presence of a finite-size gap - this is however not our topic of interest here. You can run the simulation on the command line using a parameter file `parm8a`:
+A simple and illustrative way of probing these two different physics is by looking at the magnetic susceptibility $\chi$. Let us simulate an 8x8 system using the following set of temperatures in the two different cases. Plot and compare the magnetic susceptibility in both the decoupled ($J_2=0$) and isotropic ($J_2=1$) situations. For decoupled ladders, the susceptibility exhibits an activated behaviour at low temperature due to the presence of the spin gap, whereas on the square lattice the susceptibility tends to a constant at low T. Please note that on a finite system, $\chi$ will always eventually tend to zero at small enough temperature due to the presence of a finite-size gap - this is however not our topic of interest here. You can run the simulation on the command line using a parameter file `parm8a`:
```
parameter2xml parm8a
loop parm8a.in.xml
```
-or by creating a python script `tutorial8a.py`.
+or by creating a python script `tutorial8a.py`.
```Python
import pyalps
@@ -92,7 +92,7 @@ plt.show()
## Locate the phase transition
-Having identified two different phases at $J_2=0$ and $J_2=1$, there must be (at least) one quantum phase transition separating them. We scan the coupling range $J_2 \in [0.2,0.4]$ for system sizes $L=8,10,12,16$ and simulate the model at an inverse temperate $\beta=2L$ using the parameter-file `parm8b` or the python script `tutorial8b.py`:
+Having identified two different phases at $J_2=0$ and $J_2=1$, there must be (at least) one quantum phase transition separating them. We scan the coupling range $J_2 \in [0.2,0.4]$ for system sizes $L=8,10,12,16$ and simulate the model at an inverse temperate $\beta=2L$ using the parameter-file `parm8b` or the python script `tutorial8b.py`:
```python
import pyalps
@@ -170,7 +170,7 @@ Second, why did we choose inverse temperature $\beta$ to be proportionnal to $L$
You have obtained a rough estimate of the quantum critical point $J_2^c$. As in the classical case, extracting the critical exponents require more work and in particular a more precise determination of $J_2^c$.
-We will obtain one by considering larger system sizes on a finer grid of $J_2^c$. The parameters for this should be specified in `parm8d` and the script in `tutorial8d.py`. Please note that these simulations will take quite some CPU time and we therefore leave it to you as an exercise. Plot again the Binder cumulant of the staggered magnetization $U_4$ as well as the stiffness multiplied by system size $\rho_s L$ for different system sizes. The crossings of these curves should allow a more precise estimate of $J_2^c$. To obtain the critical exponent $\nu$ related to the divergence of the correlation length, it is useful to consider the scaling with system size of the derivative (with respect to $J_2^c$) of these quantities, when taken precisely at $J_2^c$. These derivatives $\frac{dU_4}{d J_2}$ and $L \frac{d\rho_s}{d J_2}$ can be obtained in principle as a Monte Carlo measurement, however for this tutorial, it is sufficient to perform a numerical differentiation which is possible thanks to the fine grid in $J_2$.
+We will obtain one by considering larger system sizes on a finer grid of $J_2^c$. The parameters for this should be specified in `parm8d` and the script in `tutorial8d.py`. Please note that these simulations will take quite some CPU time and we therefore leave it to you as an exercise. Plot again the Binder cumulant of the staggered magnetization $U_4$ as well as the stiffness multiplied by system size $\rho_s L$ for different system sizes. The crossings of these curves should allow a more precise estimate of $J_2^c$. To obtain the critical exponent $\nu$ related to the divergence of the correlation length, it is useful to consider the scaling with system size of the derivative (with respect to $J_2^c$) of these quantities, when taken precisely at $J_2^c$. These derivatives $\frac{dU_4}{d J_2}$ and $L \frac{d\rho_s}{d J_2}$ can be obtained in principle as a Monte Carlo measurement, however for this tutorial, it is sufficient to perform a numerical differentiation which is possible thanks to the fine grid in $J_2$.
Perform the numerical differentiations for the different system sizes for both quantities, and plot their values at $J_2^c$ as a function of system size. Data should scale as a power law : $\frac{dU_4}{d J_2}(J_2^c) \propto L \frac{d\rho_s}{d J_2}(J_2^c) \propto L^{1/\nu}$. Which value of $\nu$ do you obtain?
diff --git a/layouts/baseof.html b/layouts/baseof.html
index a86e742a..530dae58 100644
--- a/layouts/baseof.html
+++ b/layouts/baseof.html
@@ -17,5 +17,14 @@
{{ end }}
{{ partial "scripts.html" . }}
{{- partial "chatbot.html" . -}}
+
+
+ {{- $dl := resources.Get "js/alps-download.js" -}}
+ {{- if hugo.IsProduction -}}
+ {{- $dl = $dl | minify | fingerprint -}}
+
+ {{- else -}}
+
+ {{- end -}}