From 54e5ec0d330fde3f326705fb0b12b7aeeac60faa Mon Sep 17 00:00:00 2001 From: Marcus Rosales Date: Wed, 12 Aug 2026 14:01:11 -0400 Subject: [PATCH] Download DMRG scripts from ALPSim/ALPS instead of vendoring them The DMRG tutorials served 27 copies of the ALPS tutorial files out of content/en/tutorials/dmrg/codes/. Point the 26 download links at ALPSim/ALPS master over raw.githubusercontent.com and drop the copies, matching the DMFT and MCS series. All 27 vendored files were byte-identical to their master counterparts before removal, and all 26 new URLs were confirmed to return 200, so readers get the same bytes from the canonical source. English only. The Japanese and Chinese DMRG pages are left untouched for now: DMRG-05 has drifted badly (English is 293 lines across 17 sections after the restructure, the translations 127 lines across 8), and the translated text still walks the reader through spin_one and spin_one.py, which the English version no longer uses at all. Remapping those links would leave the prose describing one file and the button downloading another, so the translations need a content pass first. Co-Authored-By: Claude Opus 5 --- .../build_lattice.py | 48 - .../my_lattices.xml | 1043 ----------------- .../dmrg-03-ground-state-energies/spin_one | 12 - .../dmrg-03-ground-state-energies/spin_one.py | 77 -- .../spin_one_half | 9 - .../spin_one_half.py | 76 -- .../spin_one_half_multiple | 11 - .../spin_one_half_multiple.py | 59 - .../spin_one_multiple | 14 - .../spin_one_multiple.py | 61 - .../dmrg/codes/dmrg-04-gaps/spin_one_half_gap | 8 - .../codes/dmrg-04-gaps/spin_one_half_gap.py | 65 - .../codes/dmrg-04-gaps/spin_one_half_multiple | 11 - .../codes/dmrg-04-gaps/spin_one_half_triplet | 8 - .../dmrg-04-gaps/spin_one_half_triplet.py | 66 -- .../build_lattice.py | 48 - .../dmrg-05-local-observables/spin_one_capped | 14 - .../spin_one_capped.py | 76 -- .../dmrg-05-local-observables/spin_one_half | 12 - .../spin_one_half.py | 75 -- .../spin_one_uniform | 13 - .../spin_one_uniform.py | 75 -- .../dmrg-06-correlations/my_lattices.xml | 1043 ----------------- .../dmrg/codes/dmrg-06-correlations/spin_one | 16 - .../codes/dmrg-06-correlations/spin_one.py | 91 -- .../codes/dmrg-06-correlations/spin_one_half | 16 - .../dmrg-06-correlations/spin_one_half.py | 91 -- content/en/tutorials/dmrg/dmrg03.md | 20 +- content/en/tutorials/dmrg/dmrg04.md | 10 +- content/en/tutorials/dmrg/dmrg05.md | 14 +- content/en/tutorials/dmrg/dmrg06.md | 8 +- 31 files changed, 26 insertions(+), 3164 deletions(-) delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/build_lattice.py delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/my_lattices.xml delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one.py delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half.py delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half_multiple delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half_multiple.py delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_multiple delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_multiple.py delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_gap delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_gap.py delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_multiple delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_triplet delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_triplet.py delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-05-local-observables/build_lattice.py delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_capped delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_capped.py delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_half delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_half.py delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_uniform delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_uniform.py delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-06-correlations/my_lattices.xml delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one.py delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one_half delete mode 100644 content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one_half.py diff --git a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/build_lattice.py b/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/build_lattice.py deleted file mode 100644 index eecf631c..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/build_lattice.py +++ /dev/null @@ -1,48 +0,0 @@ -#! /usr/bin/env python -# **************************************************************************** -# -# ALPS Project: Algorithms and Libraries for Physics Simulations -# -# ALPS Libraries -# -# Copyright (C) 2009-2010 by Matthias Troyer -# Jan Gukelberger -# Adrian Feiguin -# -# This software is part of the ALPS libraries, published under the ALPS -# Library License; you can use, redistribute it and/or modify it under -# the terms of the license, either version 1 or (at your option) any later -# version. -# -# You should have received a copy of the ALPS Library License along with -# the ALPS Libraries; see the file LICENSE.txt. If not, the license is also -# available from http://alps.comp-phys.org/. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -# **************************************************************************** - -from __future__ import print_function -import sys - -ns = sys.argv[1] -nedges = str(int(ns) - 1) - -print('') -print(' ') -print(' 1') -for i in range(2,int(ns)): - print(' ' + str(i) + '') -print(' ' + ns + '') -for i in range(1,int(ns)): - nn = str(i + 1) - print(' ') - -print(' ') -print('') diff --git a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/my_lattices.xml b/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/my_lattices.xml deleted file mode 100644 index 0546823a..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/my_lattices.xml +++ /dev/null @@ -1,1043 +0,0 @@ - - - - - 0 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 - 65 - 66 - 67 - 68 - 69 - 70 - 71 - 72 - 73 - 74 - 75 - 76 - 77 - 78 - 79 - 80 - 81 - 82 - 83 - 84 - 85 - 86 - 87 - 88 - 89 - 90 - 91 - 92 - 93 - 94 - 95 - 96 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 - 65 - 66 - 67 - 68 - 69 - 70 - 71 - 72 - 73 - 74 - 75 - 76 - 77 - 78 - 79 - 80 - 81 - 82 - 83 - 84 - 85 - 86 - 87 - 88 - 89 - 90 - 91 - 92 - 93 - 94 - 95 - 96 - 97 - 98 - 99 - 100 - 101 - 102 - 103 - 104 - 105 - 106 - 107 - 108 - 109 - 110 - 111 - 112 - 113 - 114 - 115 - 116 - 117 - 118 - 119 - 120 - 121 - 122 - 123 - 124 - 125 - 126 - 127 - 128 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 - 65 - 66 - 67 - 68 - 69 - 70 - 71 - 72 - 73 - 74 - 75 - 76 - 77 - 78 - 79 - 80 - 81 - 82 - 83 - 84 - 85 - 86 - 87 - 88 - 89 - 90 - 91 - 92 - 93 - 94 - 95 - 96 - 97 - 98 - 99 - 100 - 101 - 102 - 103 - 104 - 105 - 106 - 107 - 108 - 109 - 110 - 111 - 112 - 113 - 114 - 115 - 116 - 117 - 118 - 119 - 120 - 121 - 122 - 123 - 124 - 125 - 126 - 127 - 128 - 129 - 130 - 131 - 132 - 133 - 134 - 135 - 136 - 137 - 138 - 139 - 140 - 141 - 142 - 143 - 144 - 145 - 146 - 147 - 148 - 149 - 150 - 151 - 152 - 153 - 154 - 155 - 156 - 157 - 158 - 159 - 160 - 161 - 162 - 163 - 164 - 165 - 166 - 167 - 168 - 169 - 170 - 171 - 172 - 173 - 174 - 175 - 176 - 177 - 178 - 179 - 180 - 181 - 182 - 183 - 184 - 185 - 186 - 187 - 188 - 189 - 190 - 191 - 192 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one b/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one deleted file mode 100644 index d9ee6342..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one +++ /dev/null @@ -1,12 +0,0 @@ -LATTICE_LIBRARY="my_lattice.xml" -LATTICE="open chain lattice with special edges" -MODEL="spin" -local_S0=0.5 -local_S1=1 -CONSERVED_QUANTUMNUMBERS="Sz" -Sz_total=0 -J=1 -SWEEPS=4 -NUMBER_EIGENVALUES=1 -{MAXSTATES=100} - diff --git a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one.py b/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one.py deleted file mode 100644 index d5e2abfe..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one.py +++ /dev/null @@ -1,77 +0,0 @@ -from __future__ import print_function -# **************************************************************************** -# -# ALPS Project: Algorithms and Libraries for Physics Simulations -# -# ALPS Libraries -# -# Copyright (C) 2010 by Jan Gukelberger -# -# This software is part of the ALPS libraries, published under the ALPS -# Library License; you can use, redistribute it and/or modify it under -# the terms of the license, either version 1 or (at your option) any later -# version. -# -# You should have received a copy of the ALPS Library License along with -# the ALPS Libraries; see the file LICENSE.txt. If not, the license is also -# available from http://alps.comp-phys.org/. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -# **************************************************************************** - -import pyalps -import numpy as np -import matplotlib.pyplot as plt -import pyalps.plot - -#prepare the input parameters -parms = [ { - 'LATTICE_LIBRARY' : 'my_lattice.xml', - 'LATTICE' : 'open chain lattice with special edges', - 'MODEL' : 'spin', - 'local_S0' : '0.5', - 'local_S1' : '1', - 'CONSERVED_QUANTUMNUMBERS' : 'N,Sz', - 'Sz_total' : 0, - 'J' : 1, - 'SWEEPS' : 4, - 'NUMBER_EIGENVALUES' : 1, - 'MAXSTATES' : 100 - } ] - -#write the input file and run the simulation -input_file = pyalps.writeInputFiles('parm_spin_one',parms) -res = pyalps.runApplication('dmrg',input_file,writexml=True) - -#load all measurements for all states -data = pyalps.loadEigenstateMeasurements(pyalps.getResultFiles(prefix='parm_spin_one')) - -# print properties of the eigenvector: -for s in data[0]: - print(s.props['observable'], ' : ', s.y[0]) - -# load and plot iteration history -iter = pyalps.loadMeasurements(pyalps.getResultFiles(prefix='parm_spin_one'), - what=['Iteration Energy','Iteration Truncation Error']) - -plt.figure() -pyalps.plot.plot(iter[0][0]) -plt.title('Iteration history of ground state energy (S=1)') -plt.ylabel('$E_0$') -plt.xlabel('iteration') - -plt.figure() -pyalps.plot.plot(iter[0][1]) -plt.title('Iteration history of truncation error (S=1)') -plt.yscale('log') -plt.ylabel('error') -plt.xlabel('iteration') - -plt.show() diff --git a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half b/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half deleted file mode 100644 index 157740e8..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half +++ /dev/null @@ -1,9 +0,0 @@ -LATTICE="open chain lattice" -SWEEPS=4 -CONSERVED_QUANTUMNUMBERS="Sz" -MODEL="spin", Sz_total=0 -J=1 -NUMBER_EIGENVALUES=1 -L=32 -{MAXSTATES=100} - diff --git a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half.py b/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half.py deleted file mode 100644 index 9bb618c3..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half.py +++ /dev/null @@ -1,76 +0,0 @@ -from __future__ import print_function -# **************************************************************************** -# -# ALPS Project: Algorithms and Libraries for Physics Simulations -# -# ALPS Libraries -# -# Copyright (C) 2010 by Jan Gukelberger -# -# This software is part of the ALPS libraries, published under the ALPS -# Library License; you can use, redistribute it and/or modify it under -# the terms of the license, either version 1 or (at your option) any later -# version. -# -# You should have received a copy of the ALPS Library License along with -# the ALPS Libraries; see the file LICENSE.txt. If not, the license is also -# available from http://alps.comp-phys.org/. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -# **************************************************************************** - -import pyalps -import numpy as np -import matplotlib.pyplot as plt -import pyalps.plot - -#prepare the input parameters -parms = [ { - 'LATTICE' : "open chain lattice", - 'MODEL' : "spin", - 'CONSERVED_QUANTUMNUMBERS' : 'N,Sz', - 'Sz_total' : 0, - 'J' : 1, - 'SWEEPS' : 4, - 'NUMBER_EIGENVALUES' : 1, - 'L' : 32, - 'MAXSTATES' : 100 - } ] - -#write the input file and run the simulation -input_file = pyalps.writeInputFiles('parm_spin_one_half',parms) -res = pyalps.runApplication('dmrg',input_file,writexml=True) - -#load all measurements for all states -data = pyalps.loadEigenstateMeasurements(pyalps.getResultFiles(prefix='parm_spin_one_half')) - -# print properties of the eigenvector: -for s in data[0]: - print(s.props['observable'], ' : ', s.y[0]) - -# load and plot iteration history -iter = pyalps.loadMeasurements(pyalps.getResultFiles(prefix='parm_spin_one_half'), - what=['Iteration Energy','Iteration Truncation Error']) - -plt.figure() -pyalps.plot.plot(iter[0][0]) -plt.title('Iteration history of ground state energy (S=1/2)') -plt.ylim(-15,0) -plt.ylabel('$E_0$') -plt.xlabel('iteration') - -plt.figure() -pyalps.plot.plot(iter[0][1]) -plt.title('Iteration history of truncation error (S=1/2)') -plt.yscale('log') -plt.ylabel('error') -plt.xlabel('iteration') - -plt.show() diff --git a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half_multiple b/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half_multiple deleted file mode 100644 index 3d1c0585..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half_multiple +++ /dev/null @@ -1,11 +0,0 @@ -LATTICE="open chain lattice" -SWEEPS=4 -CONSERVED_QUANTUMNUMBERS="Sz" -MODEL="spin", Sz_total=0 -J=1 -NUMBER_EIGENVALUES=1 -L=32 -{ MAXSTATES=20 } -{ MAXSTATES=40 } -{ MAXSTATES=60 } - diff --git a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half_multiple.py b/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half_multiple.py deleted file mode 100644 index d2d8e022..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_half_multiple.py +++ /dev/null @@ -1,59 +0,0 @@ -from __future__ import print_function -# **************************************************************************** -# -# ALPS Project: Algorithms and Libraries for Physics Simulations -# -# ALPS Libraries -# -# Copyright (C) 2010 by Jan Gukelberger -# -# This software is part of the ALPS libraries, published under the ALPS -# Library License; you can use, redistribute it and/or modify it under -# the terms of the license, either version 1 or (at your option) any later -# version. -# -# You should have received a copy of the ALPS Library License along with -# the ALPS Libraries; see the file LICENSE.txt. If not, the license is also -# available from http://alps.comp-phys.org/. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -# **************************************************************************** - -import pyalps -import numpy as np -import matplotlib.pyplot as plt -import pyalps.plot - -#prepare the input parameters -parms= [] -for m in [20,40,60]: - parms.append({ - 'LATTICE' : "open chain lattice", - 'MODEL' : "spin", - 'CONSERVED_QUANTUMNUMBERS' : 'N,Sz', - 'Sz_total' : 0, - 'J' : 1, - 'SWEEPS' : 4, - 'NUMBER_EIGENVALUES' : 1, - 'L' : 32, - 'MAXSTATES' : m - }) - -#write the input file and run the simulation -input_file = pyalps.writeInputFiles('parm_spin_one_half_multiple',parms) -res = pyalps.runApplication('dmrg',input_file,writexml=True) - -#load all measurements for all states -data = pyalps.loadEigenstateMeasurements(pyalps.getResultFiles(prefix='parm_spin_one_half_multiple')) - -# print properties of the eigenvector for each run: -for run in data: - for s in run: - print(s.props['observable'], ' : ', s.y[0]) diff --git a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_multiple b/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_multiple deleted file mode 100644 index 61e4b0be..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_multiple +++ /dev/null @@ -1,14 +0,0 @@ -LATTICE_LIBRARY="my_lattices.xml" -LATTICE="open chain lattice with special edges 32" -MODEL="spin" -local_S0=0.5 -local_S1=1 -CONSERVED_QUANTUMNUMBERS="Sz" -Sz_total=0 -J=1 -NUMBER_EIGENVALUES=1 -SWEEPS=4 -{ MAXSTATES=20 } -{ MAXSTATES=40 } -{ MAXSTATES=60 } - diff --git a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_multiple.py b/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_multiple.py deleted file mode 100644 index c7f624be..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-03-ground-state-energies/spin_one_multiple.py +++ /dev/null @@ -1,61 +0,0 @@ -from __future__ import print_function -# **************************************************************************** -# -# ALPS Project: Algorithms and Libraries for Physics Simulations -# -# ALPS Libraries -# -# Copyright (C) 2010 by Jan Gukelberger -# -# This software is part of the ALPS libraries, published under the ALPS -# Library License; you can use, redistribute it and/or modify it under -# the terms of the license, either version 1 or (at your option) any later -# version. -# -# You should have received a copy of the ALPS Library License along with -# the ALPS Libraries; see the file LICENSE.txt. If not, the license is also -# available from http://alps.comp-phys.org/. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -# **************************************************************************** - -import pyalps -import numpy as np -import matplotlib.pyplot as plt -import pyalps.plot - -#prepare the input parameters -parms= [] -for m in [20,40,60]: - parms.append({ - 'LATTICE_LIBRARY' : 'my_lattices.xml', - 'LATTICE' : 'open chain lattice with special edges 32', - 'MODEL' : 'spin', - 'local_S0' : '0.5', - 'local_S1' : '1', - 'CONSERVED_QUANTUMNUMBERS' : 'N,Sz', - 'Sz_total' : 0, - 'J' : 1, - 'SWEEPS' : 4, - 'NUMBER_EIGENVALUES' : 1, - 'MAXSTATES' : m - }) - -#write the input file and run the simulation -input_file = pyalps.writeInputFiles('parm_spin_one_multiple',parms) -res = pyalps.runApplication('dmrg',input_file,writexml=True) - -#load all measurements for all states -data = pyalps.loadEigenstateMeasurements(pyalps.getResultFiles(prefix='parm_spin_one_multiple')) - -# print properties of the eigenvector for each run: -for run in data: - for s in run: - print(s.props['observable'], ' : ', s.y[0]) diff --git a/content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_gap b/content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_gap deleted file mode 100644 index 90826646..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_gap +++ /dev/null @@ -1,8 +0,0 @@ -LATTICE="open chain lattice" -MODEL="spin" -CONSERVED_QUANTUMNUMBERS="Sz" -Sz_total=0 -J=1 -SWEEPS=4 -{L=32, MAXSTATES=100 -NUMBER_EIGENVALUES=2} diff --git a/content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_gap.py b/content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_gap.py deleted file mode 100644 index ae2805d3..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_gap.py +++ /dev/null @@ -1,65 +0,0 @@ -from __future__ import print_function -# **************************************************************************** -# -# ALPS Project: Algorithms and Libraries for Physics Simulations -# -# ALPS Libraries -# -# Copyright (C) 2010 by Jan Gukelberger -# -# This software is part of the ALPS libraries, published under the ALPS -# Library License; you can use, redistribute it and/or modify it under -# the terms of the license, either version 1 or (at your option) any later -# version. -# -# You should have received a copy of the ALPS Library License along with -# the ALPS Libraries; see the file LICENSE.txt. If not, the license is also -# available from http://alps.comp-phys.org/. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -# **************************************************************************** - -import pyalps -import numpy as np -import matplotlib.pyplot as plt -import pyalps.plot - -#prepare the input parameters -parms = [ { - 'LATTICE' : "open chain lattice", - 'MODEL' : "spin", - 'CONSERVED_QUANTUMNUMBERS' : 'N,Sz', - 'Sz_total' : 0, - 'J' : 1, - 'SWEEPS' : 4, - 'L' : 32, - 'MAXSTATES' : 100, - 'NUMBER_EIGENVALUES' : 2 - } ] - -#write the input file and run the simulation -input_file = pyalps.writeInputFiles('parm_spin_one_half_gap',parms) -res = pyalps.runApplication('dmrg',input_file,writexml=True) - -#load all measurements for all states -data = pyalps.loadEigenstateMeasurements(pyalps.getResultFiles(prefix='parm_spin_one_half_gap')) - -# print results: -energies = np.empty(0) -for s in data[0]: - if s.props['observable'] == 'Energy': - energies = s.y - else: - print(s.props['observable'], ':', s.y[0]) -energies.sort() -print('Energies:', end=' ') -for e in energies: - print(e, end=' ') -print('\nGap:', abs(energies[1]-energies[0])) diff --git a/content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_multiple b/content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_multiple deleted file mode 100644 index 3d1c0585..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_multiple +++ /dev/null @@ -1,11 +0,0 @@ -LATTICE="open chain lattice" -SWEEPS=4 -CONSERVED_QUANTUMNUMBERS="Sz" -MODEL="spin", Sz_total=0 -J=1 -NUMBER_EIGENVALUES=1 -L=32 -{ MAXSTATES=20 } -{ MAXSTATES=40 } -{ MAXSTATES=60 } - diff --git a/content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_triplet b/content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_triplet deleted file mode 100644 index a39b0801..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_triplet +++ /dev/null @@ -1,8 +0,0 @@ -LATTICE="open chain lattice" -MODEL="spin" -CONSERVED_QUANTUMNUMBERS="Sz" -Sz_total=1 -SWEEPS=4 -J=1 -{L=32, MAXSTATES=40} - diff --git a/content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_triplet.py b/content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_triplet.py deleted file mode 100644 index fafa2160..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-04-gaps/spin_one_half_triplet.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import print_function -# **************************************************************************** -# -# ALPS Project: Algorithms and Libraries for Physics Simulations -# -# ALPS Libraries -# -# Copyright (C) 2010 by Jan Gukelberger -# -# This software is part of the ALPS libraries, published under the ALPS -# Library License; you can use, redistribute it and/or modify it under -# the terms of the license, either version 1 or (at your option) any later -# version. -# -# You should have received a copy of the ALPS Library License along with -# the ALPS Libraries; see the file LICENSE.txt. If not, the license is also -# available from http://alps.comp-phys.org/. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -# **************************************************************************** - -import pyalps -import numpy as np -import matplotlib.pyplot as plt -import pyalps.plot - -#prepare the input parameters -parms = [] -for sz in [0,1]: - parms.append( { - 'LATTICE' : "open chain lattice", - 'MODEL' : "spin", - 'CONSERVED_QUANTUMNUMBERS' : 'N,Sz', - 'Sz_total' : sz, - 'J' : 1, - 'SWEEPS' : 4, - 'L' : 32, - 'MAXSTATES' : 40, - 'NUMBER_EIGENVALUES' : 1 - } ) - -#write the input file and run the simulation -input_file = pyalps.writeInputFiles('parm_spin_one_half_triplet',parms) -res = pyalps.runApplication('dmrg',input_file,writexml=True) - -#load all measurements for all states -data = pyalps.loadEigenstateMeasurements(pyalps.getResultFiles(prefix='parm_spin_one_half_triplet')) - -# print results: -energies = {} -for run in data: - print('S_z =', run[0].props['Sz_total']) - for s in run: - print('\t', s.props['observable'], ':', s.y[0]) - if s.props['observable'] == 'Energy': - sz = s.props['Sz_total'] - energies[sz] = s.y[0] - -print('Gap:', energies[1]-energies[0]) diff --git a/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/build_lattice.py b/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/build_lattice.py deleted file mode 100644 index eecf631c..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/build_lattice.py +++ /dev/null @@ -1,48 +0,0 @@ -#! /usr/bin/env python -# **************************************************************************** -# -# ALPS Project: Algorithms and Libraries for Physics Simulations -# -# ALPS Libraries -# -# Copyright (C) 2009-2010 by Matthias Troyer -# Jan Gukelberger -# Adrian Feiguin -# -# This software is part of the ALPS libraries, published under the ALPS -# Library License; you can use, redistribute it and/or modify it under -# the terms of the license, either version 1 or (at your option) any later -# version. -# -# You should have received a copy of the ALPS Library License along with -# the ALPS Libraries; see the file LICENSE.txt. If not, the license is also -# available from http://alps.comp-phys.org/. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -# **************************************************************************** - -from __future__ import print_function -import sys - -ns = sys.argv[1] -nedges = str(int(ns) - 1) - -print('') -print(' ') -print(' 1') -for i in range(2,int(ns)): - print(' ' + str(i) + '') -print(' ' + ns + '') -for i in range(1,int(ns)): - nn = str(i + 1) - print(' ') - -print(' ') -print('') diff --git a/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_capped b/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_capped deleted file mode 100644 index d5b3d60d..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_capped +++ /dev/null @@ -1,14 +0,0 @@ -LATTICE_LIBRARY="my_lattice.xml" -LATTICE="open chain lattice with special edges" -MODEL="spin" -local_S0=0.5 -local_S1=1 -CONSERVED_QUANTUMNUMBERS="N,Sz" -J=1 -NUMBER_EIGENVALUES=1 -SWEEPS=6 -MAXSTATES=100 -MEASURE_LOCAL[Local magnetization]=Sz -{ Sz_total=0 } -{ Sz_total=1 } -{ Sz_total=2 } diff --git a/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_capped.py b/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_capped.py deleted file mode 100644 index a727d514..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_capped.py +++ /dev/null @@ -1,76 +0,0 @@ -# **************************************************************************** -# -# ALPS Project: Algorithms and Libraries for Physics Simulations -# -# ALPS Libraries -# -# Copyright (C) 2010 by Jan Gukelberger -# -# This software is part of the ALPS libraries, published under the ALPS -# Library License; you can use, redistribute it and/or modify it under -# the terms of the license, either version 1 or (at your option) any later -# version. -# -# You should have received a copy of the ALPS Library License along with -# the ALPS Libraries; see the file LICENSE.txt. If not, the license is also -# available from http://alps.comp-phys.org/. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -# **************************************************************************** - -import pyalps -import numpy as np -import matplotlib.pyplot as plt -import pyalps.plot - -#prepare the input parameters -parms = [] -for sz in [0,1,2]: - parms.append( { - 'LATTICE_LIBRARY' : 'my_lattice.xml', - 'LATTICE' : 'open chain lattice with special edges', - 'MODEL' : "spin", - 'local_S0' : '0.5', - 'local_S1' : '1', - 'CONSERVED_QUANTUMNUMBERS' : 'N,Sz', - 'Sz_total' : sz, - 'J' : 1, - 'SWEEPS' : 6, - 'NUMBER_EIGENVALUES' : 1, - 'MAXSTATES' : 100, - 'MEASURE_LOCAL[Local magnetization]' : 'Sz' - } ) - -#write the input file and run the simulation -input_file = pyalps.writeInputFiles('parm_spin_one_capped',parms) -res = pyalps.runApplication('dmrg',input_file,writexml=True) - -#load all measurements for all states -data = pyalps.loadEigenstateMeasurements(pyalps.getResultFiles(prefix='parm_spin_one_capped')) - -# extract local magnetization data -curves = [] -for run in data: - for s in run: - if s.props['observable'] == 'Local magnetization': - sz = s.props['Sz_total'] - s.props['label'] = '$S_z = ' + str(sz) + '$' - s.y = s.y.flatten() - curves.append(s) - -# Plot local magnetization vs. site -plt.figure() -pyalps.plot.plot(curves) -plt.legend() -plt.title('Magnetization of antiferromagnetic Heisenberg chain (S=1, spin-1/2 caps)') -plt.ylabel('local magnetization') -plt.xlabel('site') - -plt.show() diff --git a/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_half b/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_half deleted file mode 100644 index 94d92bc1..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_half +++ /dev/null @@ -1,12 +0,0 @@ -LATTICE="open chain lattice" -MODEL="spin" -CONSERVED_QUANTUMNUMBERS="N,Sz" -SWEEPS=6 -J=1 -NUMBER_EIGENVALUES=1 -MEASURE_LOCAL[Local magnetization]=Sz -L=64 -MAXSTATES=100 -{ Sz_total=0 } -{ Sz_total=1 } -{ Sz_total=2 } diff --git a/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_half.py b/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_half.py deleted file mode 100644 index 3bc39ae0..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_half.py +++ /dev/null @@ -1,75 +0,0 @@ -# **************************************************************************** -# -# ALPS Project: Algorithms and Libraries for Physics Simulations -# -# ALPS Libraries -# -# Copyright (C) 2010 by Jan Gukelberger -# -# This software is part of the ALPS libraries, published under the ALPS -# Library License; you can use, redistribute it and/or modify it under -# the terms of the license, either version 1 or (at your option) any later -# version. -# -# You should have received a copy of the ALPS Library License along with -# the ALPS Libraries; see the file LICENSE.txt. If not, the license is also -# available from http://alps.comp-phys.org/. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -# **************************************************************************** - -import pyalps -import numpy as np -import matplotlib.pyplot as plt -import pyalps.plot - -#prepare the input parameters -parms = [] -for sz in [0,1,2]: - parms.append( { - 'LATTICE' : "open chain lattice", - 'MODEL' : "spin", - 'CONSERVED_QUANTUMNUMBERS' : 'N,Sz', - 'Sz_total' : sz, - 'J' : 1, - 'SWEEPS' : 6, - 'NUMBER_EIGENVALUES' : 1, - 'L' : 64, - 'MAXSTATES' : 100, - 'MEASURE_LOCAL[Local magnetization]' : 'Sz' - } ) - -#write the input file and run the simulation -input_file = pyalps.writeInputFiles('parm_spin_one_half',parms) -res = pyalps.runApplication('dmrg',input_file,writexml=True) - -#load all measurements for all states -data = pyalps.loadEigenstateMeasurements(pyalps.getResultFiles(prefix='parm_spin_one_half')) - -# extract local magnetization data -curves = [] -for run in data: - for s in run: - if s.props['observable'] == 'Local magnetization': - sz = s.props['Sz_total'] - s.props['label'] = '$S_z = ' + str(sz) + '$' - s.y = s.y.flatten() - curves.append(s) - -# Plot local magnetization vs. site -plt.figure() -pyalps.plot.plot(curves) -plt.legend() -plt.title('Magnetization of antiferromagnetic Heisenberg chain (S=1/2)') -plt.ylabel('local magnetization') -plt.xlabel('site') - - -plt.show() diff --git a/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_uniform b/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_uniform deleted file mode 100644 index 30c944dd..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_uniform +++ /dev/null @@ -1,13 +0,0 @@ -LATTICE="open chain lattice" -MODEL="spin" -local_S=1 -CONSERVED_QUANTUMNUMBERS="N,Sz" -J=1 -L=64 -NUMBER_EIGENVALUES=1 -SWEEPS=6 -MAXSTATES=100 -MEASURE_LOCAL[Local magnetization]=Sz -{ Sz_total=0 } -{ Sz_total=1 } -{ Sz_total=2 } diff --git a/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_uniform.py b/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_uniform.py deleted file mode 100644 index 13617e51..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-05-local-observables/spin_one_uniform.py +++ /dev/null @@ -1,75 +0,0 @@ -# **************************************************************************** -# -# ALPS Project: Algorithms and Libraries for Physics Simulations -# -# ALPS Libraries -# -# Copyright (C) 2010 by Jan Gukelberger -# -# This software is part of the ALPS libraries, published under the ALPS -# Library License; you can use, redistribute it and/or modify it under -# the terms of the license, either version 1 or (at your option) any later -# version. -# -# You should have received a copy of the ALPS Library License along with -# the ALPS Libraries; see the file LICENSE.txt. If not, the license is also -# available from http://alps.comp-phys.org/. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -# **************************************************************************** - -import pyalps -import numpy as np -import matplotlib.pyplot as plt -import pyalps.plot - -#prepare the input parameters -parms = [] -for sz in [0,1,2]: - parms.append( { - 'LATTICE' : 'open chain lattice', - 'MODEL' : "spin", - 'local_S' : '1', - 'CONSERVED_QUANTUMNUMBERS' : 'N,Sz', - 'Sz_total' : sz, - 'J' : 1, - 'L' : 64, - 'SWEEPS' : 6, - 'NUMBER_EIGENVALUES' : 1, - 'MAXSTATES' : 100, - 'MEASURE_LOCAL[Local magnetization]' : 'Sz' - } ) - -#write the input file and run the simulation -input_file = pyalps.writeInputFiles('parm_spin_one_uniform',parms) -res = pyalps.runApplication('dmrg',input_file,writexml=True) - -#load all measurements for all states -data = pyalps.loadEigenstateMeasurements(pyalps.getResultFiles(prefix='parm_spin_one_uniform')) - -# extract local magnetization data -curves = [] -for run in data: - for s in run: - if s.props['observable'] == 'Local magnetization': - sz = s.props['Sz_total'] - s.props['label'] = '$S_z = ' + str(sz) + '$' - s.y = s.y.flatten() - curves.append(s) - -# Plot local magnetization vs. site -plt.figure() -pyalps.plot.plot(curves) -plt.legend() -plt.title('Magnetization of antiferromagnetic Heisenberg chain (S=1, uniform ends)') -plt.ylabel('local magnetization') -plt.xlabel('site') - -plt.show() diff --git a/content/en/tutorials/dmrg/codes/dmrg-06-correlations/my_lattices.xml b/content/en/tutorials/dmrg/codes/dmrg-06-correlations/my_lattices.xml deleted file mode 100644 index 0546823a..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-06-correlations/my_lattices.xml +++ /dev/null @@ -1,1043 +0,0 @@ - - - - - 0 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 - 65 - 66 - 67 - 68 - 69 - 70 - 71 - 72 - 73 - 74 - 75 - 76 - 77 - 78 - 79 - 80 - 81 - 82 - 83 - 84 - 85 - 86 - 87 - 88 - 89 - 90 - 91 - 92 - 93 - 94 - 95 - 96 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 - 65 - 66 - 67 - 68 - 69 - 70 - 71 - 72 - 73 - 74 - 75 - 76 - 77 - 78 - 79 - 80 - 81 - 82 - 83 - 84 - 85 - 86 - 87 - 88 - 89 - 90 - 91 - 92 - 93 - 94 - 95 - 96 - 97 - 98 - 99 - 100 - 101 - 102 - 103 - 104 - 105 - 106 - 107 - 108 - 109 - 110 - 111 - 112 - 113 - 114 - 115 - 116 - 117 - 118 - 119 - 120 - 121 - 122 - 123 - 124 - 125 - 126 - 127 - 128 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 - 65 - 66 - 67 - 68 - 69 - 70 - 71 - 72 - 73 - 74 - 75 - 76 - 77 - 78 - 79 - 80 - 81 - 82 - 83 - 84 - 85 - 86 - 87 - 88 - 89 - 90 - 91 - 92 - 93 - 94 - 95 - 96 - 97 - 98 - 99 - 100 - 101 - 102 - 103 - 104 - 105 - 106 - 107 - 108 - 109 - 110 - 111 - 112 - 113 - 114 - 115 - 116 - 117 - 118 - 119 - 120 - 121 - 122 - 123 - 124 - 125 - 126 - 127 - 128 - 129 - 130 - 131 - 132 - 133 - 134 - 135 - 136 - 137 - 138 - 139 - 140 - 141 - 142 - 143 - 144 - 145 - 146 - 147 - 148 - 149 - 150 - 151 - 152 - 153 - 154 - 155 - 156 - 157 - 158 - 159 - 160 - 161 - 162 - 163 - 164 - 165 - 166 - 167 - 168 - 169 - 170 - 171 - 172 - 173 - 174 - 175 - 176 - 177 - 178 - 179 - 180 - 181 - 182 - 183 - 184 - 185 - 186 - 187 - 188 - 189 - 190 - 191 - 192 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one b/content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one deleted file mode 100644 index ae496b8b..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one +++ /dev/null @@ -1,16 +0,0 @@ -LATTICE_LIBRARY="my_lattices.xml" -LATTICE="open chain lattice with special edges 64" -MODEL="spin" -local_S0=0.5 -local_S1=1 -CONSERVED_QUANTUMNUMBERS="N,Sz" -Sz_total=0 -SWEEPS=6 -J=1 -NUMBER_EIGENVALUES=1 -MEASURE_AVERAGE[Magnetization]=Sz -MEASURE_AVERAGE[Exchange]=exchange -MEASURE_LOCAL[Local magnetization]=Sz -MEASURE_CORRELATIONS[Diagonal spin correlations]=Sz -MEASURE_CORRELATIONS[Offdiagonal spin correlations]="Splus:Sminus" -MAXSTATES=100 diff --git a/content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one.py b/content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one.py deleted file mode 100644 index 8d9975a1..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one.py +++ /dev/null @@ -1,91 +0,0 @@ -from __future__ import division -# **************************************************************************** -# -# ALPS Project: Algorithms and Libraries for Physics Simulations -# -# ALPS Libraries -# -# Copyright (C) 2010 by Jan Gukelberger -# -# This software is part of the ALPS libraries, published under the ALPS -# Library License; you can use, redistribute it and/or modify it under -# the terms of the license, either version 1 or (at your option) any later -# version. -# -# You should have received a copy of the ALPS Library License along with -# the ALPS Libraries; see the file LICENSE.txt. If not, the license is also -# available from http://alps.comp-phys.org/. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -# **************************************************************************** - -import pyalps -import numpy as np -import matplotlib.pyplot as plt -import pyalps.plot - -#prepare the input parameters -parms = [] -L = 64 -parms.append( { - 'LATTICE_LIBRARY' : 'my_lattices.xml', - 'LATTICE' : 'open chain lattice with special edges '+str(L), - 'MODEL' : 'spin', - 'local_S0' : 0.5, - 'local_S1' : 1, - 'CONSERVED_QUANTUMNUMBERS' : 'N,Sz', - 'Sz_total' : 0, - 'J' : 1, - 'SWEEPS' : 6, - 'NUMBER_EIGENVALUES' : 1, - 'MAXSTATES' : 100, - 'MEASURE_AVERAGE[Magnetization]' : 'Sz', - 'MEASURE_AVERAGE[Exchange]' : 'exchange', - 'MEASURE_LOCAL[Local magnetization]' : 'Sz', - 'MEASURE_CORRELATIONS[Diagonal spin correlations]' : 'Sz', - 'MEASURE_CORRELATIONS[Offdiagonal spin correlations]' : 'Splus:Sminus' - } ) - - -#write the input file and run the simulation -input_file = pyalps.writeInputFiles('parm_spin_one',parms) -res = pyalps.runApplication('dmrg',input_file,writexml=True) - -#load all measurements for all states -data = pyalps.loadEigenstateMeasurements(pyalps.getResultFiles(prefix='parm_spin_one')) - -# extract Sz correlation data -curves = [] -for run in data: - for s in run: - if s.props['observable'] == 'Diagonal spin correlations': - d = pyalps.DataSet() - d.props['observable'] = 'Sz correlations' - d.props['label'] = 'D = '+str(s.props['MAXSTATES']) - d.x = np.arange(L) - - # sites with increasing distance l symmetric to the chain center - site1 = np.array([int(-(l+1)/2.0) for l in range(0,L)]) + L//2 - site2 = np.array([int( l /2.0) for l in range(0,L)]) + L//2 - indices = L*site1 + site2 - d.y = abs(s.y[0][indices]) - - curves.append(d) - -# Plot correlation vs. distance -plt.figure() -pyalps.plot.plot(curves) -plt.yscale('log') -plt.legend() -plt.title('Spin correlations in antiferromagnetic Heisenberg chain (S=1)') -plt.ylabel('correlations $| \\langle S^z_{L/2-l/2} S^z_{L/2+l/2} \\rangle |$') -plt.xlabel('distance $l$') - -plt.show() diff --git a/content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one_half b/content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one_half deleted file mode 100644 index cb15bc6b..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one_half +++ /dev/null @@ -1,16 +0,0 @@ -LATTICE="open chain lattice" -MODEL="spin" -CONSERVED_QUANTUMNUMBERS="N,Sz" -SWEEPS=6 -J=1 -NUMBER_EIGENVALUES=1 -MEASURE_AVERAGE[Magnetization]=Sz -MEASURE_AVERAGE[Exchange]=exchange -MEASURE_LOCAL[Local magnetization]=Sz -MEASURE_CORRELATIONS[Diagonal spin correlations]=Sz -MEASURE_CORRELATIONS[Offdiagonal spin correlations]="Splus:Sminus" -L=64 -MAXSTATES=100 -{ Sz_total=0 } -{ Sz_total=1 } -{ Sz_total=2 } diff --git a/content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one_half.py b/content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one_half.py deleted file mode 100644 index 69abee10..00000000 --- a/content/en/tutorials/dmrg/codes/dmrg-06-correlations/spin_one_half.py +++ /dev/null @@ -1,91 +0,0 @@ -from __future__ import division -# **************************************************************************** -# -# ALPS Project: Algorithms and Libraries for Physics Simulations -# -# ALPS Libraries -# -# Copyright (C) 2010 by Jan Gukelberger -# -# This software is part of the ALPS libraries, published under the ALPS -# Library License; you can use, redistribute it and/or modify it under -# the terms of the license, either version 1 or (at your option) any later -# version. -# -# You should have received a copy of the ALPS Library License along with -# the ALPS Libraries; see the file LICENSE.txt. If not, the license is also -# available from http://alps.comp-phys.org/. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -# **************************************************************************** - -import pyalps -import numpy as np -import matplotlib.pyplot as plt -import pyalps.plot - -#prepare the input parameters -parms = [] -for sz in [0,1,2]: - parms.append( { - 'LATTICE' : 'open chain lattice', - 'MODEL' : 'spin', - 'CONSERVED_QUANTUMNUMBERS' : 'N,Sz', - 'Sz_total' : sz, - 'J' : 1, - 'SWEEPS' : 6, - 'NUMBER_EIGENVALUES' : 1, - 'L' : 64, - 'MAXSTATES' : 100, - 'MEASURE_AVERAGE[Magnetization]' : 'Sz', - 'MEASURE_AVERAGE[Exchange]' : 'exchange', - 'MEASURE_LOCAL[Local magnetization]' : 'Sz', - 'MEASURE_CORRELATIONS[Diagonal spin correlations]' : 'Sz', - 'MEASURE_CORRELATIONS[Offdiagonal spin correlations]' : 'Splus:Sminus' - } ) - -#write the input file and run the simulation -input_file = pyalps.writeInputFiles('parm_spin_one_half',parms) -res = pyalps.runApplication('dmrg',input_file,writexml=True) - -#load all measurements for all states -data = pyalps.loadEigenstateMeasurements(pyalps.getResultFiles(prefix='parm_spin_one_half')) - -# extract Sz correlation data -curves = [] -for run in data: - for s in run: - if s.props['observable'] == 'Diagonal spin correlations': - d = pyalps.DataSet() - d.props['observable'] = 'Sz correlations' - d.props['label'] = '$S_z^{tot}$ = '+str(s.props['Sz_total']) - L = int(s.props['L']) - d.x = np.arange(L) - - # sites with increasing distance l symmetric to the chain center - site1 = np.array([int(-(l+1)/2.0) for l in range(0,L)]) + L//2 - site2 = np.array([int( l /2.0) for l in range(0,L)]) + L//2 - indices = L*site1 + site2 - d.y = abs(s.y[0][indices]) - - curves.append(d) - -# Plot correlation vs. distance -plt.figure() -pyalps.plot.plot(curves) -plt.xscale('log') -plt.yscale('log') -plt.legend() -plt.title('Spin correlations in antiferromagnetic Heisenberg chain (S=1/2)') -plt.ylabel('correlations $| \\langle S^z_{L/2-l/2} S^z_{L/2+l/2} \\rangle |$') -plt.xlabel('distance $l$') - - -plt.show() diff --git a/content/en/tutorials/dmrg/dmrg03.md b/content/en/tutorials/dmrg/dmrg03.md index ea18d799..ec91bcb9 100644 --- a/content/en/tutorials/dmrg/dmrg03.md +++ b/content/en/tutorials/dmrg/dmrg03.md @@ -45,7 +45,7 @@ The first example consists of setting up a simulation for a spin-1/2 Heisenberg ###### Using parameter files -The parameter file `spin_one_half` sets the most important parameters: +The parameter file `spin_one_half` sets the most important parameters: ```python LATTICE="open chain lattice" @@ -72,7 +72,7 @@ DMRG will perform four sweeps, (four half-sweps from left to right and four half ###### Using Python -To set up and run the simulation in Python we use the script `spin_one_half.py`. The first part of this script imports the required modules, prepares the input files as a list of Python dictionaries, writes the input files and runs the application: +To set up and run the simulation in Python we use the script `spin_one_half.py`. The first part of this script imports the required modules, prepares the input files as a list of Python dictionaries, writes the input files and runs the application: ```python import pyalps @@ -150,7 +150,7 @@ For the single run above (L=32, MAXSTATES=100, J=1), the ground state energy war ###### Using parameter files -We now proceed to illustrate how to setup several runs in a single parameter file `spin_one_half_multiple`. We shall use the example proposed in the tutorial, and simulate a chain of length L=32, changing the number of DMRG states (we shall use a smaller number of states for illustration purposes): +We now proceed to illustrate how to setup several runs in a single parameter file `spin_one_half_multiple`. We shall use the example proposed in the tutorial, and simulate a chain of length L=32, changing the number of DMRG states (we shall use a smaller number of states for illustration purposes): ```python LATTICE="open chain lattice" @@ -176,7 +176,7 @@ In this case, we will find three output files `spin_one_half_multiple.task#.out. ###### Using Python -The script `spin_one_half_multiple.py` sets up three Python dictionaries of parameters with differing MAXSTATES: +The script `spin_one_half_multiple.py` sets up three Python dictionaries of parameters with differing MAXSTATES: ```python parms= [] @@ -221,7 +221,7 @@ for run in data: | `NUMBER_EIGENVALUES` | eigenstates requested | 1 | | `MAXSTATES` | bond dimension $D$ kept after truncation | 100 (single run); 20, 40, 60 (multiple runs) | -The S=1 Heisenberg chain requires some special treatment due to the open boundary conditions. As explained in [DMRG-01](../dmrg01), we need to include two sites at both ends of the chain with a spin S=1/2 on each of them. This requires defining a new lattice file for the simulation. As it turns out, there is not a straightforward way to do this, so we will have to do it manually. To simplify the process, we have included a simple Python script `build_lattice.py` that will generate the lattice for us. The only input is the number of sites in the lattice. +The S=1 Heisenberg chain requires some special treatment due to the open boundary conditions. As explained in [DMRG-01](../dmrg01), we need to include two sites at both ends of the chain with a spin S=1/2 on each of them. This requires defining a new lattice file for the simulation. As it turns out, there is not a straightforward way to do this, so we will have to do it manually. To simplify the process, we have included a simple Python script `build_lattice.py` that will generate the lattice for us. The only input is the number of sites in the lattice. ##### Lattice @@ -287,7 +287,7 @@ python build_lattice.py 32 > my_lattice.xml ##### Using parameter files -Let us see how the final parameter file `spin_one` should look like: +Let us see how the final parameter file `spin_one` should look like: ```python LATTICE_LIBRARY="my_lattice.xml" @@ -303,7 +303,7 @@ NUMBER_EIGENVALUES=1 {MAXSTATES=100} ``` -Clearly, it is cumbersome to repeat this process for each system size. One way to simplify it even further is to write a script to do it for us automatically. A simpler approach is to define all the lattices we need in a lattice library. We have included a `my_lattices.xml` file with lattices of sizes $L=32,64,96,128,192$. All we have to do is modify the previous parameter file by replacing the lattice definition as follows: +Clearly, it is cumbersome to repeat this process for each system size. One way to simplify it even further is to write a script to do it for us automatically. A simpler approach is to define all the lattices we need in a lattice library. We have included a `my_lattices.xml` file with lattices of sizes $L=32,64,96,128,192$. All we have to do is modify the previous parameter file by replacing the lattice definition as follows: ```python LATTICE_LIBRARY="my_lattices.xml" @@ -313,7 +313,7 @@ where we have included the lattice size in the name. ##### Using Python -The script `spin_one.py` defines the parameters in a Python dictionary: +The script `spin_one.py` defines the parameters in a Python dictionary: ```python parms = [ { @@ -341,7 +341,7 @@ For this S=1 single run (L=32, MAXSTATES=100, J=1), the ground state energy warm ###### Using parameter files -Same as for the spin S=1/2 case, we can now setup multiple runs in a single parameter file named `spin_one_multiple` as follows: +Same as for the spin S=1/2 case, we can now setup multiple runs in a single parameter file named `spin_one_multiple` as follows: ```python LATTICE_LIBRARY="my_lattices.xml" @@ -361,7 +361,7 @@ SWEEPS=4 ###### Using Python -The same runs can be set up with the script `spin_one_multiple.py`, which can be obtained from the corresponding spin-1/2 script by replacing the parameters. +The same runs can be set up with the script `spin_one_multiple.py`, which can be obtained from the corresponding spin-1/2 script by replacing the parameters. ### Ground State Energies Per Site (Bond) diff --git a/content/en/tutorials/dmrg/dmrg04.md b/content/en/tutorials/dmrg/dmrg04.md index 3d0e62e5..97987702 100644 --- a/content/en/tutorials/dmrg/dmrg04.md +++ b/content/en/tutorials/dmrg/dmrg04.md @@ -58,7 +58,7 @@ The built-in `open chain lattice`, spin-1/2 on every site; see the [ALPS lattice ##### Using parameter files -In this example below, we include a line in the parameter file for the spin S=1/2 chain `spin_one_half_gap` to tell the code that we also want to calculate the energy for the first excited state. The algorithm will build a density matrix targeting two states: the ground-state, and the first excited state, both in the same subspace with Sz=0. Since the first excited state is a triplet, this will yield the singlet-triplet gap: +In this example below, we include a line in the parameter file for the spin S=1/2 chain `spin_one_half_gap` to tell the code that we also want to calculate the energy for the first excited state. The algorithm will build a density matrix targeting two states: the ground-state, and the first excited state, both in the same subspace with Sz=0. Since the first excited state is a triplet, this will yield the singlet-triplet gap: ```python LATTICE="open chain lattice" @@ -77,7 +77,7 @@ It is important to notice that the entanglement entropy in this example is total ##### Using Python -The script `spin_one_half_gap.py` runs the same simulation as the spin-1/2 script from the [DMRG-03](../dmrg03) tutorial, except for changing the requested NUMBER_EIGENVALUES to two, and loads all data for these eigenstates: +The script `spin_one_half_gap.py` runs the same simulation as the spin-1/2 script from the [DMRG-03](../dmrg03) tutorial, except for changing the requested NUMBER_EIGENVALUES to two, and loads all data for these eigenstates: ```python import pyalps @@ -165,11 +165,11 @@ J=1 {L=32, MAXSTATES=40} ``` -You can download this file from here: `spin_one_half_triplet`. +You can download this file from here: `spin_one_half_triplet`. ##### Using Python -The script `spin_one_half_triplet.py` runs a simulation for both Sz sectors defined by two Python dictionaries with the parameters: +The script `spin_one_half_triplet.py` runs a simulation for both Sz sectors defined by two Python dictionaries with the parameters: ```python import pyalps @@ -227,7 +227,7 @@ The plot below shows the spin-1/2 singlet-triplet gap versus $1/L$ at fixed $D=1 ![](/figs/dmrg/extrapolationGapSHalf.png) -Modify the file `spin_one_half_multiple` to setup all the runs for Sz=0 and Sz=1, for different system sizes and different number of states. Use five sweeps, and extrapolate the value of the gap following the procedure outlined in the tutorial. +Modify the file `spin_one_half_multiple` to setup all the runs for Sz=0 and Sz=1, for different system sizes and different number of states. Use five sweeps, and extrapolate the value of the gap following the procedure outlined in the tutorial. The case of the spin-1/2 chain is a bit frustrating: even pushing the computer to its limits, the most that can be said is that the gap appears extremely small and therefore is likely to vanish. Nothing in the data rules out a gap of, say, $e^{-50}$. This is a sobering reminder of the limits of even a highly accurate numerical method. diff --git a/content/en/tutorials/dmrg/dmrg05.md b/content/en/tutorials/dmrg/dmrg05.md index efd7050f..9de70da7 100644 --- a/content/en/tutorials/dmrg/dmrg05.md +++ b/content/en/tutorials/dmrg/dmrg05.md @@ -75,7 +75,7 @@ $$E(S^z_{tot}=2) - E(S^z_{tot}=1) = \big[\text{edge} + \text{magnon}\big] - \big ### Running it -The uniform chain needs no lattice file — `open chain lattice` with `local_S=1` is enough. The parameter file `spin_one_uniform` sets up three runs, one per sector: +The uniform chain needs no lattice file — `open chain lattice` with `local_S=1` is enough. The parameter file `spin_one_uniform` sets up three runs, one per sector: LATTICE="open chain lattice" MODEL="spin" @@ -94,7 +94,7 @@ The uniform chain needs no lattice file — `open chain lattice` with `local_S=1 parameter2xml spin_one_uniform dmrg --write-xml spin_one_uniform.in.xml -or equivalently from Python, with `spin_one_uniform.py`: +or equivalently from Python, with `spin_one_uniform.py`: import pyalps parms = [] @@ -176,7 +176,7 @@ Nothing about the bulk has changed: the Haldane gap, the correlation length and ### Running it -The capped chain does need a lattice file. `build_lattice.py` writes an open +The capped chain does need a lattice file. `build_lattice.py` writes an open chain whose two end vertices are given a separate type, so they can be assigned a different spin; pass it the **total** number of sites, i.e. two more than the number of spin-1 sites you want: @@ -184,7 +184,7 @@ number of spin-1 sites you want: python build_lattice.py 66 > my_lattice.xml That gives 64 spin-1 sites with a spin-1/2 attached at each end. The parameter -file `spin_one_capped` is then the same as before apart from the lattice and the two local spins: +file `spin_one_capped` is then the same as before apart from the lattice and the two local spins: LATTICE_LIBRARY="my_lattice.xml" LATTICE="open chain lattice with special edges" @@ -204,7 +204,7 @@ file `spin parameter2xml spin_one_capped dmrg --write-xml spin_one_capped.in.xml -or from Python, with `spin_one_capped.py`: +or from Python, with `spin_one_capped.py`: import pyalps parms = [] @@ -262,7 +262,7 @@ Repeat a similar calculation for the spin-1/2 chain in the lowest magnetization ### Using parameter files -The following parameter file `spin_one_half` will accomplish this task: +The following parameter file `spin_one_half` will accomplish this task: LATTICE="open chain lattice" MODEL="spin" @@ -282,7 +282,7 @@ The following parameter file `spin_one_half.py` is the same as the `spin_one_uniform` script explained above. +Apart from the obvious parameter changes, the script `spin_one_half.py` is the same as the `spin_one_uniform` script explained above. ## Summary diff --git a/content/en/tutorials/dmrg/dmrg06.md b/content/en/tutorials/dmrg/dmrg06.md index 0fe7b8b5..b8b0d4e1 100644 --- a/content/en/tutorials/dmrg/dmrg06.md +++ b/content/en/tutorials/dmrg/dmrg06.md @@ -63,7 +63,7 @@ The result is a power law at short distances, crossing over to a faster, in fact #### Using parameter files -The following parameter file `spin_one_half` will setup this run for us (once again, for illustration we shall use a smaller system and number of states than the more realistic numbers stated above). The example uses a chain of length $L=64$ at $D=100$, with one run in each of the three lowest magnetization sectors, and 6 sweeps. The correlations should come out symmetric: +The following parameter file `spin_one_half` will setup this run for us (once again, for illustration we shall use a smaller system and number of states than the more realistic numbers stated above). The example uses a chain of length $L=64$ at $D=100$, with one run in each of the three lowest magnetization sectors, and 6 sweeps. The correlations should come out symmetric: LATTICE="open chain lattice" MODEL="spin" @@ -87,7 +87,7 @@ The following parameter file `spin_one_half.py` sets up one run per magnetization sector and loads the results: +The script `spin_one_half.py` sets up one run per magnetization sector and loads the results: import pyalps import numpy as np @@ -197,7 +197,7 @@ In fact, the calculation of correlation lengths is much harder to converge than #### Using parameter files -The parameter file `spin_one` looks much like the one for the previous example, but replacing the lattice and the model as follows. As above, the run shown here uses a smaller system than the more realistic $L=192$ quoted earlier: the 64-site capped chain from the lattice library, at $D=100$. +The parameter file `spin_one` looks much like the one for the previous example, but replacing the lattice and the model as follows. As above, the run shown here uses a smaller system than the more realistic $L=192$ quoted earlier: the 64-site capped chain from the lattice library, at $D=100$. LATTICE_LIBRARY="my_lattices.xml" LATTICE="open chain lattice with special edges 64" @@ -221,7 +221,7 @@ The parameter file `sp #### Using Python -The main difference of the script `spin_one.py` with respect to the previous one is the definition of lattice and model: +The main difference of the script `spin_one.py` with respect to the previous one is the definition of lattice and model: parms = [] L = 64