You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/documentation/codedev/code01.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ The `run` method manages the Monte Carlo updates defined in the step routine and
78
78
# Flip s_k with probability exp(2 beta e)
79
79
...
80
80
81
-
The Monte Carlo sweeps are done in the `step` method. In the Metropolis algorithm a spin is a randomly picked and flipped with probability $p\_{accept} = min(1,e^{-\beta \Delta E})$, $\Delta E$ being the energy difference of the initial and proposed configuration. This procedure is repeated $L^2$ times. The implementation of the Metropolis algorithm is left to you as an exercise. You can make use of the `randint` function defined below:
81
+
The Monte Carlo sweeps are done in the `step` method. In the Metropolis algorithm a spin is a randomly picked and flipped with probability $p_{accept} = min(1,e^{-\beta \Delta E})$, $\Delta E$ being the energy difference of the initial and proposed configuration. This procedure is repeated $L^2$ times. The implementation of the Metropolis algorithm is left to you as an exercise. You can make use of the `randint` function defined below:
Copy file name to clipboardExpand all lines: content/en/documentation/codedev/code02.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ This tutorial shows how to write a Monte Carlo simulation in C++ using the ALPS
10
10
11
11
As a simple example, we will write a simulation of the classical 2D Ising model with local updates. The file `ising-skeleton.cpp` contains a skeleton code which already has all the infrastructure we will need: First it includes all needed headers, then it initializes a random number generator and three `alps::RealObservable` objects. Then it sets up a square lattice of Ising spins. It also provides a table of probabilities that can be used for Metropolis updates. The interface is the same as in the python script you implemented in the previous [tutorial](../../codedev/code01).
12
12
13
-
Your job is again to complete the methods `step()` and `measure()`: `step()` should choose a random spin from the lattice and flip it with the Metropolis probability $p\_{accept} = min(1,e^{-\beta \Delta E})$ where $\Delta E$ is the energy change the spin flip would cause. `measure()` determines the energy and magnetization of a spin configuration and adds this sample to the observable objects.
13
+
Your job is again to complete the methods `step()` and `measure()`: `step()` should choose a random spin from the lattice and flip it with the Metropolis probability $p_{accept} = min(1,e^{-\beta \Delta E})$ where $\Delta E$ is the energy change the spin flip would cause. `measure()` determines the energy and magnetization of a spin configuration and adds this sample to the observable objects.
14
14
15
15
After replacing all ellipses with code, you can compile the simulation with this `Makefile`: Save the `Makefile` to the same directory as the `.cpp` file, edit the second line to point to your ALPS installation (if you haven't already set the environment variable ALPS_ROOT) and type `make`. This will produce an executable `ising`. Run it and you will see a scan over different values of $\beta = 1/k_B T$.
Copy file name to clipboardExpand all lines: content/en/documentation/intro/runalps/usepython.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,7 +166,7 @@ The preparation, simulation, and evaluation tasks can also be split into subtask
166
166
167
167
## More examples
168
168
169
-
More example usage of the various functions and more advanced applications can be found in the tutorials. Also, don't forget to look at the documentation of the various functions using the \_\_doc\_\_ member variable of the functions, as in:
169
+
More example usage of the various functions and more advanced applications can be found in the tutorials. Also, don't forget to look at the documentation of the various functions using the __doc__ member variable of the functions, as in:
Copy file name to clipboardExpand all lines: content/en/documentation/methods/dmft/dmft.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ weight: 9
34
34
| MAX_IT | maximum number of iteration in self-consistency loop (usually 10-20 will be enough) |
35
35
| CONVERGED | criterium for stopping the self-consistency loop before reaching MAX_IT - if the maximum change in Green's function in Matsubara representation is less than CONVERGED, the loop will stop |
36
36
| TOLERANCE | (only for hirschfyesim) as above |
37
-
| RELAX_RATE | (by default 1; currently implemented only for selfconsistency loop with OMEGA_LOOP switched on) the new Green's function are in general computed as RELAX\_RATE\* $G\_{new}(i\omega_n)$ + (1-RELAX\_RATE) \* $G\_{old}(i\omega_n)$, which may help if oscillations occur |
37
+
| RELAX_RATE | (by default 1; currently implemented only for selfconsistency loop with OMEGA_LOOP switched on) the new Green's function are in general computed as RELAX_RATE\* $G_{new}(i\omega_n)$ + (1-RELAX_RATE) \* $G_{old}(i\omega_n)$, which may help if oscillations occur |
38
38
39
39
### General parameters
40
40
@@ -147,7 +147,7 @@ weight: 9
147
147
148
148
### The output files for the hybridization expansion impurity solver: (text files)
149
149
150
-
- overlap: i-th row contains the $\langle n\_\downarrow n\_\uparrow\rangle$ in the i-th iteration
150
+
- overlap: i-th row contains the $\langle n_\downarrow n_\uparrow\rangle$ in the i-th iteration
Copy file name to clipboardExpand all lines: content/en/documentation/methods/ed/fulldiag/implem.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ weight: 3
9
9
10
10
The `fulldiag` package uses LAPACK library for a complete diagonalization of the Hamiltonian. Hence, it can be used for computing thermodynamic properties of any model that can be defined using the ALPS libraries. The main limitation is one of size, i.e., memory and CPU time may become unacceptable at sizes where other, more specialized applications still work well.
11
11
12
-
Release 1.3 allows the computation of magnetic or charge properties properties for models with a coupling to a conserved quantity of the form $-hS\_z$ or $-\mu N$, i.e., a SITETERM $-h S_z(i)$ or $-\mu n(i)$. In fact, adaptation to other situations with a coupling to a conserved quantity should be relatively straightforward by changing a few lines in the source file fulldiag.h (this is just not supported at the moment, since it requires the modification of at least 5 strings by the user). If the conserved quantity is not present, two quantities less will be evaluated (see below).
12
+
Release 1.3 allows the computation of magnetic or charge properties properties for models with a coupling to a conserved quantity of the form $-hS_z$ or $-\mu N$, i.e., a SITETERM $-h S_z(i)$ or $-\mu n(i)$. In fact, adaptation to other situations with a coupling to a conserved quantity should be relatively straightforward by changing a few lines in the source file fulldiag.h (this is just not supported at the moment, since it requires the modification of at least 5 strings by the user). If the conserved quantity is not present, two quantities less will be evaluated (see below).
13
13
14
14
**Warning:** Incorrect results may be obtained if the supposed conserved quantity does actually not commute with the Hamiltonian. Incorrect results will also in general be obtained if the coefficients are not of the above form, and the magnetic field $h$ or chemical potential $\mu$ are changed by `fulldiag_evaluate`.
Copy file name to clipboardExpand all lines: content/en/documentation/methods/ed/fulldiag/jacobi.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ $$
21
21
22
22
where $D$ is a diagonal matrix containing the eigenvalues of $A$, and the columns of $P$ are the corresponding eigenvectors.
23
23
24
-
The Jacobi method achieves this by applying a sequence of orthogonal transformations (rotations) to $A$. Each rotation targets a specific off-diagonal element $A\_{ij}$ and zeroes it out.
24
+
The Jacobi method achieves this by applying a sequence of orthogonal transformations (rotations) to $A$. Each rotation targets a specific off-diagonal element $A_{ij}$ and zeroes it out.
25
25
26
26
27
27
## Rotation Matrix
@@ -40,18 +40,18 @@ R = \begin{pmatrix}
40
40
\end{pmatrix}
41
41
$$
42
42
43
-
Here, $\cos \theta$ and $\sin \theta$ are placed at the intersections of the $i$-th and $j$-th rows and columns. The angle $\theta$ is chosen such that the off-diagonal element $A\_{ij}$ is zeroed out.
43
+
Here, $\cos \theta$ and $\sin \theta$ are placed at the intersections of the $i$-th and $j$-th rows and columns. The angle $\theta$ is chosen such that the off-diagonal element $A_{ij}$ is zeroed out.
44
44
45
45
46
46
## Algorithm
47
47
48
48
1.**Identify the Largest Off-Diagonal Element**:
49
-
- Find the largest off-diagonal element $A\_{ij}$ (in absolute value) in the matrix $A$.
49
+
- Find the largest off-diagonal element $A_{ij}$ (in absolute value) in the matrix $A$.
where $\mathbf{S}\_i$ is the spin-1/2 operator at site $i$, $J$ is the exchange interaction (ferromagnetic for $J \lt 0$ and antiferromagnetic for $J \gt 0$), and the sum runs over nearest-neighbor pairs $\langle i,j \rangle$. For simplicity, we consider a 1D chain with periodic boundary conditions.
17
+
where $\mathbf{S}_i$ is the spin-1/2 operator at site $i$, $J$ is the exchange interaction (ferromagnetic for $J \lt 0$ and antiferromagnetic for $J \gt 0$), and the sum runs over nearest-neighbor pairs $\langle i,j \rangle$. For simplicity, we consider a 1D chain with periodic boundary conditions.
18
18
19
19
### Example: 4-Site 1D Heisenberg Chain
20
20
21
21
Let’s study a 4-site 1D Heisenberg chain with periodic boundary conditions. The Hamiltonian for this system is:
The spin-1/2 operators $\mathbf{S}\_i = (S_i^x, S_i^y, S_i^z)$ can be expressed in terms of Pauli matrices $\boldsymbol{\sigma}\_i$ as $\mathbf{S}\_i = \frac{1}{2} \boldsymbol{\sigma}\_i$. The dot product $\mathbf{S}\_i \cdot \mathbf{S}\_j$ can be written as:
27
+
The spin-1/2 operators $\mathbf{S}_i = (S_i^x, S_i^y, S_i^z)$ can be expressed in terms of Pauli matrices $\boldsymbol{\sigma}_i$ as $\mathbf{S}_i = \frac{1}{2} \boldsymbol{\sigma}_i$. The dot product $\mathbf{S}_i \cdot \mathbf{S}_j$ can be written as:
To see the result of applying Hamiltonian to the basis states, we need to express the off-diagonal operators, i.e., $S_i^x$ and $S_i^y$ in terms of raising $S^{\dagger}$ and lowering $S^{-}$ operators:
46
46
$$
47
-
S\_i^x=\frac{1}{2}(S_i^{\dagger}+S_i^{-}),
47
+
S_i^x=\frac{1}{2}(S_i^{\dagger}+S_i^{-}),
48
48
$$
49
49
$$
50
50
S_i^y=\frac{1}{2i}(S_i^{\dagger}-S_i^{-}),
@@ -59,21 +59,21 @@ $$
59
59
where $S=1/2$ and $s=-1/2, 1/2$.
60
60
With the above transformation, the Hamiltonian element becomes
To construct the Hamiltonian matrix, we evaluate the action of $\mathcal{H}$ on each basis state. For instance, consider the term $\mathbf{S}\_1 \cdot \mathbf{S}\_2$:
67
+
To construct the Hamiltonian matrix, we evaluate the action of $\mathcal{H}$ on each basis state. For instance, consider the term $\mathbf{S}_1 \cdot \mathbf{S}_2$:
Repeating this process for all terms in $\mathcal{H}$ and all basis states, we construct the $16 \times 16$ Hamiltonian matrix. For brevity, we do not write the full matrix here, but it can be systematically built using the above rules.
0 commit comments