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

New unsuccessful attempt at Exercise 2 of part 2 (tv model).

parent 605795f6
! Copyright (C) 2016 - 2020 The ALF project ! Copyright (C) 2016 - 2020 The ALF project
! !
! The ALF project is free software: you can redistribute it and/or modify ! 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 ! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or ! the Free Software Foundation, either version 3 of the License, or
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
! part of that community we feel that it is reasonable to require you to give an attribution ! 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. ! 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 ! Guidelines for a proper citation can be found on the project's homepage
! http://alf.physik.uni-wuerzburg.de ! http://alf.physik.uni-wuerzburg.de
! !
! - We require the preservation of the above copyright notice and this license in all original files. ! - We require the preservation of the above copyright notice and this license in all original files.
! !
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
!-------------------------------------------------------------------- !--------------------------------------------------------------------
!> @author !> @author
!> ALF-project !> ALF-project
!> !>
!> @brief !> @brief
!> This module defines the Hamiltonian and observables. Here, we have included a !> 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 !> set of predefined Hamiltonians. They include the Hubbard and SU(N) tV models
!> on honeycomb, pi-flux and square lattices. !> on honeycomb, pi-flux and square lattices.
...@@ -42,16 +42,16 @@ ...@@ -42,16 +42,16 @@
!> @details !> @details
!> The public variables of this module are the following !> The public variables of this module are the following
!> !>
!> !>
!> @param [public] OP_V !> @param [public] OP_V
!> \verbatim !> \verbatim
!> Type (Operator), dimension(:,:), allocatable !> Type (Operator), dimension(:,:), allocatable
!> List of operators of type=1,2 and 3 describing the sequence of interactions on a time slice. !> 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 !> The first index runs over this sequence. The second corresponds to the flavor index. \endverbatim
!> !>
!> @param [public] OP_T !> @param [public] OP_T
!> \verbatim !> \verbatim
!> Type (Operator), dimension(:,:), allocatable !> Type (Operator), dimension(:,:), allocatable
!> Sequence of operators accounting for the hopping on a time slice. This can include various !> 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 !> checkerboard decompositions. The first index runs over this sequence. The second corresponds to
!> the flavor index. \endverbatim !> the flavor index. \endverbatim
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
!> \f$ \prod_{\tau} \; \; \prod_{n=1}^{N_V}e^{V_n(\tau)} \prod_{n=1}^{N_T}e^{T_n} \f$. That is !> \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. !> first the hopping and then the potential energy.
!> !>
!>@param [public] WF_L !>@param [public] WF_L
!> \verbatim Type (WaveFunction), dimension(:), allocatable !> \verbatim Type (WaveFunction), dimension(:), allocatable
!> Left trial wave function. \endverbatim !> Left trial wave function. \endverbatim
!> !>
...@@ -83,20 +83,20 @@ ...@@ -83,20 +83,20 @@
!> @param [public] N_SUN !> @param [public] N_SUN
!> \verbatim Integer !> \verbatim Integer
!> # of colors. Propagation is color independent. \endverbatim !> # of colors. Propagation is color independent. \endverbatim
!> !>
!> @param [public] Ltrot !> @param [public] Ltrot
!> \verbatim Integer !> \verbatim Integer
!> Available measurment interval in units of Delta Tau. \endverbatim !> Available measurment interval in units of Delta Tau. \endverbatim
!> !>
!> @param [public] Thtrot !> @param [public] Thtrot
!> \verbatim Integer !> \verbatim Integer
!> Effective projection parameter in units of Delta Tau. (Only relevant if projective option is turned on) \endverbatim !> Effective projection parameter in units of Delta Tau. (Only relevant if projective option is turned on) \endverbatim
!> !>
!> @param [public] Projector !> @param [public] Projector
!> \verbatim Logical !> \verbatim Logical
!> Flag for projector. If true then the total number of time slices will correspond to Ltrot + 2*Thtrot \endverbatim !> Flag for projector. If true then the total number of time slices will correspond to Ltrot + 2*Thtrot \endverbatim
!> !>
!> @param [public] Group_Comm !> @param [public] Group_Comm
!> \verbatim Integer !> \verbatim Integer
!> Defines MPI communicator \endverbatim !> Defines MPI communicator \endverbatim
! !
...@@ -110,8 +110,8 @@ ...@@ -110,8 +110,8 @@
!> symmetrically. If Symm is true, the propagation reads: !> 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$ !> \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. !> You still have to add some docu for the other private variables in this module.
!> !>
!-------------------------------------------------------------------- !--------------------------------------------------------------------
...@@ -119,8 +119,8 @@ ...@@ -119,8 +119,8 @@
Use Operator_mod Use Operator_mod
Use WaveFunction_mod Use WaveFunction_mod
Use Lattices_v3 Use Lattices_v3
Use MyMats Use MyMats
Use Random_Wrap Use Random_Wrap
Use Files_mod Use Files_mod
Use Matrix Use Matrix
...@@ -129,11 +129,11 @@ ...@@ -129,11 +129,11 @@
Use Predefined_Hoppings Use Predefined_Hoppings
Use LRC_Mod Use LRC_Mod
Implicit none Implicit none
Type (Operator), dimension(:,:), allocatable :: Op_V Type (Operator), dimension(:,:), allocatable :: Op_V
Type (Operator), dimension(:,:), allocatable :: Op_T Type (Operator), dimension(:,:), allocatable :: Op_T
Type (WaveFunction), dimension(:), allocatable :: WF_L Type (WaveFunction), dimension(:), allocatable :: WF_L
Type (WaveFunction), dimension(:), allocatable :: WF_R Type (WaveFunction), dimension(:), allocatable :: WF_R
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
Integer :: N_FL Integer :: N_FL
Integer :: N_SUN Integer :: N_SUN
Integer :: Ltrot Integer :: Ltrot
Integer :: Thtrot Integer :: Thtrot
Logical :: Projector Logical :: Projector
Integer :: Group_Comm Integer :: Group_Comm
Logical :: Symm Logical :: Symm
...@@ -158,25 +158,25 @@ ...@@ -158,25 +158,25 @@
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
!> Privat Observables !> Privat Observables
Type (Obser_Vec ), private, dimension(:), allocatable :: Obs_scal Type (Obser_Vec ), private, dimension(:), allocatable :: Obs_scal
Type (Obser_Latt), private, dimension(:), allocatable :: Obs_eq Type (Obser_Latt), private, dimension(:), allocatable :: Obs_eq
Type (Obser_Latt), private, dimension(:), allocatable :: Obs_tau Type (Obser_Latt), private, dimension(:), allocatable :: Obs_tau
contains
contains
!-------------------------------------------------------------------- !--------------------------------------------------------------------
!> @author !> @author
!> ALF Collaboration !> ALF Collaboration
!> !>
!> @brief !> @brief
!> Sets the Hamiltonian !> Sets the Hamiltonian
!-------------------------------------------------------------------- !--------------------------------------------------------------------
Subroutine Ham_Set Subroutine Ham_Set
#if defined (MPI) || defined(TEMPERING) #if defined (MPI) || defined(TEMPERING)
Use mpi Use mpi
#endif #endif
...@@ -184,9 +184,9 @@ ...@@ -184,9 +184,9 @@
integer :: ierr, nf integer :: ierr, nf
Character (len=64) :: file_info, file_para Character (len=64) :: file_info, file_para
NAMELIST /VAR_Lattice/ L1, L2, Lattice_type, Model NAMELIST /VAR_Lattice/ L1, L2, Lattice_type, Model
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
#endif #endif
! Global "Default" values. ! Global "Default" values.
#ifdef MPI #ifdef MPI
CALL MPI_COMM_SIZE(MPI_COMM_WORLD,ISIZE,IERR) CALL MPI_COMM_SIZE(MPI_COMM_WORLD,ISIZE,IERR)
CALL MPI_COMM_RANK(MPI_COMM_WORLD,IRANK,IERR) CALL MPI_COMM_RANK(MPI_COMM_WORLD,IRANK,IERR)
...@@ -213,9 +213,9 @@ ...@@ -213,9 +213,9 @@
#endif #endif
File_Para = "parameters" File_Para = "parameters"
File_info = "info" File_info = "info"
#if defined(TEMPERING) #if defined(TEMPERING)
write(File_para,'(A,I0,A)') "Temp_",igroup,"/parameters" write(File_para,'(A,I0,A)') "Temp_",igroup,"/parameters"
write(File_info,'(A,I0,A)') "Temp_",igroup,"/info" write(File_info,'(A,I0,A)') "Temp_",igroup,"/info"
#endif #endif
#ifdef MPI #ifdef MPI
...@@ -239,6 +239,7 @@ ...@@ -239,6 +239,7 @@
CLOSE(5) CLOSE(5)
Ltrot = nint(beta/dtau) Ltrot = nint(beta/dtau)
Thtrot = 0
if (Projector) Thtrot = nint(theta/dtau) if (Projector) Thtrot = nint(theta/dtau)
Ltrot = Ltrot+2*Thtrot Ltrot = Ltrot+2*Thtrot
N_SUN = 1 N_SUN = 1
...@@ -250,7 +251,7 @@ ...@@ -250,7 +251,7 @@
Stop Stop
Endif Endif
!!!!! !!!!!
#ifdef MPI #ifdef MPI
Endif Endif
CALL MPI_BCAST(L1 ,1 ,MPI_INTEGER, 0,Group_Comm,ierr) CALL MPI_BCAST(L1 ,1 ,MPI_INTEGER, 0,Group_Comm,ierr)
...@@ -276,11 +277,11 @@ ...@@ -276,11 +277,11 @@
! Setup the Bravais lattice ! Setup the Bravais lattice
Call Ham_Latt Call Ham_Latt
! Setup the hopping / single-particle part ! Setup the hopping / single-particle part
Call Ham_Hop Call Ham_Hop
! Setup the interaction. ! Setup the interaction.
call Ham_V call Ham_V
...@@ -289,7 +290,7 @@ ...@@ -289,7 +290,7 @@
#endif #endif
OPEN(Unit = 50,file=file_info,status="unknown",position="append") OPEN(Unit = 50,file=file_info,status="unknown",position="append")
Write(50,*) '=====================================' Write(50,*) '====================================='
Write(50,*) 'Model is : ', Model Write(50,*) 'Model is : ', Model
Write(50,*) 'Lattice is : ', Lattice_type Write(50,*) 'Lattice is : ', Lattice_type
Write(50,*) 'L1 : ', L1 Write(50,*) 'L1 : ', L1
Write(50,*) 'L2 : ', L2 Write(50,*) 'L2 : ', L2
...@@ -317,12 +318,12 @@ ...@@ -317,12 +318,12 @@
#endif #endif
! Setup the trival wave function, in case of a projector approach ! Setup the trival wave function, in case of a projector approach
if (Projector) Call Ham_Trial(File_info) if (Projector) Call Ham_Trial(File_info)
end Subroutine Ham_Set end Subroutine Ham_Set
!-------------------------------------------------------------------- !--------------------------------------------------------------------
!> @author !> @author
!> ALF Collaboration !> ALF Collaboration
!> !>
!> @brief !> @brief
...@@ -330,32 +331,35 @@ ...@@ -330,32 +331,35 @@
!-------------------------------------------------------------------- !--------------------------------------------------------------------
Subroutine Ham_Latt Subroutine Ham_Latt
Implicit none Implicit none
Real (Kind=Kind(0.d0)) :: a1_p(2), a2_p(2), L1_p(2), L2_p(2) Real (Kind=Kind(0.d0)) :: a1_p(2), a2_p(2), L1_p(2), L2_p(2)
If (Lattice_Type /= "Square") then If (Lattice_Type /= "Square") then
Write(6,*) 'The plain vanilla Hubbard model is only defined for the square lattice' Write(6,*) 'The plain vanilla Hubbard model is only defined for the square lattice'
stop stop
Endif Endif
Latt_Unit%Norb = 1
Allocate (Latt_unit%Orb_pos_p(1,2))
Latt_Unit%Orb_pos_p(1,:) = 0.d0
a1_p(1) = 1.0 ; a1_p(2) = 0.d0 a1_p(1) = 1.0 ; a1_p(2) = 0.d0
a2_p(1) = 0.0 ; a2_p(2) = 1.d0 a2_p(1) = 0.0 ; a2_p(2) = 1.d0
L1_p = dble(L1)*a1_p L1_p = dble(L1)*a1_p
L2_p = dble(L2)*a2_p L2_p = dble(L2)*a2_p
Call Make_Lattice( L1_p, L2_p, a1_p, a2_p, Latt ) Call Make_Lattice( L1_p, L2_p, a1_p, a2_p, Latt )
Ndim = Latt%N Ndim = Latt%N
end Subroutine Ham_Latt end Subroutine Ham_Latt
!-------------------------------------------------------------------- !--------------------------------------------------------------------
!> @author !> @author
!> ALF Collaboration !> ALF Collaboration
!> !>
!> @brief !> @brief
!> Sets the Hopping !> Sets the Hopping
!-------------------------------------------------------------------- !--------------------------------------------------------------------
Subroutine Ham_Hop Subroutine Ham_Hop
Implicit none Implicit none
Integer :: nf , I, Ix, Iy Integer :: nf , I, Ix, Iy
...@@ -372,17 +376,17 @@ ...@@ -372,17 +376,17 @@
Op_T(1,nf)%O(Iy, I ) = cmplx(-Ham_T, 0.d0, kind(0.D0)) Op_T(1,nf)%O(Iy, I ) = cmplx(-Ham_T, 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
Enddo Enddo
Op_T(1,nf)%g = -Dtau Op_T(1,nf)%g = -Dtau
Op_T(1,nf)%alpha = cmplx(0.d0,0.d0, kind(0.D0)) Op_T(1,nf)%alpha = cmplx(0.d0,0.d0, kind(0.D0))
Call Op_set(Op_T(1,nf)) Call Op_set(Op_T(1,nf))
enddo enddo
end Subroutine Ham_Hop end Subroutine Ham_Hop
!-------------------------------------------------------------------- !--------------------------------------------------------------------
!> @author !> @author
!> ALF Collaboration !> ALF Collaboration
!> !>
!> @brief !> @brief
...@@ -396,9 +400,9 @@ ...@@ -396,9 +400,9 @@
#endif #endif
Use Predefined_Trial Use Predefined_Trial
Implicit none Implicit none
Character (len=64), intent(in) :: file_info Character (len=64), intent(in) :: file_info