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

Finished Ex. 2 of part 2; deleted Ex. 2's Run directory; updated part 2 plots; some minor.

parent 7491980e

Too many changes to show.

To preserve performance only 251 of 251+ files are displayed.
......@@ -296,7 +296,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.
\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}
\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}).
......@@ -321,9 +321,9 @@ Do I = 1,Latt%N
Enddo
\end{lstlisting}
\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 are summarized in Fig.~\ref{fig:ladder}.
......@@ -361,7 +361,7 @@ Note that the t-V model is already implemented in ALF in the module \texttt{Hami
\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}
\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.
......@@ -373,33 +373,68 @@ 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
\left(\hat{c}^{\phantom\dagger}_{i}, \hat{c}^{\phantom\dagger}_{i+a} \right)^{T} }.
\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]
Allocate(Op_V(Latt%N,N_FL))
Allocate(Op_V(Ndim,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)
enddo
enddo
Do nc = 1, Latt%N ! Runs over bonds = # of lattice sites in one-dimension.
I1 = nc
I2 = Latt%nnlist(I1,1,0)
Op_V(nc,1)%P(1) = I1
Op_V(nc,1)%P(2) = I2
Op_V(nc,1)%O(1,2) = 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(nc,1)%g = SQRT(CMPLX( DTAU*Ham_Vint/2.d0, 0.D0, kind(0.D0)))
Op_V(nc,1)%alpha = cmplx(0d0,0.d0, kind(0.D0))
Op_V(nc,1)%type =2
Call Op_set( Op_V(nc,1) )
Do i = 1, Ndim ! Runs over bonds = # of lattice sites in one-dimension.
i2 = Latt%nnlist(i,1,0)
Op_V(i,nf)%P(1) = i
Op_V(i,nf)%P(2) = i2
Op_V(i,nf)%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(i,nf)%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(i,nf)%type = 2
Call Op_set( Op_V(i,nf) )
enddo
\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.
\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
\end{lstlisting}
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}
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:
\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}
......@@ -407,9 +442,8 @@ You can now run the code for various values of $V/t$. A Jordan-Wigner transform
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.
\begin{figure}[htb]
\begin{center}
\includegraphics[scale=.8]{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
$ \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) $
\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 $ \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.}
\label{tV.fig}
\end{center}
......
......@@ -3,20 +3,15 @@ set size 0.8,0.8
set title "{L=14 Hubbard Ladder, {/Symbol b}t=10, U/t=4 }"
set out 'ladder.eps'
set fit errorvariables
#tmp='Ener_fit.dat'
#set print tmp
set xlabel "r"
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 lt 2 t "t_y=0" ,\
"ladder.dat" i 1 u 1:2:3 w e lt 3 t "t_y=1" ,\
"ladder.dat" i 2 u 1:2:3 w e lt 4 t "t_y=2" ,\
"ladder.dat" i 0 u 1:2 w l lt 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 ""
plot "ladder.dat" i 0 u 1:2:3 w e lc rgb "black" lt 1 pt 7 lw 2 t "V/t=1" , \
'' i 0 u 1:2 w l lc rgb "black" lt 1 lw 2 t "" , \
'' i 1 u 1:2:3 w e lc rgb "red" lt 1 pt 7 lw 2 t "V/t=2" , \
'' i 1 u 1:2 w l lc rgb "red" lt 1 lw 2 t "" , \
'' i 2 u 1:2:3 w e lc rgb "royalblue" lt 1 pt 7 lw 2 t "V/t=2.5" ,\
'' i 2 u 1:2 w l lc rgb "royalblue" lt 1 lw 2 t ""
!epstopdf ladder.eps
!open ladder.pdf
No preview for this file type
! Copyright (C) 2016 - 2020 The ALF project
!
! The ALF project is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! The ALF project is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with ALF. If not, see http://www.gnu.org/licenses/.
!
! Under Section 7 of GPL version 3 we require you to fulfill the following additional terms:
!
! - It is our hope that this program makes a contribution to the scientific community. Being
! part of that community we feel that it is reasonable to require you to give an attribution
! back to the original authors if you have benefitted from this program.
! Guidelines for a proper citation can be found on the project's homepage
! http://alf.physik.uni-wuerzburg.de
!
! - We require the preservation of the above copyright notice and this license in all original files.
!
! - We prohibit the misrepresentation of the origin of the original source files. To obtain
! the original source files please visit the homepage http://alf.physik.uni-wuerzburg.de .
!
! - If you make substantial changes to the program we require you to either consider contributing
! to the ALF project or to mark your material in a reasonable way as different from the original version
!--------------------------------------------------------------------
!> @author
!> ALF-project
!>
!> @brief
!> This module defines the Hamiltonian and observables. Here, we have included a
!> set of predefined Hamiltonians. They include the Hubbard and SU(N) tV models
!> on honeycomb, pi-flux and square lattices.
!> @details
!> The public variables of this module are the following
!>
!>
!> @param [public] OP_V
!> \verbatim
!> Type (Operator), dimension(:,:), allocatable
!> List of operators of type=1,2 and 3 describing the sequence of interactions on a time slice.
!> The first index runs over this sequence. The second corresponds to the flavor index. \endverbatim
!>
!> @param [public] OP_T
!> \verbatim
!> Type (Operator), dimension(:,:), allocatable
!> Sequence of operators accounting for the hopping on a time slice. This can include various
!> checkerboard decompositions. The first index runs over this sequence. The second corresponds to
!> the flavor index. \endverbatim
!> * The progagation reads:
!> \f$ \prod_{\tau} \; \; \prod_{n=1}^{N_V}e^{V_n(\tau)} \prod_{n=1}^{N_T}e^{T_n} \f$. That is
!> first the hopping and then the potential energy.
!>
!>@param [public] WF_L
!> \verbatim Type (WaveFunction), dimension(:), allocatable
!> Left trial wave function. \endverbatim
!>
!> @param [public] WF_R
!> \verbatim Type (WaveFunction), dimension(:), allocatable
!> Right trial wave function. For both wave functions the index runs over the flavor index. \endverbatim
!>
!> @param [public] nsigma
!> \verbatim Type(Fields)
!> Contains all auxiliary fields in the variable f(:,:). The first index runs through the operator
!> sequence. The second through the time slices. \endverbatim
!
!> @param [public] Ndim
!> \verbatim Integer
!> Total number of orbitals. e.g. # unit cells * # orbitals per unit cell. \endverbatim
!
!> @param [public] N_FL
!> \verbatim Integer
!> # of flavors. Propagation is block diagonal in flavors. \endverbatim
!
!> @param [public] N_SUN
!> \verbatim Integer
!> # of colors. Propagation is color independent. \endverbatim
!>
!> @param [public] Ltrot
!> \verbatim Integer
!> Available measurment interval in units of Delta Tau. \endverbatim
!>
!> @param [public] Thtrot
!> \verbatim Integer
!> Effective projection parameter in units of Delta Tau. (Only relevant if projective option is turned on) \endverbatim
!>
!> @param [public] Projector
!> \verbatim Logical
!> Flag for projector. If true then the total number of time slices will correspond to Ltrot + 2*Thtrot \endverbatim
!>
!> @param [public] Group_Comm
!> \verbatim Integer
!> Defines MPI communicator \endverbatim
!
!> @param [public] Symm
!> \verbatim Logical \endverbatim
!> If set to true then the green functions will be symmetrized
!> before being sent to the Obser, ObserT subroutines.
!> In particular, the transformation, \f$ \tilde{G} = e^{-\Delta \tau T /2 } G e^{\Delta \tau T /2 } \f$
!> will be carried out and \f$ \tilde{G} \f$ will be sent to the Obser and ObserT subroutines. Note that
!> if you want to use this feature, then you have to be sure the hopping and interaction terms are decomposed
!> symmetrically. If Symm is true, the propagation reads:
!> \f$ \prod_{\tau} \; \; \prod_{n=N_T}^{1}e^{T_n/2} \prod_{n=1}^{N_V}e^{V_n(\tau)} \prod_{n=1}^{N_T}e^{T_n/2} \f$
!>
!>
!> You still have to add some docu for the other private variables in this module.
!>
!--------------------------------------------------------------------
Module Hamiltonian
Use Operator_mod
Use WaveFunction_mod
Use Lattices_v3
Use MyMats
Use Random_Wrap
Use Files_mod
Use Matrix
Use Observables
Use Fields_mod
Use Predefined_Hoppings
Use LRC_Mod
Implicit none
Type (Operator), dimension(:,:), allocatable :: Op_V
Type (Operator), dimension(:,:), allocatable :: Op_T
Type (WaveFunction), dimension(:), allocatable :: WF_L
Type (WaveFunction), dimension(:), allocatable :: WF_R
Type (Fields) :: nsigma
Integer :: Ndim
Integer :: N_FL
Integer :: N_SUN
Integer :: Ltrot
Integer :: Thtrot
Logical :: Projector
Integer :: Group_Comm
Logical :: Symm
Type (Lattice), private :: Latt
Type (Unit_cell), private :: Latt_unit
Integer, private :: L1, L2
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
Integer , private :: N_part
Character (len=64), private :: Model, Lattice_type
!> Privat Observables
Type (Obser_Vec ), private, dimension(:), allocatable :: Obs_scal
Type (Obser_Latt), private, dimension(:), allocatable :: Obs_eq
Type (Obser_Latt), private, dimension(:), allocatable :: Obs_tau
contains
!--------------------------------------------------------------------
!> @author
!> ALF Collaboration
!>
!> @brief
!> Sets the Hamiltonian
!--------------------------------------------------------------------
Subroutine Ham_Set
#if defined (MPI) || defined(TEMPERING)
Use mpi
#endif
Implicit none
integer :: ierr, nf
Character (len=64) :: file_info, file_para
NAMELIST /VAR_Lattice/ L1, L2, Lattice_type, Model
!!!!!!! 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
!!!!!!!
#ifdef MPI
Integer :: Isize, Irank, irank_g, isize_g, igroup
Integer :: STATUS(MPI_STATUS_SIZE)
#endif
! Global "Default" values.
#ifdef MPI
CALL MPI_COMM_SIZE(MPI_COMM_WORLD,ISIZE,IERR)
CALL MPI_COMM_RANK(MPI_COMM_WORLD,IRANK,IERR)
call MPI_Comm_rank(Group_Comm, irank_g, ierr)
call MPI_Comm_size(Group_Comm, isize_g, ierr)
igroup = irank/isize_g
#endif
File_Para = "parameters"
File_info = "info"
#if defined(TEMPERING)
write(File_para,'(A,I0,A)') "Temp_",igroup,"/parameters"
write(File_info,'(A,I0,A)') "Temp_",igroup,"/info"
#endif
#ifdef MPI
If (Irank_g == 0 ) then
#endif
OPEN(UNIT=5,FILE=file_para,STATUS='old',ACTION='read',IOSTAT=ierr)
IF (ierr /= 0) THEN
WRITE(*,*) 'unable to open <parameters>',ierr
STOP
END IF
READ(5,NML=VAR_lattice)
N_part = L1*L2/2
If (L1 == 1) then
Write(6,*) 'For one-dimensional lattices set L2=1'
stop
endif
READ(5,NML=VAR_Hubbard_Plain_Vanilla)
CLOSE(5)
Ltrot = nint(beta/dtau)
if (Projector) Thtrot = nint(theta/dtau)
Ltrot = Ltrot+2*Thtrot
N_SUN = 1
N_FL = 2
#ifdef MPI
Endif
CALL MPI_BCAST(L1 ,1 ,MPI_INTEGER, 0,Group_Comm,ierr)
CALL MPI_BCAST(L2 ,1 ,MPI_INTEGER, 0,Group_Comm,ierr)
CALL MPI_BCAST(N_SUN ,1 ,MPI_INTEGER, 0,Group_Comm,ierr)
CALL MPI_BCAST(N_FL ,1 ,MPI_INTEGER, 0,Group_Comm,ierr)
CALL MPI_BCAST(Model ,64 ,MPI_CHARACTER, 0,Group_Comm,IERR)
CALL MPI_BCAST(Symm ,1 ,MPI_LOGICAL , 0,Group_Comm,IERR)
CALL MPI_BCAST(Lattice_type,64 ,MPI_CHARACTER, 0,Group_Comm,IERR)
CALL MPI_BCAST(Ltrot ,1, MPI_INTEGER , 0,Group_Comm,ierr)
CALL MPI_BCAST(N_part ,1, MPI_INTEGER , 0,Group_Comm,ierr)
CALL MPI_BCAST(Thtrot ,1, MPI_INTEGER , 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(Beta ,1, MPI_REAL8 , 0,Group_Comm,ierr)
CALL MPI_BCAST(ham_T ,1, MPI_REAL8 , 0,Group_Comm,ierr)
!!!!!!! Modifications for Exercise 1a
CALL MPI_BCAST(Ham_Ty ,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)
#endif
! Setup the Bravais lattice
Call Ham_Latt
! Setup the hopping / single-particle part
Call Ham_Hop
! Setup the interaction.
call Ham_V
#ifdef MPI
If (Irank_g == 0) then
#endif
OPEN(Unit = 50,file=file_info,status="unknown",position="append")
Write(50,*) '====================================='
Write(50,*) 'Model is : ', Model
Write(50,*) 'Lattice is : ', Lattice_type
Write(50,*) 'L1 : ', L1
Write(50,*) 'L2 : ', L2
Write(50,*) '# of orbitals : ', Ndim
Write(50,*) 'Symm. decomp : ', Symm
if (Projector) then
Write(50,*) 'Projective version'
Write(50,*) 'Theta : ', Theta
Write(50,*) 'Tau_max : ', beta
Write(50,*) '# of particles: ', N_part
else
Write(50,*) 'Finite temperture version'
Write(50,*) 'Beta : ', Beta
endif
Write(50,*) 'dtau,Ltrot_eff: ', dtau,Ltrot
Write(50,*) 't : ', Ham_T
!!!!!!! Modifications for Exercise 1a
Write(50,*) 'ty : ', Ham_Ty
!!!!!!!
Write(50,*) 'Ham_U : ', Ham_U
Write(50,*) 'Ham_chem : ', Ham_chem
Close(50)
#ifdef MPI
Endif
#endif
! Setup the trival wave function, in case of a projector approach
if (Projector) Call Ham_Trial(File_info)
end Subroutine Ham_Set
!--------------------------------------------------------------------
!> @author
!> ALF Collaboration
!>
!> @brief
!> Sets the Lattice
!--------------------------------------------------------------------
Subroutine Ham_Latt
Implicit none
Real (Kind=Kind(0.d0)) :: a1_p(2), a2_p(2), L1_p(2), L2_p(2)
If (Lattice_Type /= "Square") then
Write(6,*) 'The plain vanilla Hubbard model is only defined for the square lattice'
stop
Endif
a1_p(1) = 1.0 ; a1_p(2) = 0.d0
a2_p(1) = 0.0 ; a2_p(2) = 1.d0
L1_p = dble(L1)*a1_p
L2_p = dble(L2)*a2_p
Call Make_Lattice( L1_p, L2_p, a1_p, a2_p, Latt )
Ndim = Latt%N
end Subroutine Ham_Latt
!--------------------------------------------------------------------
!> @author
!> ALF Collaboration
!>
!> @brief
!> Sets the Hopping
!--------------------------------------------------------------------
Subroutine Ham_Hop
Implicit none
Integer :: nf , I, Ix, Iy
allocate(Op_T(1,N_FL))
do nf = 1,N_FL
Call Op_make(Op_T(1,nf),Ndim)
Do I = 1,Latt%N
Ix = Latt%nnlist(I,1,0)
Op_T(1,nf)%O(I, Ix) = 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
Iy = Latt%nnlist(I,0,1)
!!!!!!! Modifications for Exercise 1a
!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))