Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions assets/js/alps-download.js
Original file line number Diff line number Diff line change
@@ -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");
});
});
})();
4 changes: 2 additions & 2 deletions content/en/tutorials/dmft/dmft02.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ We start by running a continuous-time quantum Monte Carlo code: the hybridizatio

The CT-HYB simulation will run for roughly 1 hour in total if you want to reproduce all 6 curves in Fig. 11 mentioned above. The files for this tutorial can be found in the directory `tutorials/dmft-02-hybridization`.

All DMFT tutorials can be started using a python script. The python script generates parameter files, runs them, and plots the results. You can run the short script [`tutorial2.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-02-hybridization/tutorial2.py), reproducing only 2 out of the 6 curves (runtime: roughly 20 minutes), or the long version [`tutorial2_long.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-02-hybridization/tutorial2_long.py), reproducing all 6 curves in the figure (runtime: roughly 1 hour).
All DMFT tutorials can be started using a python script. The python script generates parameter files, runs them, and plots the results. You can run the short script <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-02-hybridization/tutorial2.py" data-filename="tutorial2.py" target="_blank" rel="noopener">`tutorial2.py`</a>, reproducing only 2 out of the 6 curves (runtime: roughly 20 minutes), or the long version <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-02-hybridization/tutorial2_long.py" data-filename="tutorial2_long.py" target="_blank" rel="noopener">`tutorial2_long.py`</a>, reproducing all 6 curves in the figure (runtime: roughly 1 hour).

The python script `tutorial2.py` automatically prepares the input files for the 2 simulations, `parm_beta_6.0` and `parm_beta_12.0`, and runs them (`/path-to-alps-installation/bin/dmft parm_beta_x`).

Expand Down Expand Up @@ -127,7 +127,7 @@ You will notice that the results are relatively noisy. This is because the expan

### Checking convergence

If you want to check the convergence of your DMFT self-consistency, you can plot the Green's functions of different iterations using [`tutorial2eval.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-02-hybridization/tutorial2eval.py), whose code is shown here:
If you want to check the convergence of your DMFT self-consistency, you can plot the Green's functions of different iterations using <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-02-hybridization/tutorial2eval.py" data-filename="tutorial2eval.py" target="_blank" rel="noopener">`tutorial2eval.py`</a>, whose code is shown here:

```
listobs=['0'] # we look at a single flavor (=0)
Expand Down
4 changes: 2 additions & 2 deletions content/en/tutorials/dmft/dmft03.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ with nearest-neighbor hopping $t$, on-site interaction $U$, and chemical potenti

### Running the simulation

The files for this tutorial can be found in the directory `tutorials/dmft-03-interaction`. As in Tutorial 02, you can run the short script [`tutorial3.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-03-interaction/tutorial3.py), reproducing 2 of the 6 curves (runtime: roughly 10 minutes), or the long version [`tutorial3_long.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-03-interaction/tutorial3_long.py), reproducing all 6 curves (runtime: roughly 30 minutes). CT-INT reaches a given statistical accuracy faster than CT-HYB in this weak-coupling regime, which is why `MAX_TIME` is set much lower here (10 seconds per iteration) than in Tutorial 02 (300 seconds).
The files for this tutorial can be found in the directory `tutorials/dmft-03-interaction`. As in Tutorial 02, you can run the short script <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-03-interaction/tutorial3.py" data-filename="tutorial3.py" target="_blank" rel="noopener">`tutorial3.py`</a>, reproducing 2 of the 6 curves (runtime: roughly 10 minutes), or the long version <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-03-interaction/tutorial3_long.py" data-filename="tutorial3_long.py" target="_blank" rel="noopener">`tutorial3_long.py`</a>, reproducing all 6 curves (runtime: roughly 30 minutes). CT-INT reaches a given statistical accuracy faster than CT-HYB in this weak-coupling regime, which is why `MAX_TIME` is set much lower here (10 seconds per iteration) than in Tutorial 02 (300 seconds).

```
import pyalps
Expand Down Expand Up @@ -151,7 +151,7 @@ CT-INT and CT-HYB solve the same impurity problem with different diagrammatic ex

### Output data and plots

Evaluation proceeds exactly as in [DMFT-02 Hybridization](../dmft02), using [`tutorial3eval.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-03-interaction/tutorial3eval.py) (identical in structure to `tutorial2eval.py`). First, the imaginary-time Green's function for both flavors, directly appended to `tutorial3.py`:
Evaluation proceeds exactly as in [DMFT-02 Hybridization](../dmft02), using <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-03-interaction/tutorial3eval.py" data-filename="tutorial3eval.py" target="_blank" rel="noopener">`tutorial3eval.py`</a> (identical in structure to `tutorial2eval.py`). First, the imaginary-time Green's function for both flavors, directly appended to `tutorial3.py`:

```
listobs=['0', '1'] # we will plot both flavors 0 and 1
Expand Down
4 changes: 2 additions & 2 deletions content/en/tutorials/dmft/dmft04.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ on the Bethe lattice, at half filling ($\mu=0$). Here the interaction $U$ is swe

### Running the simulation

In order to run the simulations in python use [`tutorial4a.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-04-mott/tutorial4a.py):
In order to run the simulations in python use <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-04-mott/tutorial4a.py" data-filename="tutorial4a.py" target="_blank" rel="noopener">`tutorial4a.py`</a>:

```
import pyalps
Expand Down Expand Up @@ -184,7 +184,7 @@ You should observe that at small $U$ you find a metallic solution, and an insula

### Checking convergence

The convergence may be checked by [`tutorial4b.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-04-mott/tutorial4b.py):
The convergence may be checked by <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-04-mott/tutorial4b.py" data-filename="tutorial4b.py" target="_blank" rel="noopener">`tutorial4b.py`</a>:

```
import pyalps
Expand Down
4 changes: 2 additions & 2 deletions content/en/tutorials/dmft/dmft05.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ with orbital index $m=0,1$, intra-orbital hopping $t_m$, intra-orbital (Hubbard)

We choose here a case with two bandwidths, $t_0=0.5$ and $t_1=1$, and density-density-like interactions of $U'=U/2$, $J=U/4$, with $U$ between $1.8$ and $2.8$: $U=1.8$ shows a Fermi-liquid-like behavior in both orbitals, $U=2.2$ is orbitally selective, and $U=2.8$ is insulating in both orbitals.

The python command lines for running the simulations are found in [`tutorial5a.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-05-osmt/tutorial5a.py):
The python command lines for running the simulations are found in <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-05-osmt/tutorial5a.py" data-filename="tutorial5a.py" target="_blank" rel="noopener">`tutorial5a.py`</a>:

```
import pyalps
Expand Down Expand Up @@ -190,7 +190,7 @@ Because these are stochastic Monte Carlo results, the precise numbers depend on

### Checking convergence

Convergence may be checked with [`tutorial5b.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-05-osmt/tutorial5b.py), which plots all iterations of $G_f^{it}(\tau)$ on a logarithmic scale, for both flavor 0 and flavor 2:
Convergence may be checked with <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-05-osmt/tutorial5b.py" data-filename="tutorial5b.py" target="_blank" rel="noopener">`tutorial5b.py`</a>, which plots all iterations of $G_f^{it}(\tau)$ on a logarithmic scale, for both flavor 0 and flavor 2:

```
import pyalps
Expand Down
4 changes: 2 additions & 2 deletions content/en/tutorials/dmft/dmft06.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ and (for the interaction expansion version)
python tutorial6b.py
```

[`tutorial6a.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-06-paramagnet/hyb/tutorial6a.py) (CT-HYB):
<a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-06-paramagnet/hyb/tutorial6a.py" data-filename="tutorial6a.py" target="_blank" rel="noopener">`tutorial6a.py`</a> (CT-HYB):

```
import pyalps
Expand Down Expand Up @@ -113,7 +113,7 @@ input_file = pyalps.writeParameterFile('parm_hyb',parms[0])
res = pyalps.runDMFT(input_file)
```

[`tutorial6b.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-06-paramagnet/int/tutorial6b.py) (CT-INT):
<a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-06-paramagnet/int/tutorial6b.py" data-filename="tutorial6b.py" target="_blank" rel="noopener">`tutorial6b.py`</a> (CT-INT):

```
import pyalps
Expand Down
4 changes: 2 additions & 2 deletions content/en/tutorials/dmft/dmft07.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ on the Bethe lattice at half filling ($\mu=0$), with $t=0.707106781186547=1/\sqr

### Running the simulation

The Hirsch-Fye simulation will run for about 20 seconds per iteration. The files for this tutorial can be found in the directory `tutorials/dmft-07-hirschfye`. As in Tutorials 02 and 03, you can run the short script [`tutorial7.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-07-hirschfye/tutorial7.py), reproducing 2 of the 6 curves (runtime: roughly 5 minutes), or the long version [`tutorial7_long.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-07-hirschfye/tutorial7_long.py), reproducing all 6 curves.
The Hirsch-Fye simulation will run for about 20 seconds per iteration. The files for this tutorial can be found in the directory `tutorials/dmft-07-hirschfye`. As in Tutorials 02 and 03, you can run the short script <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-07-hirschfye/tutorial7.py" data-filename="tutorial7.py" target="_blank" rel="noopener">`tutorial7.py`</a>, reproducing 2 of the 6 curves (runtime: roughly 5 minutes), or the long version <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-07-hirschfye/tutorial7_long.py" data-filename="tutorial7_long.py" target="_blank" rel="noopener">`tutorial7_long.py`</a>, reproducing all 6 curves.

```
import pyalps
Expand Down Expand Up @@ -165,7 +165,7 @@ Hirsch-Fye works very differently from CT-HYB and CT-INT: it Trotter-decomposes

### Output data and plots

For evaluation you may adapt `tutorial2eval.py` as described in [DMFT-02 Hybridization](../dmft02), or use [`tutorial7eval.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-07-hirschfye/tutorial7eval.py), which is structurally identical to `tutorial2eval.py`: it plots the iteration-resolved $G(\tau)$, the occupation $n_0=-G_0(\tau=\beta^-)$ versus $\beta$, and the Matsubara-frequency Green's function and self-energy (via the Dyson equation), for both flavors.
For evaluation you may adapt `tutorial2eval.py` as described in [DMFT-02 Hybridization](../dmft02), or use <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-07-hirschfye/tutorial7eval.py" data-filename="tutorial7eval.py" target="_blank" rel="noopener">`tutorial7eval.py`</a>, which is structurally identical to `tutorial2eval.py`: it plots the iteration-resolved $G(\tau)$, the occupation $n_0=-G_0(\tau=\beta^-)$ versus $\beta$, and the Matsubara-frequency Green's function and self-energy (via the Dyson equation), for both flavors.

```
import pyalps
Expand Down
6 changes: 3 additions & 3 deletions content/en/tutorials/dmft/dmft08.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Two lattice-specific mechanisms are available; both feed a k-integrated density
o o
```

Each DOS table was produced by a small histogram script — [`DOS_Square.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-08-lattices/DOS/DOS_Square.py) (`GRID=4000`), [`DOS_Cubic.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-08-lattices/DOS/DOS_Cubic.py) (`GRID=360`), and [`DOS_Hexagonal.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-08-lattices/DOS/DOS_Hexagonal.py) (`GRID=4000`) — each integrating the tight-binding dispersion over the Brillouin zone on a `GRID`$\times$`GRID` k-point mesh. You can generate a DOS table for any other lattice the same way, or use the [ALPS lattice library](../../../documentation/intro/latticehowtos) as a reference for lattice geometries and coordination numbers when building your own.
Each DOS table was produced by a small histogram script — <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-08-lattices/DOS/DOS_Square.py" data-filename="DOS_Square.py" target="_blank" rel="noopener">`DOS_Square.py`</a> (`GRID=4000`), <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-08-lattices/DOS/DOS_Cubic.py" data-filename="DOS_Cubic.py" target="_blank" rel="noopener">`DOS_Cubic.py`</a> (`GRID=360`), and <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-08-lattices/DOS/DOS_Hexagonal.py" data-filename="DOS_Hexagonal.py" target="_blank" rel="noopener">`DOS_Hexagonal.py`</a> (`GRID=4000`) — each integrating the tight-binding dispersion over the Brillouin zone on a `GRID`$\times$`GRID` k-point mesh. You can generate a DOS table for any other lattice the same way, or use the [ALPS lattice library](../../../documentation/intro/latticehowtos) as a reference for lattice geometries and coordination numbers when building your own.

**TWODBS**: for the square and hexagonal lattices specifically, ALPS can instead evaluate the Hilbert transform directly as a live k-space integral at every self-consistency step (discretized on an $L\times L$ k-point mesh), without needing a pre-tabulated DOS file at all.

Expand All @@ -87,7 +87,7 @@ Each DOS table was produced by a small histogram script — [`DOS_Square.py`](ht

### Option DOSFILE

For a general lattice, you have to provide the density of states of your lattice. Apart from that, several other changes are necessary in order to run the simulation. A working python script [`tutorial8a.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-08-lattices/tutorial8a.py) setting an input file, running the simulation, and plotting the result follows:
For a general lattice, you have to provide the density of states of your lattice. Apart from that, several other changes are necessary in order to run the simulation. A working python script <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-08-lattices/tutorial8a.py" data-filename="tutorial8a.py" target="_blank" rel="noopener">`tutorial8a.py`</a> setting an input file, running the simulation, and plotting the result follows:

```
import pyalps
Expand Down Expand Up @@ -192,7 +192,7 @@ For the case of two-dimensional lattices, there is an implementation of the Hilb
- square lattice [set TWODBS=square] with nearest-neighbor [corresponding parameter: t] and next-nearest-neighbor hoppings [corresponding parameter: tprime]; the second moment EPSSQ_i is $4(t^2 + tprime^2)$;
- hexagonal lattice [set TWODBS=hexagonal] with nearest-neighbor hoppings [corresponding parameter: t]; the second moment EPSSQ_i is $3t^2$.

A working python script [`tutorial8b.py`](https://github.com/ALPSim/ALPS/blob/daa73925b95389c0ec5e0d76ce592b56f3cd6738/tutorials/dmft-08-lattices/tutorial8b.py) to produce the input file, run the simulation, and plot the result is shown here:
A working python script <a class="alps-download" href="https://raw.githubusercontent.com/ALPSim/ALPS/master/tutorials/dmft-08-lattices/tutorial8b.py" data-filename="tutorial8b.py" target="_blank" rel="noopener">`tutorial8b.py`</a> to produce the input file, run the simulation, and plot the result is shown here:

```
import pyalps
Expand Down
Loading