Commit 1a691aa7 authored by Jefferson Stafusa E. Portela's avatar Jefferson Stafusa E. Portela
Browse files

Add Exercise 1 of Part II. Some cleanup.

parent 83e5406c
%!PS-Adobe-2.0 EPSF-2.0 %!PS-Adobe-2.0 EPSF-2.0
%%Title: Ladder.eps %%Title: Ladder.eps
%%Creator: gnuplot 5.2 patchlevel 6 %%Creator: gnuplot 5.2 patchlevel 8
%%CreationDate: Tue Aug 20 18:43:37 2019 %%CreationDate: Fri Sep 18 05:10:16 2020
%%DocumentFonts: (atend) %%DocumentFonts: (atend)
%%BoundingBox: 50 50 338 251 %%BoundingBox: 50 50 338 251
%%EndComments %%EndComments
...@@ -478,10 +478,10 @@ systemdict /pdfmark known not { ...@@ -478,10 +478,10 @@ systemdict /pdfmark known not {
SDict begin [ SDict begin [
/Title (Ladder.eps) /Title (Ladder.eps)
/Subject (gnuplot plot) /Subject (gnuplot plot)
/Creator (gnuplot 5.2 patchlevel 6) /Creator (gnuplot 5.2 patchlevel 8)
% /Producer (gnuplot) % /Producer (gnuplot)
% /Keywords () % /Keywords ()
/CreationDate (Tue Aug 20 18:43:37 2019) /CreationDate (Fri Sep 18 05:10:16 2020)
/DOCINFO pdfmark /DOCINFO pdfmark
end end
} ifelse } ifelse
...@@ -745,7 +745,7 @@ Z stroke ...@@ -745,7 +745,7 @@ Z stroke
LTb LTb
LCb setrgbcolor LCb setrgbcolor
LCb setrgbcolor LCb setrgbcolor
162 2033 M 171 2033 M
currentpoint gsave translate -270 rotate 0 0 moveto currentpoint gsave translate -270 rotate 0 0 moveto
[ [(Times-Roman) 180.0 0.0 true true 0 (S\(r,0\))] [ [(Times-Roman) 180.0 0.0 true true 0 (S\(r,0\))]
] -60.0 MCshow ] -60.0 MCshow
...@@ -765,6 +765,7 @@ LCb setrgbcolor ...@@ -765,6 +765,7 @@ LCb setrgbcolor
[(Times-Roman) 180.0 0.0 true true 0 (t=10, U/t=4 )] [(Times-Roman) 180.0 0.0 true true 0 (t=10, U/t=4 )]
] -60.0 MCshow ] -60.0 MCshow
/Times-Roman findfont 180 scalefont setfont /Times-Roman findfont 180 scalefont setfont
LTb
% Begin plot #1 % Begin plot #1
1.000 UP 1.000 UP
1.000 UL 1.000 UL
......
...@@ -297,9 +297,9 @@ git clone git@git.physik.uni-wuerzburg.de:ALF/ALF_Tutorial.git ...@@ -297,9 +297,9 @@ git clone git@git.physik.uni-wuerzburg.de:ALF/ALF_Tutorial.git
\exerciseitem{Modifying the hopping} \exerciseitem{Modifying the hopping}
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. To do so we start from the module \texttt{Hamiltonian\_Hubbard\_Plain\_Vanilla\_mod.F90} found in \texttt{<ALF\_DIR>/Prog/Hamiltonians/}, which we will simply call ``\texttt{Vanilla}'', and then: 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. To do so we start from the module \texttt{Hamiltonian\_Hubbard\_Plain\_Vanilla\_mod.F90} found in \texttt{<ALF\_DIR>/Prog/Hamiltonians/}, which we will simply call ``\texttt{Vanilla}'', and then:
\begin{itemize} \begin{itemize}
\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 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 Add this variable also to the name space (\texttt{namelist}) declaration at the \texttt{Ham\_Set} subroutine of \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}).
\item Add \texttt{Ham\_Ty} to the \texttt{VAR\_Hubbard\_Plain\_Vanilla} name space (\texttt{namelist}) declaration at the \texttt{Ham\_Set} subroutine of \texttt{Vanilla}.
\item Modify the hopping matrix in the subroutine \texttt{Ham\_Hop} in \texttt{Vanilla}: \item Modify the hopping matrix in the subroutine \texttt{Ham\_Hop} in \texttt{Vanilla}:
\begin{lstlisting}[style=fortran] \begin{lstlisting}[style=fortran]
Do I = 1,Latt%N Do I = 1,Latt%N
...@@ -320,18 +320,26 @@ Do I = 1,Latt%N ...@@ -320,18 +320,26 @@ 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}. 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}.
\red{[NOT yet done.]} In the directory \texttt{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} in the \texttt{Prog} directory. 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 simulationi).
\noindent \noindent
As an application of this code, one can consider a 2-leg ladder system defined, e.g., with \texttt{L1=14}, \texttt{L2=2}, \texttt{Lattice\_type="Square"}, \texttt{Model="Hubbard\_Plain\_Vanilla"} and \texttt{Ham\_Ty=2.0D0}. As an application of this code, we can consider a 2-leg ladder system defined, e.g., with \texttt{L1=14}, \texttt{L2=2}, \texttt{Lattice\_type="Square"}, \texttt{Model="Hubbard\_Plain\_Vanilla"} and different values of \texttt{Ham\_Ty}. The results you should obtain are summarized in Fig.~\ref{fig:ladder}.
\begin{figure}[h]
\begin{center}
\includegraphics[width=0.6\columnwidth]{Figures/ladder.pdf}
\end{center}
\caption{Spin correlation functions along one leg for the Hubbard ladder. As $t_y$ grows the spin gap becomes large enough so as to detect the exponential decal of the spin correlation function on this small lattice size. The underlying physics of odd-even ladder systems is introduced in the article: Elbio Dagotto and T. M. Rice, Surprises on the way from one- to two-dimensional quantum magnets: The ladder materials, Science 271 (1996), no. 5249, 618--623.}
\label{fig:ladder}
\end{figure}
% [Excluding the introduction to the exercise item: improved estimator \langle \vec{S}_{i} \cdot \vec{S}_{j} \rangle]
\exerciseitem{The SU(2) Hubbard-Stratonovich transformation} \exerciseitem{The SU(2) Hubbard-Stratonovich transformation}
\red{[Introduce modifications to \texttt{Hamiltonian\_Hubbard\_mod.F90}]} The SU(2) Hubbard-Stratonovich decomposition, conserves spin rotational symmetry. Run the ladder code with the SU(2) flag in the parameter file switched on (i.e. \texttt{Model = Hubbard\_SU2}) and compare results.
The SU(2) Hubbard-Stratonovich decomposition conserves spin rotational symmetry. Introduce into \texttt{Hamiltonian\_Hubbard\_mod.F90} the same changes done to the \texttt{Vanilla} module, described in the previous item, and compare results.
......
set terminal postscript eps enhanced solid color 'Times-Roman' 18 set terminal postscript eps enhanced solid color 'Times-Roman' 18
set size 0.8,0.8 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' #tmp='Ener_fit.dat'
#set print tmp #set print tmp
...@@ -11,12 +11,12 @@ f(x) = a + b * x ...@@ -11,12 +11,12 @@ f(x) = a + b * x
#print "0.0 ", a, a_err, b, b_err, "\n\n" #print "0.0 ", a, a_err, b, b_err, "\n\n"
plot "Spin.dat" i 0 u 1:2:3 w e lt 2 t "t_y=0" ,\ plot "ladder.dat" i 0 u 1:2:3 w e lt 2 t "t_y=0" ,\
"Spin.dat" i 1 u 1:2:3 w e lt 3 t "t_y=1" ,\ "ladder.dat" i 1 u 1:2:3 w e lt 3 t "t_y=1" ,\
"Spin.dat" i 2 u 1:2:3 w e lt 4 t "t_y=2" ,\ "ladder.dat" i 2 u 1:2:3 w e lt 4 t "t_y=2" ,\
"Spin.dat" i 0 u 1:2 w l lt 2 t "" ,\ "ladder.dat" i 0 u 1:2 w l lt 2 t "" ,\
"Spin.dat" i 1 u 1:2 w l lt 3 t "" ,\ "ladder.dat" i 1 u 1:2 w l lt 3 t "" ,\
"Spin.dat" i 2 u 1:2 w l lt 4 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
...@@ -151,7 +151,10 @@ ...@@ -151,7 +151,10 @@
Type (Lattice), private :: Latt Type (Lattice), private :: Latt
Type (Unit_cell), private :: Latt_unit Type (Unit_cell), private :: Latt_unit
Integer, private :: L1, L2 Integer, private :: L1, L2
real (Kind=Kind(0.d0)), private :: ham_T , ham_U, Ham_chem real (Kind=Kind(0.d0)), private :: Ham_T , Ham_U, Ham_chem
!!!!!!! Modifications for Exercise 1a
real (Kind=Kind(0.d0)), private :: Ham_Ty
!!!!!!!
real (Kind=Kind(0.d0)), private :: Dtau, Beta, Theta real (Kind=Kind(0.d0)), private :: Dtau, Beta, Theta
Integer , private :: N_part Integer , private :: N_part
Character (len=64), private :: Model, Lattice_type Character (len=64), private :: Model, Lattice_type
...@@ -187,7 +190,10 @@ ...@@ -187,7 +190,10 @@
NAMELIST /VAR_Lattice/ L1, L2, Lattice_type, Model NAMELIST /VAR_Lattice/ L1, L2, Lattice_type, Model
NAMELIST /VAR_Hubbard_Plain_Vanilla/ ham_T, ham_chem, ham_U, Dtau, Beta, Projector, Theta, Symm, N_part !!!!!!! Modifications for Exercise 1a
!NAMELIST /VAR_Hubbard_Plain_Vanilla/ Ham_T, ham_chem, ham_U, Dtau, Beta, Projector, Theta, Symm, N_part
NAMELIST /VAR_Hubbard_Plain_Vanilla/ Ham_T, Ham_Ty, ham_chem, ham_U, Dtau, Beta, Projector, Theta, Symm, N_part
!!!!!!!
...@@ -250,7 +256,7 @@ ...@@ -250,7 +256,7 @@
CALL MPI_BCAST(Projector ,1, MPI_LOGICAL , 0,Group_Comm,ierr) CALL MPI_BCAST(Projector ,1, MPI_LOGICAL , 0,Group_Comm,ierr)
CALL MPI_BCAST(Dtau ,1, MPI_REAL8 , 0,Group_Comm,ierr) CALL MPI_BCAST(Dtau ,1, MPI_REAL8 , 0,Group_Comm,ierr)
CALL MPI_BCAST(Beta ,1, MPI_REAL8 , 0,Group_Comm,ierr) CALL MPI_BCAST(Beta ,1, MPI_REAL8 , 0,Group_Comm,ierr)
CALL MPI_BCAST(ham_T ,1, MPI_REAL8 , 0,Group_Comm,ierr) CALL MPI_BCAST(Ham_T ,1, MPI_REAL8 , 0,Group_Comm,ierr)
CALL MPI_BCAST(ham_chem ,1, MPI_REAL8 , 0,Group_Comm,ierr) CALL MPI_BCAST(ham_chem ,1, MPI_REAL8 , 0,Group_Comm,ierr)
CALL MPI_BCAST(ham_U ,1, MPI_REAL8 , 0,Group_Comm,ierr) CALL MPI_BCAST(ham_U ,1, MPI_REAL8 , 0,Group_Comm,ierr)
#endif #endif
...@@ -287,6 +293,9 @@ ...@@ -287,6 +293,9 @@
endif endif
Write(50,*) 'dtau,Ltrot_eff: ', dtau,Ltrot Write(50,*) 'dtau,Ltrot_eff: ', dtau,Ltrot
Write(50,*) 't : ', Ham_T Write(50,*) 't : ', Ham_T
!!!!!!! Modifications for Exercise 1a
Write(50,*) 'ty : ', Ham_Ty
!!!!!!!
Write(50,*) 'Ham_U : ', Ham_U Write(50,*) 'Ham_U : ', Ham_U
Write(50,*) 'Ham_chem : ', Ham_chem Write(50,*) 'Ham_chem : ', Ham_chem
Close(50) Close(50)
...@@ -346,8 +355,12 @@ ...@@ -346,8 +355,12 @@
Op_T(1,nf)%O(Ix, I ) = cmplx(-Ham_T, 0.d0, kind(0.D0)) Op_T(1,nf)%O(Ix, I ) = cmplx(-Ham_T, 0.d0, kind(0.D0))
If ( L2 > 1 ) then If ( L2 > 1 ) then
Iy = Latt%nnlist(I,0,1) Iy = Latt%nnlist(I,0,1)
Op_T(1,nf)%O(I, Iy) = cmplx(-Ham_T, 0.d0, kind(0.D0)) !!!!!!! Modifications for Exercise 1a
Op_T(1,nf)%O(Iy, I ) = cmplx(-Ham_T, 0.d0, kind(0.D0)) !Op_T(1,nf)%O(I, Iy) = cmplx(-Ham_T, 0.d0, kind(0.D0))
!Op_T(1,nf)%O(Iy, I ) = cmplx(-Ham_T, 0.d0, kind(0.D0))
Op_T(1,nf)%O(I, Iy) = cmplx(-Ham_Ty, 0.d0, kind(0.D0))
Op_T(1,nf)%O(Iy, I ) = cmplx(-Ham_Ty, 0.d0, kind(0.D0))
!!!!!!!
endif endif
Op_T(1,nf)%O(I, I ) = cmplx(-Ham_chem, 0.d0, kind(0.D0)) Op_T(1,nf)%O(I, I ) = cmplx(-Ham_chem, 0.d0, kind(0.D0))
Op_T(1,nf)%P(i) = i Op_T(1,nf)%P(i) = i
...@@ -406,8 +419,12 @@ ...@@ -406,8 +419,12 @@
H0(Ix, I ) = -Ham_T*(1.d0 + Delta*cos(Pi*real(Latt%list(I,1) + Latt%list(I,2),Kind(0.d0)))) H0(Ix, I ) = -Ham_T*(1.d0 + Delta*cos(Pi*real(Latt%list(I,1) + Latt%list(I,2),Kind(0.d0))))
If (L2 > 1 ) Then If (L2 > 1 ) Then
Iy = Latt%nnlist(I,0,1) Iy = Latt%nnlist(I,0,1)
H0(I, Iy) = -Ham_T *(1.d0 - Delta) !!!!!!! Modifications for Exercise 1a
H0(Iy, I ) = -Ham_T *(1.d0 - Delta) !H0(I, Iy) = -Ham_T *(1.d0 - Delta)
!H0(Iy, I ) = -Ham_T *(1.d0 - Delta)
H0(I, Iy) = -Ham_Ty *(1.d0 - Delta)
H0(Iy, I ) = -Ham_Ty *(1.d0 - Delta)
!!!!!!!
Endif Endif
Enddo Enddo
Call Diag(H0,U0,E0) Call Diag(H0,U0,E0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment