Commit f958f52c authored by Johannes Hofmann (Laptop)'s avatar Johannes Hofmann (Laptop)
Browse files

Merge branch 'master' of git.physik.uni-wuerzburg.de:ALF/ALF_Tutorial

parents 6dab1fb7 b2972b47
...@@ -274,21 +274,39 @@ which opens the ``notebook dashboard'' in your default browser, where you can na ...@@ -274,21 +274,39 @@ which opens the ``notebook dashboard'' in your default browser, where you can na
A lot already comes implemented in ALF, but unavoidably, as one proceeds in their own investigations, a new model has to be implemented or a new observable defined -- and for that, one must grapple with the package's Fortran source code. A lot already comes implemented in ALF, but unavoidably, as one proceeds in their own investigations, a new model has to be implemented or a new observable defined -- and for that, one must grapple with the package's Fortran source code.
This second part of the tutorial consists in a set of guided exercises that exemplify how to make basic additions to the code, taking as starting point the template-like, relatively self-contained module \texttt{Hamiltonian\_Hubbard\_Plain\_Vanilla\_mod.F90}, which is also a good display of ALF's internal workings. This second part of the tutorial consists in a set of guided exercises that exemplify how to make basic additions to the code, taking as starting point the template-like, relatively self-contained module \texttt{Hamiltonian\_Hubbard\_Plain\_Vanilla\_mod.F90}, which is also a good display of ALF's internal workings.
These worked-out exercises, together with ALF's modularity provided by its Predefined Structures should make getting your hands dirty less daunting than it may sound. These worked-out exercises, together with ALF's modularity, boosted by its Predefined Structures, should make getting your hands dirty less daunting than it may sound.
\section*{Downloading the code and tutorial} \section*{Downloading and using the code and tutorial}
One can use the ALF package downloaded automatically by the Python script in the first part of this tutorial, or manually, by typing One can use the ALF package downloaded automatically by the Python script in the first part of this tutorial, or manually, by typing
\begin{lstlisting}[style=bash] \begin{lstlisting}[style=bash]
git clone git@git.physik.uni-wuerzburg.de:ALF/ALF.git git clone git@git.physik.uni-wuerzburg.de:ALF/ALF.git
\end{lstlisting} \end{lstlisting}
in a shell. The necessary environment variables and the directives for compiling the code are set by the script \texttt{configure.sh}: \lstinline[style=bash]|source configure.sh GNU|, followed by the command \lstinline[style=bash,morekeywords={make}]|make|. Details and further options are described in the package's documentation found in its repository. in a shell. Similarly, to download the tutorial, including solutions, enter:
Similarly, to download the tutorial, including solutions, enter:
\begin{lstlisting}[style=bash] \begin{lstlisting}[style=bash]
git clone git@git.physik.uni-wuerzburg.de:ALF/ALF_Tutorial.git git clone git@git.physik.uni-wuerzburg.de:ALF/ALF_Tutorial.git
\end{lstlisting} \end{lstlisting}
The necessary environment variables and the directives for compiling the code are set by the script \texttt{configure.sh}: \lstinline[style=bash]|source configure.sh GNU|, followed by the command \lstinline[style=bash,morekeywords={make}]|make|. Details and further options are described in the package's documentation found in its repository.
A workflow you can adopt for solving the exercises -- or indeed using ALF in general -- is the following:
\begin{enumerate}
\item Compile the modified Hamiltonian module, for instance:\\
\lstinline[style=bash,morekeywords={make}]{make Hubbard_Plain_Vanilla}
\item Create a data directory with the content of \texttt{Start}:\\
\lstinline[style=bash,morekeywords={cp}]{cp -r ./Start ./Run && cd ./Run/}
\item Run its executable, e.g., serially:\\
\lstinline[style=bash]{$ALF_DIR/Prog/Hamiltonians/Hubbard_Plain_Vanilla.out} %$
\item Perform default analyses\footnote{The \texttt{analysis.sh} bash script from earlier versions of ALF, run without arguments, is still available in the \texttt{Start} directory.}:\\
\lstinline[style=bash]{$ALF_DIR/Analysis/ana.out *} %$
\end{enumerate}
The structure of the data files and details on the analysis output can be found in ALF's documentation.
%Two common pitfalls are:
%\begin{itemize}
% \item forgetting to run \texttt{configure.sh}, and
% \item not using different \texttt{Run} data directories for independent runs.
%\end{itemize}
\exercise{Dimensional crossover} \exercise{Dimensional crossover}
...@@ -296,7 +314,7 @@ git clone git@git.physik.uni-wuerzburg.de:ALF/ALF_Tutorial.git ...@@ -296,7 +314,7 @@ git clone git@git.physik.uni-wuerzburg.de:ALF/ALF_Tutorial.git
Here we will modify the code so as to allow for different hopping matrix elements along the $x$ and $y$ directions of a square lattice. Here we will modify the code so as to allow for different hopping matrix elements along the $x$ and $y$ directions of a square lattice.
\exerciseitem{Modifying the hopping} \exerciseitem{Modifying the hopping}
To do so we start from the module \texttt{Hamiltonian\_Hubbard\_Plain\_Vanilla\_mod.F90} found in \texttt{\$ALF\_DIR/Prog/Hamiltonians/}, which we here shorten to ``\texttt{Vanilla}'', and then: To do so we start from the module \texttt{Hamiltonian\_Hubbard\_Plain\_Vanilla\_mod.F90}, which we here shorten to ``\texttt{Vanilla}'', found in \texttt{\$ALF\_DIR/Prog/Hamiltonians/}, proceeding as follows:
\begin{itemize} \begin{itemize}
\item Add \texttt{Ham\_Ty} to the \texttt{VAR\_Hubbard\_Plain\_Vanilla} name space in the parameter file \texttt{parameters}. \item Add \texttt{Ham\_Ty} to the \texttt{VAR\_Hubbard\_Plain\_Vanilla} name space in the parameter file \texttt{parameters}.
\item Declare a new variable, \texttt{Ham\_Ty}, in the module's specification (just search for the declaration of \texttt{Ham\_T} in \texttt{Vanilla}). \item Declare a new variable, \texttt{Ham\_Ty}, in the module's specification (just search for the declaration of \texttt{Ham\_T} in \texttt{Vanilla}).
...@@ -321,12 +339,11 @@ Do I = 1,Latt%N ...@@ -321,12 +339,11 @@ Do I = 1,Latt%N
Enddo Enddo
\end{lstlisting} \end{lstlisting}
\end{itemize} \end{itemize}
Note: If you'd like to run the simulation using MPI, you should also add the broadcasting call for \texttt{Ham\_Ty} to \texttt{Ham\_Set}. It is a good idea as well to include the new variable to the simulation parameters written into the file \texttt{info}, also in \texttt{Ham\_Set}. Note: If you'd like to run the simulation using MPI, you should also add the broadcasting call for \texttt{Ham\_Ty} to \texttt{Ham\_Set}. It is a good idea as well to get the new simulation parameter written into the file \texttt{info}, also a change in \texttt{Ham\_Set}.
In the directory \texttt{Solutions/Exercise\_1} we have duplicated ALF's code and commented the changes that have to be carried out to the file \texttt{Hamiltonian\_Hubbard\_Plain\_Vanilla\_mod.F90} in the \texttt{Prog} directory. The solution directory also includes reference data and the necessary \texttt{Start} directory (remember to copy its contents to every new \texttt{Run} directory, and to have a different \texttt{Run} directory for each simulation). In the directory \texttt{Solutions/Exercise\_1} we have duplicated ALF's code and commented the changes that have to be carried out to the file \texttt{Hamiltonian\_Hubbard\_Plain\_Vanilla\_mod.F90}, found in the \texttt{Prog/Hamiltonians} directory. The solution directory also includes the modified and original modules, as well as reference data and the necessary \texttt{Start} directory (remember to copy its contents to every new \texttt{Run} directory, and to have a different \texttt{Run} directory for each simulation).
\noindent As an application of this code, we can once again consider a ladder system (e.g, a 2-leg ladder with \texttt{L1=14} and \texttt{L2=2}), for different values of \texttt{Ham\_Ty}. The results you should obtain for the total spin correlation function (file \texttt{SpinT\_eqJR}) are summarized in Fig.~\ref{fig:ladder}.
As an application of this code, we can once again consider a ladder system (e.g, a 2-leg ladder with \texttt{L1=14} and \texttt{L2=2}), for different values of \texttt{Ham\_Ty}. The results you should obtain are summarized in Fig.~\ref{fig:ladder}.
\begin{figure}[h] \begin{figure}[h]
\begin{center} \begin{center}
...@@ -361,7 +378,7 @@ Note that the t-V model is already implemented in ALF in the module \texttt{Hami ...@@ -361,7 +378,7 @@ Note that the t-V model is already implemented in ALF in the module \texttt{Hami
\exerciseitem{Define new model} \exerciseitem{Define new model}
In the directory \texttt{\$ALF\_DIR/Solutions/Exercise\_2} we have duplicated the ALF and commented the changes that have to be carried out to the file \texttt{Hamiltonian\_Hubbard\_Plain\_Vanilla\_mod.F90} found in \texttt{\$ALF\_DIR/Prog/Hamiltonians/}, which we here shorten to ``\texttt{Vanilla}''. The following are the essential steps to be carried out: In the directory \texttt{\$ALF\_DIR/Solutions/Exercise\_2} we have duplicated the ALF and commented the changes that have to be carried out to the file \texttt{Hamiltonian\_Hubbard\_Plain\_Vanilla\_mod.F90}, which we here shorten to ``\texttt{Vanilla}'', found in \texttt{\$ALF\_DIR/Prog/Hamiltonians/}. The following are the essential steps to be carried out:
\begin{itemize} \begin{itemize}
\item Add the \texttt{VAR\_t\_V} name space in the file \texttt{parameters} and set the necessary variables -- or simply rename the \texttt{VAR\_Hubbard\_Plain\_Vanilla} name space to \texttt{VAR\_t\_V} and, within it, \texttt{Ham\_U} to \texttt{Ham\_Vint}. (Ignore the name space \texttt{VAR\_tV}, which is used by the general implementation mentioned above.) \item Add the \texttt{VAR\_t\_V} name space in the file \texttt{parameters} and set the necessary variables -- or simply rename the \texttt{VAR\_Hubbard\_Plain\_Vanilla} name space to \texttt{VAR\_t\_V} and, within it, \texttt{Ham\_U} to \texttt{Ham\_Vint}. (Ignore the name space \texttt{VAR\_tV}, which is used by the general implementation mentioned above.)
\item Declare a new variable, \texttt{Ham\_Vint}, in \texttt{Vanilla}'s specification. \item Declare a new variable, \texttt{Ham\_Vint}, in \texttt{Vanilla}'s specification.
...@@ -373,43 +390,77 @@ e^{\Delta \tau \frac{V}{2} \left( \hat{c}^{\dagger}_{i} \hat{c}^{\phantom\dagge ...@@ -373,43 +390,77 @@ e^{\Delta \tau \frac{V}{2} \left( \hat{c}^{\dagger}_{i} \hat{c}^{\phantom\dagge
\sum_{l= \pm1, \pm 2} \gamma_l e^{ \sqrt{\Delta \tau \frac{V}{2}} \eta_l \left( \hat{c}^{\dagger}_{i} \hat{c}^{\phantom\dagger}_{i+a} + \hat{c}^{\dagger}_{i+a} \hat{c}^{\phantom\dagger}_{i} \right) } = \sum_{l= \pm1, \pm 2} \gamma_l e^{ g \eta_l \left( \hat{c}^{\dagger}_{i}, \hat{c}^{\dagger}_{i+a} \right) O \sum_{l= \pm1, \pm 2} \gamma_l e^{ \sqrt{\Delta \tau \frac{V}{2}} \eta_l \left( \hat{c}^{\dagger}_{i} \hat{c}^{\phantom\dagger}_{i+a} + \hat{c}^{\dagger}_{i+a} \hat{c}^{\phantom\dagger}_{i} \right) } = \sum_{l= \pm1, \pm 2} \gamma_l e^{ g \eta_l \left( \hat{c}^{\dagger}_{i}, \hat{c}^{\dagger}_{i+a} \right) O
\left(\hat{c}^{\phantom\dagger}_{i}, \hat{c}^{\phantom\dagger}_{i+a} \right)^{T} }. \left(\hat{c}^{\phantom\dagger}_{i}, \hat{c}^{\phantom\dagger}_{i+a} \right)^{T} }.
\end{equation} \end{equation}
Here is how this translates in the code. Here is how this translates in the code (the new integer variable, \texttt{i2}, should be declared):
\begin{lstlisting}[style=fortran] \begin{lstlisting}[style=fortran]
Allocate(Op_V(Ndim,N_FL))
Allocate(Op_V(Latt%N,N_FL))
do nf = 1,N_FL do nf = 1,N_FL
do i = 1, N_coord*Ndim do i = 1, Ndim
call Op_make(Op_V(i,nf),2) call Op_make(Op_V(i,nf),2)
enddo enddo
enddo enddo
Do nc = 1, Latt%N ! Runs over bonds = # of lattice sites in one-dimension. Do i = 1, Ndim ! Runs over bonds = # of lattice sites in one-dimension.
I1 = nc i2 = Latt%nnlist(i,1,0)
I2 = Latt%nnlist(I1,1,0) Op_V(i,nf)%P(1) = i
Op_V(nc,1)%P(1) = I1 Op_V(i,nf)%P(2) = i2
Op_V(nc,1)%P(2) = I2 Op_V(i,nf)%O(1,2) = cmplx(1.d0 ,0.d0, kind(0.d0))
Op_V(nc,1)%O(1,2) = cmplx(1.d0 ,0.d0, kind(0.D0)) Op_V(i,nf)%O(2,1) = cmplx(1.d0 ,0.d0, kind(0.d0))
Op_V(nc,1)%O(2,1) = cmplx(1.d0 ,0.d0, kind(0.D0)) Op_V(i,nf)%g = sqrt(cmplx(Dtau*Ham_Vint/2.d0, 0.d0, kind(0.d0)))
Op_V(nc,1)%g = SQRT(CMPLX( DTAU*Ham_Vint/2.d0, 0.D0, kind(0.D0))) Op_V(i,nf)%alpha = cmplx(0d0 ,0.d0, kind(0.d0))
Op_V(nc,1)%alpha = cmplx(0d0,0.d0, kind(0.D0)) Op_V(i,nf)%type = 2
Op_V(nc,1)%type =2 Call Op_set( Op_V(i,nf) )
Call Op_set( Op_V(nc,1) ) enddo
\end{lstlisting}
\item Finally, you have to update the \texttt{Obser} and \texttt{ObserT} routines for the calculation of equal- and time-displaced correlations. For the \texttt{t\_V} model you can essentially use the same observables as for the \texttt{Hubbard\_SU(2)} model in 1D -- a step which requires a number of changes with respect to the \texttt{Vanilla} base, such as:
\begin{lstlisting}[style=fortran]
!!!!! Modifications for Exercise 2
!Zpot = Zpot*ham_U ! Vanilla
Zpot = Zpot*Ham_Vint ! t-V
!!!!!
\end{lstlisting}
and
\begin{lstlisting}[style=fortran]
!Zrho = Zrho + Grc(i,i,1) + Grc(i,i,2) ! Vanilla
Zrho = Zrho + Grc(i,i,1) ! t-V
\end{lstlisting}
with the observables being coded in the routine \texttt{Obser} as
\begin{lstlisting}[style=fortran]
Z = cmplx(dble(N_SUN), 0.d0, kind(0.D0))
Do I1 = 1,Ndim
I = I1
no_I = 1
Do J1 = 1,Ndim
J = J1
no_J = 1
imj = latt%imj(I,J)
Obs_eq(1)%Obs_Latt(imj,1,no_I,no_J) = Obs_eq(1)%Obs_Latt(imj,1,no_I,no_J) + &
& Z * GRC(I1,J1,1) * ZP*ZS ! Green
Obs_eq(2)%Obs_Latt(imj,1,no_I,no_J) = Obs_eq(2)%Obs_Latt(imj,1,no_I,no_J) + &
& Z * GRC(I1,J1,1) * GR(I1,J1,1) * ZP*ZS ! SpinZ
Obs_eq(3)%Obs_Latt(imj,1,no_I,no_J) = Obs_eq(3)%Obs_Latt(imj,1,no_I,no_J) + &
& ( GRC(I1,I1,1) * GRC(J1,J1,1) * Z + &
& GRC(I1,J1,1) * GR(I1,J1,1 ) ) * Z * ZP*ZS ! Den
enddo
Obs_eq(3)%Obs_Latt0(no_I) = Obs_eq(3)%Obs_Latt0(no_I) + Z * GRC(I1,I1,1) * ZP * ZS
enddo enddo
\end{lstlisting} \end{lstlisting}
\item Finally you will have to update the \texttt{Obser} and \texttt{ObserT} routines for the calculation of the equal and time displaced correlations. For the \texttt{t\_V} model you can essentially use the same observables as for the \texttt{Hubbard\_SU(2)} model. among other changes - with similar ones in the \texttt{ObserT} routine.
All necessary changes are implemented and clearly indicated in the solution provided in \texttt{Solutions/Exercise\_2/Hamiltonian\_Hubbard\_Plain\_Vanilla\_mod-Exercise\_2.F90}.
\end{itemize} \end{itemize}
In the directory \texttt{Solutions/Exercise\_2} we have duplicated ALF's code and commented the changes that have to be carried out to the file \texttt{Hamiltonian\_Hubbard\_Plain\_Vanilla\_mod.F90} in the \texttt{Prog/Hamiltonians} directory. The solution directory also includes reference data and the necessary \texttt{Start} directory (remember to copy its contents to every new \texttt{Run} directory, and to have a different \texttt{Run} directory for each simulation).
You can now run the code for various values of $V/t$. A Jordan-Wigner transformation will map the \texttt{t\_V} model onto the XXZ chain: You can now run the code for various values of $V/t$. A Jordan-Wigner transformation will map the \texttt{t\_V} model onto the XXZ chain:
\begin{equation} \begin{equation}
\hat{H} = J_{xx} \sum_{i} \hat{S}^{x}_i \hat{S}^{x}_{i+a} + \hat{S}^{y}_i \hat{S}^{y}_{i+a} + J_{zz} \sum_{i}\hat{S}^{z}_i \hat{S}^{z}_{i +a} \hat{H} = J_{xx} \sum_{i} \hat{S}^{x}_i \hat{S}^{x}_{i+a} + \hat{S}^{y}_i \hat{S}^{y}_{i+a} + J_{zz} \sum_{i}\hat{S}^{z}_i \hat{S}^{z}_{i +a}\quad,
\end{equation} \end{equation}
with $J_{zz} = V $ and $J_{xx} = 2t$. Hence when $V/t = 2$ we reproduce the Heisenberg model. For $V/t > 2$ the model is in the Ising regime with long-range charge density wave order and is an insulator. In the regime $ -2 < V/t < 2$ the model is metallic and corresponds to a Luttinger liquid. Finally, at $ V/t < - 2$ phase separation between hole rich and electron rich phases occur. Fig.~\ref{tV.fig} shows typical results. with $J_{zz} = V $ and $J_{xx} = 2t$. Hence, when $V/t = 2$ we reproduce the Heisenberg model. For $V/t > 2$ the model is in the Ising regime with long-range charge density wave order and is an insulator. In the regime $ -2 < V/t < 2$ the model is metallic and corresponds to a Luttinger liquid. Finally, at $ V/t < - 2$ phase separation between hole rich and electron rich phases occur. Fig.~\ref{tV.fig} shows typical results for the density-density correlation function (file \texttt{Den\_eqJR}).
\begin{figure}[htb] \begin{figure}[htb]
\begin{center} \begin{center}
\includegraphics[scale=.8]{tV.pdf} \includegraphics[width=0.6\columnwidth]{tV.pdf}
\caption{Density-Density correlation functions of the t-V model. In the Luttinger liquid phase, $-2 < V/t < 2$ it is known that the density -density correlations decay as \caption{Density-Density correlation functions of the t-V model. In the Luttinger liquid phase, $-2 < V/t < 2$, it is known that the density-density correlations decay as $ \langle n(r) n(0)\rangle \propto \cos(\pi r) r^{-\left(1+K_\rho \right) } $ with $\left(1+K_\rho \right)^{-1}= \frac{1}{2} + \frac{1}{\pi} \arcsin \left( \frac{V}{2 | t | }\right) $
$ \langle n(r) n(0)\rangle \propto \cos(\pi r) r^{-\left(1+K_\rho \right) } $ with $\left(1+K_\rho \right)^{-1}= \frac{1}{2} + \frac{1}{\pi} \arcsin \left( \frac{V}{2 | t | }\right) $
(A. Luther and I. Peschel, Calculation of critical exponents in two dimensions from quantum field theory in one dimension, Phys. Rev. B 12 (1975), 3908.) The interested reader can try to reproduce this result.} (A. Luther and I. Peschel, Calculation of critical exponents in two dimensions from quantum field theory in one dimension, Phys. Rev. B 12 (1975), 3908.) The interested reader can try to reproduce this result.}
\label{tV.fig} \label{tV.fig}
\end{center} \end{center}
......
...@@ -3,20 +3,15 @@ set size 0.8,0.8 ...@@ -3,20 +3,15 @@ set size 0.8,0.8
set title "{L=14 Hubbard Ladder, {/Symbol b}t=10, U/t=4 }" set title "{L=14 Hubbard Ladder, {/Symbol b}t=10, U/t=4 }"
set out 'ladder.eps' set out 'ladder.eps'
set fit errorvariables set fit errorvariables
#tmp='Ener_fit.dat'
#set print tmp
set xlabel "r" set xlabel "r"
set ylabel "S(r,0)" set ylabel "S(r,0)"
f(x) = a + b * x
#print "0.0 ", a, a_err, b, b_err, "\n\n" plot "ladder.dat" i 0 u 1:2:3 w e lc rgb "black" lt 1 pt 7 lw 2 t "t_y=0" , \
'' i 0 u 1:2 w l lc rgb "black" lt 1 lw 2 t "" , \
plot "ladder.dat" i 0 u 1:2:3 w e lt 2 t "t_y=0" ,\ '' i 1 u 1:2:3 w e lc rgb "red" lt 1 pt 7 lw 2 t "t_1=1" , \
"ladder.dat" i 1 u 1:2:3 w e lt 3 t "t_y=1" ,\ '' i 1 u 1:2 w l lc rgb "red" lt 1 lw 2 t "" , \
"ladder.dat" i 2 u 1:2:3 w e lt 4 t "t_y=2" ,\ '' i 2 u 1:2:3 w e lc rgb "royalblue" lt 1 pt 7 lw 2 t "t_y=2" ,\
"ladder.dat" i 0 u 1:2 w l lt 2 t "" ,\ '' i 2 u 1:2 w l lc rgb "royalblue" lt 1 lw 2 t ""
"ladder.dat" i 1 u 1:2 w l lt 3 t "" ,\
"ladder.dat" i 2 u 1:2 w l lt 4 t ""
!epstopdf ladder.eps !epstopdf ladder.eps
!open ladder.pdf !open ladder.pdf
No preview for this file type
...@@ -24,10 +24,10 @@ e^{ -\Delta \tau \left( \hat{A} + \hat{B} \right) } = e^{ -\Delta \tau \hat{A} ...@@ -24,10 +24,10 @@ e^{ -\Delta \tau \left( \hat{A} + \hat{B} \right) } = e^{ -\Delta \tau \hat{A}
Bellow we go through the steps for performing this extrapolation: Bellow we go through the steps for performing this extrapolation:
setting the simulation parameters, running it and analysing the data. A setting the simulation parameters, running it and analysing the data. A
reference plot for this analyses is found in reference plot for this analyses is found in
\href{https://git.physik.uni-wuerzburg.de/ALF/ALF_code/-/blob/master/Documentation/ALF_v1.0.pdf}{ALF \href{https://git.physik.uni-wuerzburg.de/ALF/ALF/-/blob/master/Documentation/doc.pdf}{ALF
documentation}, Sec. 2.3.2 (Symmetric Trotter decomposition). documentation}, Sec. 2.3.2 (Symmetric Trotter decomposition).
\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center} \begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\textbf{1.} Import \texttt{Simulation} class from the \texttt{py\_alf} \textbf{1.} Import \texttt{Simulation} class from the \texttt{py\_alf}
python module, which provides the interface with ALF, as well as python module, which provides the interface with ALF, as well as
...@@ -36,10 +36,10 @@ mathematics and plotting packages: ...@@ -36,10 +36,10 @@ mathematics and plotting packages:
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder] \begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{1}{\boxspacing} \prompt{In}{incolor}{1}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}] \begin{Verbatim}[commandchars=\\\{\}]
\PY{k+kn}{from} \PY{n+nn}{py\PYZus{}alf} \PY{k}{import} \PY{n}{Simulation} \PY{c+c1}{\PYZsh{} Interface with ALF} \PY{k+kn}{from} \PY{n+nn}{py\PYZus{}alf} \PY{k+kn}{import} \PY{n}{Simulation} \PY{c+c1}{\PYZsh{} Interface with ALF}
\PY{c+c1}{\PYZsh{} } \PY{c+c1}{\PYZsh{} }
\PY{k+kn}{import} \PY{n+nn}{numpy} \PY{k}{as} \PY{n+nn}{np} \PY{c+c1}{\PYZsh{} Numerical library} \PY{k+kn}{import} \PY{n+nn}{numpy} \PY{k}{as} \PY{n+nn}{np} \PY{c+c1}{\PYZsh{} Numerical library}
\PY{k+kn}{from} \PY{n+nn}{scipy}\PY{n+nn}{.}\PY{n+nn}{optimize} \PY{k}{import} \PY{n}{curve\PYZus{}fit} \PY{c+c1}{\PYZsh{} Numerical library} \PY{k+kn}{from} \PY{n+nn}{scipy}\PY{n+nn}{.}\PY{n+nn}{optimize} \PY{k+kn}{import} \PY{n}{curve\PYZus{}fit} \PY{c+c1}{\PYZsh{} Numerical library}
\PY{k+kn}{import} \PY{n+nn}{matplotlib}\PY{n+nn}{.}\PY{n+nn}{pyplot} \PY{k}{as} \PY{n+nn}{plt} \PY{c+c1}{\PYZsh{} Plotting library} \PY{k+kn}{import} \PY{n+nn}{matplotlib}\PY{n+nn}{.}\PY{n+nn}{pyplot} \PY{k}{as} \PY{n+nn}{plt} \PY{c+c1}{\PYZsh{} Plotting library}
\end{Verbatim} \end{Verbatim}
\end{tcolorbox} \end{tcolorbox}
...@@ -224,11 +224,11 @@ For Dtau values [0.05 0.1 0.15] the measured energies are: ...@@ -224,11 +224,11 @@ For Dtau values [0.05 0.1 0.15] the measured energies are:
\end{tcolorbox} \end{tcolorbox}
\begin{center} \begin{center}
\adjustimage{max size={0.6\linewidth}{0.9\paperheight}}{trotter_error-output_12_2.png} \adjustimage{max size={0.6\linewidth}{0.6\paperheight}}{trotter_error-output_12_2.png}
\end{center} \end{center}
{ \hspace*{\fill} \\} { \hspace*{\fill} \\}
\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center} \begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\hypertarget{exercises}{% \hypertarget{exercises}{%
\subsection{Exercises}\label{exercises}} \subsection{Exercises}\label{exercises}}
...@@ -241,7 +241,7 @@ For Dtau values [0.05 0.1 0.15] the measured energies are: ...@@ -241,7 +241,7 @@ For Dtau values [0.05 0.1 0.15] the measured energies are:
\texttt{Symm} settings in order to observe their effect on the output \texttt{Symm} settings in order to observe their effect on the output
and run time. Reference: Sec. 2.3.2 - Symmetric Trotter decomposition and run time. Reference: Sec. 2.3.2 - Symmetric Trotter decomposition
- of the - of the
\href{https://git.physik.uni-wuerzburg.de/ALF/ALF_code/-/blob/master/Documentation/ALF_v1.0.pdf}{ALF \href{https://git.physik.uni-wuerzburg.de/ALF/ALF/-/blob/master/Documentation/doc.pdf}{ALF
documentation}, especially Fig. 2. documentation}, especially Fig. 2.
\end{enumerate} \end{enumerate}
......
...@@ -392,10 +392,10 @@ e^{ -\Delta \tau \left( \hat{A} + \hat{B} \right) } = e^{ -\Delta \tau \hat{A} ...@@ -392,10 +392,10 @@ e^{ -\Delta \tau \left( \hat{A} + \hat{B} \right) } = e^{ -\Delta \tau \hat{A}
Bellow we go through the steps for performing this extrapolation: Bellow we go through the steps for performing this extrapolation:
setting the simulation parameters, running it and analysing the data. A setting the simulation parameters, running it and analysing the data. A
reference plot for this analyses is found in reference plot for this analyses is found in
\href{https://git.physik.uni-wuerzburg.de/ALF/ALF_code/-/blob/master/Documentation/ALF_v1.0.pdf}{ALF \href{https://git.physik.uni-wuerzburg.de/ALF/ALF/-/blob/master/Documentation/doc.pdf}{ALF
documentation}, Sec. 2.3.2 (Symmetric Trotter decomposition). documentation}, Sec. 2.3.2 (Symmetric Trotter decomposition).
\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center} \begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\textbf{1.} Import \texttt{Simulation} class from the \texttt{py\_alf} \textbf{1.} Import \texttt{Simulation} class from the \texttt{py\_alf}
python module, which provides the interface with ALF, as well as python module, which provides the interface with ALF, as well as
...@@ -404,10 +404,10 @@ mathematics and plotting packages: ...@@ -404,10 +404,10 @@ mathematics and plotting packages:
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder] \begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{1}{\boxspacing} \prompt{In}{incolor}{1}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}] \begin{Verbatim}[commandchars=\\\{\}]
\PY{k+kn}{from} \PY{n+nn}{py\PYZus{}alf} \PY{k}{import} \PY{n}{Simulation} \PY{c+c1}{\PYZsh{} Interface with ALF} \PY{k+kn}{from} \PY{n+nn}{py\PYZus{}alf} \PY{k+kn}{import} \PY{n}{Simulation} \PY{c+c1}{\PYZsh{} Interface with ALF}
\PY{c+c1}{\PYZsh{} } \PY{c+c1}{\PYZsh{} }
\PY{k+kn}{import} \PY{n+nn}{numpy} \PY{k}{as} \PY{n+nn}{np} \PY{c+c1}{\PYZsh{} Numerical library} \PY{k+kn}{import} \PY{n+nn}{numpy} \PY{k}{as} \PY{n+nn}{np} \PY{c+c1}{\PYZsh{} Numerical library}
\PY{k+kn}{from} \PY{n+nn}{scipy}\PY{n+nn}{.}\PY{n+nn}{optimize} \PY{k}{import} \PY{n}{curve\PYZus{}fit} \PY{c+c1}{\PYZsh{} Numerical library} \PY{k+kn}{from} \PY{n+nn}{scipy}\PY{n+nn}{.}\PY{n+nn}{optimize} \PY{k+kn}{import} \PY{n}{curve\PYZus{}fit} \PY{c+c1}{\PYZsh{} Numerical library}
\PY{k+kn}{import} \PY{n+nn}{matplotlib}\PY{n+nn}{.}\PY{n+nn}{pyplot} \PY{k}{as} \PY{n+nn}{plt} \PY{c+c1}{\PYZsh{} Plotting library} \PY{k+kn}{import} \PY{n+nn}{matplotlib}\PY{n+nn}{.}\PY{n+nn}{pyplot} \PY{k}{as} \PY{n+nn}{plt} \PY{c+c1}{\PYZsh{} Plotting library}
\end{Verbatim} \end{Verbatim}
\end{tcolorbox} \end{tcolorbox}
...@@ -596,7 +596,7 @@ For Dtau values [0.05 0.1 0.15] the measured energies are: ...@@ -596,7 +596,7 @@ For Dtau values [0.05 0.1 0.15] the measured energies are:
\end{center} \end{center}
{ \hspace*{\fill} \\} { \hspace*{\fill} \\}
\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center} \begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\hypertarget{exercises}{% \hypertarget{exercises}{%
\subsection{Exercises}\label{exercises}} \subsection{Exercises}\label{exercises}}
...@@ -609,7 +609,7 @@ For Dtau values [0.05 0.1 0.15] the measured energies are: ...@@ -609,7 +609,7 @@ For Dtau values [0.05 0.1 0.15] the measured energies are:
\texttt{Symm} settings in order to observe their effect on the output \texttt{Symm} settings in order to observe their effect on the output
and run time. Reference: Sec. 2.3.2 - Symmetric Trotter decomposition and run time. Reference: Sec. 2.3.2 - Symmetric Trotter decomposition
- of the - of the
\href{https://git.physik.uni-wuerzburg.de/ALF/ALF_code/-/blob/master/Documentation/ALF_v1.0.pdf}{ALF \href{https://git.physik.uni-wuerzburg.de/ALF/ALF/-/blob/master/Documentation/doc.pdf}{ALF
documentation}, especially Fig. 2. documentation}, especially Fig. 2.
\end{enumerate} \end{enumerate}
......
This diff is collapsed.
...@@ -3,20 +3,15 @@ set size 0.8,0.8 ...@@ -3,20 +3,15 @@ set size 0.8,0.8
set title "{L=14 Hubbard Ladder, {/Symbol b}t=10, U/t=4 }" set title "{L=14 Hubbard Ladder, {/Symbol b}t=10, U/t=4 }"
set out 'ladder.eps' set out 'ladder.eps'
set fit errorvariables set fit errorvariables
#tmp='Ener_fit.dat'
#set print tmp
set xlabel "r" set xlabel "r"
set ylabel "S(r,0)" set ylabel "S(r,0)"
f(x) = a + b * x
#print "0.0 ", a, a_err, b, b_err, "\n\n" plot "ladder.dat" i 0 u 1:2:3 w e lc rgb "black" lt 1 pt 7 lw 2 t "t_y=0" , \
'' i 0 u 1:2 w l lc rgb "black" lt 1 lw 2 t "" , \
plot "ladder.dat" i 0 u 1:2:3 w e lt 2 t "t_y=0" ,\ '' i 1 u 1:2:3 w e lc rgb "red" lt 1 pt 7 lw 2 t "t_1=1" , \
"ladder.dat" i 1 u 1:2:3 w e lt 3 t "t_y=1" ,\ '' i 1 u 1:2 w l lc rgb "red" lt 1 lw 2 t "" , \
"ladder.dat" i 2 u 1:2:3 w e lt 4 t "t_y=2" ,\ '' i 2 u 1:2:3 w e lc rgb "royalblue" lt 1 pt 7 lw 2 t "t_y=2" ,\
"ladder.dat" i 0 u 1:2 w l lt 2 t "" ,\ '' i 2 u 1:2 w l lc rgb "royalblue" lt 1 lw 2 t ""
"ladder.dat" i 1 u 1:2 w l lt 3 t "" ,\
"ladder.dat" i 2 u 1:2 w l lt 4 t ""
!epstopdf ladder.eps !epstopdf ladder.eps
!open ladder.pdf !open ladder.pdf
...@@ -683,7 +683,7 @@ ...@@ -683,7 +683,7 @@
!!!!! Modifications for Exercise 2 !!!!! Modifications for Exercise 2
!Zkin = Zkin + GRC(I,Ix,1) + GRC(Ix,I,1) & !Zkin = Zkin + GRC(I,Ix,1) + GRC(Ix,I,1) &
! & + GRC(I,Ix,2) + GRC(Ix,I,2) ! & + GRC(I,Ix,2) + GRC(Ix,I,2)
!!!Zkin = Zkin + GRC(I,Ix,1) + GRC(Ix,I,1) ! 1st attempt, wrong?, two lines above: orig. !!!Zkin = Zkin + GRC(I,Ix,1) + GRC(Ix,I,1)
Zkin = Zkin + sum(Op_T(1,1)%O(:, i)*Grc(:, i, 1)) Zkin = Zkin + sum(Op_T(1,1)%O(:, i)*Grc(:, i, 1))
!!!!! !!!!!
Enddo Enddo
...@@ -703,7 +703,7 @@ ...@@ -703,7 +703,7 @@
!!!!! Modifications for Exercise 2 !!!!! Modifications for Exercise 2
!ZPot = ZPot + Grc(i,i,1) * Grc(i,i, 2) !ZPot = ZPot + Grc(i,i,1) * Grc(i,i, 2)
i1 = Latt%nnlist(i,1,0) i1 = Latt%nnlist(i,1,0)
ZPot = ZPot + Grc(i,i,1) * Grc(i1,i1, 1) + Grc(i,i1,1)*Gr(i,i1,1) ZPot = ZPot + Grc(i,i,1)*Grc(i1,i1, 1) + Grc(i,i1,1)*Gr(i,i1,1)
Enddo Enddo
!Zpot = Zpot*ham_U !Zpot = Zpot*ham_U
Zpot = Zpot*Ham_Vint Zpot = Zpot*Ham_Vint
...@@ -747,17 +747,16 @@ ...@@ -747,17 +747,16 @@
!enddo !enddo
Z = cmplx(dble(N_SUN), 0.d0, kind(0.D0)) Z = cmplx(dble(N_SUN), 0.d0, kind(0.D0))
Do I1 = 1,Ndim Do I1 = 1,Ndim
I = I1 !List(I1,1) I = I1 !List(I1,1)
no_I = 1 !List(I1,2) no_I = 1 !List(I1,2)
Do J1 = 1,Ndim Do J1 = 1,Ndim
J = J1 !List(J1,1) J = J1 !List(J1,1)
no_J = 1 !List(J1,2) no_J = 1 !List(J1,2)
imj = latt%imj(I,J) imj = latt%imj(I,J)
! Green
Obs_eq(1)%Obs_Latt(imj,1,no_I,no_J) = Obs_eq(1)%Obs_Latt(imj,1,no_I,no_J) + & Obs_eq(1)%Obs_Latt(imj,1,no_I,no_J) = Obs_eq(1)%Obs_Latt(imj,1,no_I,no_J) + &
& Z * GRC(I1,J1,1) * ZP*ZS ! Green & Z * GRC(I1,J1,1) * ZP*ZS ! Green
Obs_eq(2)%Obs_Latt(imj,1,no_I,no_J) = Obs_eq(2)%Obs_Latt(imj,1,no_I,no_J) + & Obs_eq(2)%Obs_Latt(imj,1,no_I,no_J) = Obs_eq(2)%Obs_Latt(imj,1,no_I,no_J) + &
& Z * GRC(I1,J1,1) * GR(I1,J1,1) * ZP*ZS! SpinZ & Z * GRC(I1,J1,1) * GR(I1,J1,1) * ZP*ZS ! SpinZ
!Obs_eq(3)%Obs_Latt(imj,1,no_I,no_J) = Obs_eq(3)%Obs_Latt(imj,1,no_I,no_J) + & !Obs_eq(3)%Obs_Latt(imj,1,no_I,no_J) = Obs_eq(3)%Obs_Latt(imj,1,no_I,no_J) + &
! & Z * GRC(I1,J1,1) * GR(I1,J1,1) * ZP*ZS ! SpinXY ! & Z * GRC(I1,J1,1) * GR(I1,J1,1) * ZP*ZS ! SpinXY
Obs_eq(3)%Obs_Latt(imj,1,no_I,no_J) = Obs_eq(3)%Obs_Latt(imj,1,no_I,no_J) + & Obs_eq(3)%Obs_Latt(imj,1,no_I,no_J) = Obs_eq(3)%Obs_Latt(imj,1,no_I,no_J) + &
......
101 4 20.000000000000000 1
0.0000000 0.00564888 0.00037249
0.1000000 0.00564888 0.00037249
0.2000000 0.00564888 0.00037249
0.3000000 0.00564888 0.00037249
0.4000000 0.00564888 0.00037249
0.5000000 0.00564888 0.00037249
0.6000000 0.00564888 0.00037249
0.7000000 0.00564888 0.00037249
0.8000000 0.00564888 0.00037249
0.9000000 0.00564888 0.00037249
1.0000000 0.00564888 0.00037249
1.1000000 0.00564888 0.00037249
1.2000000 0.00564888 0.00037249
1.3000000 0.00564888 0.00037249
1.4000000 0.00564888 0.00037249
1.5000000 0.00564888 0.00037249
1.6000000 0.00564888 0.00037249
1.7000000 0.00564888 0.00037249
1.8000000 0.00564888 0.00037249
1.9000000 0.00564888 0.00037249
2.0000000 0.00564888 0.00037249
2.1000000 0.00564888 0.00037249
2.2000000 0.00564888 0.00037249
2.3000000 0.00564888 0.00037249
2.4000000 0.00564888 0.00037249
2.5000000 0.00564888 0.00037249
2.6000000 0.00564888 0.00037249
2.7000000 0.00564888 0.00037249