TABLE OF CONTENTS


ABINIT/m_ImpurityOperator [ Modules ]

[ Top ] [ Modules ]

NAME

  m_ImpurityOperator

FUNCTION

  manage all related to Impurity

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

28 #include "defs.h"
29 MODULE m_ImpurityOperator
30 USE m_ListCdagC
31 USE m_Global
32 IMPLICIT NONE

ABINIT/m_ImpurityOperator/ImpurityOperator_activateParticle [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_activateParticle

FUNCTION

  active a flavor

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  flavor=the flavor

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

502 SUBROUTINE ImpurityOperator_activateParticle(this,flavor)
503 
504 !Arguments ------------------------------------
505 
506 !This section has been created automatically by the script Abilint (TD).
507 !Do not modify the following lines by hand.
508 #undef ABI_FUNC
509 #define ABI_FUNC 'ImpurityOperator_activateParticle'
510 !End of the abilint section
511 
512   TYPE(ImpurityOperator), INTENT(INOUT) :: this
513   INTEGER               , INTENT(IN   ) :: flavor
514 
515   IF ( flavor .GT. this%flavors ) &
516     CALL ERROR("ImpurityOperator_activateParticle : out of range  ")
517   IF ( ALLOCATED(this%particles) ) THEN 
518     this%activeFlavor   =  flavor
519   ELSE
520     CALL ERROR("ImpurityOperator_activateParticle : not allocated  ")
521   END IF
522 END SUBROUTINE ImpurityOperator_activateParticle

ABINIT/m_ImpurityOperator/ImpurityOperator_add [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_add

FUNCTION

  add a segment to the active flavor

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  CdagC_1=couple of times
  position_val=position of the CdagC_1 couple in the list

OUTPUT

SIDE EFFECTS

  this=ImpurityOperatoroffdiag
   this%particles(aF)%list is updated
   this%overlaps  is updated

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

718 SUBROUTINE ImpurityOperator_add(this, CdagC_1, position_val)
719 
720 !Arguments ------------------------------------
721 
722 !This section has been created automatically by the script Abilint (TD).
723 !Do not modify the following lines by hand.
724 #undef ABI_FUNC
725 #define ABI_FUNC 'ImpurityOperator_add'
726 !End of the abilint section
727 
728   TYPE(ImpurityOperator), INTENT(INOUT) :: this
729   DOUBLE PRECISION, DIMENSION(1:2), INTENT(IN   ) :: CdagC_1
730   INTEGER               , INTENT(IN   ) :: position_val
731 !Local variables ------------------------------
732   INTEGER                               :: position
733   INTEGER                               :: aF
734   INTEGER                               :: i
735   DOUBLE PRECISION, DIMENSION(1:2)      :: C2modify
736   DOUBLE PRECISION, DIMENSION(1:2)      :: C2add
737   DOUBLE PRECISION                      :: TCdag
738   DOUBLE PRECISION                      :: TC
739 
740   aF = this%activeFlavor
741   IF ( aF .LE. 0 ) &
742     CALL ERROR("ImpurityOperator_add : no active flavor           ")
743   
744   position = position_val
745 
746   IF ( CdagC_1(C_) .GT. CdagC_1(Cdag_) ) THEN ! Ajout d'un segment
747     C2add = CdagC_1
748   ELSE                                        ! Ajout d'un antisegment
749     IF ( (this%particles(aF)%tail .EQ. 0) .AND. (this%particles(aF)%list(0,C_) .EQ. 0d0)) THEN ! should be full orbital
750       IF ( CdagC_1(Cdag_) .GT. this%beta ) THEN
751 !        CALL CdagC_init(C2add,CdagC_1%Cdag-this%beta,CdagC_1%C)
752         ! From the IF condition and the creation of CdagC in TryAddRemove, we have
753         ! CdagC_1(Cdag_) > beta
754         ! CdagC_1(C_)    < beta
755         C2add(Cdag_) = CdagC_1(Cdag_)-this%beta
756         C2add(C_   ) = CdagC_1(C_)
757         ! Now C2add(Cdag_) < beta
758         ! still C2add(C_)  < beta
759       ELSE
760 !        CALL CdagC_init(C2add,CdagC_1%Cdag,CdagC_1%C+this%beta)
761         ! CdagC_1(Cdag_) < beta
762         ! CdagC_1(C_)    < beta
763         C2add(Cdag_) = CdagC_1(Cdag_)
764         C2add(C_   ) = CdagC_1(C_)+this%beta
765         ! C2add(Cdag_) < beta
766         ! C2ass(C_)    > beta
767       END IF
768       position = 0
769       ! See impurityoperator_init to understand this. This is due to the
770       ! convention for the full orbital case.
771       this%particles(aF)%list(0,C_   ) = this%beta
772       this%particles(aF)%list(0,Cdag_) = 0.d0
773     ELSE IF ( this%particles(aF)%tail .GT. 0 ) THEN
774       position = ABS(position)
775       TCdag = this%particles(aF)%list(position,Cdag_)
776       TC    = CdagC_1(C_)
777       IF ( TCdag .GT. TC ) TC = TC + this%beta
778 !      CALL CdagC_init(C2modify,TCdag,TC)
779       C2modify(Cdag_) = TCdag
780       C2modify(C_   ) = TC
781   
782 !      TCdag    = CdagC_1%Cdag.MOD.this%beta
783       MODCYCLE(CdagC_1(Cdag_),this%beta,TCdag)
784       TC       = this%particles(aF)%list(position,C_)
785 !      CALL CdagC_init(C2add,TCdag,TC)
786       C2add(Cdag_) = TCdag
787       C2add(C_   ) = TC
788   
789       this%particles(aF)%list(position,:) = C2modify
790       IF ( C2modify(Cdag_) .GT. C2add(Cdag_) ) THEN
791         position = 0
792 !        C2add%C = C2add%C.MOD.this%beta
793         MODCYCLE(C2add(C_),this%beta,C2add(C_))
794       END IF
795     ELSE
796       CALL ERROR("ImpurityOperator_add : try to add an antisegment to an empty orbital")
797     END IF
798     position = position + 1
799   END IF
800   CALL ListCdagC_insert(this%particles(aF), c2add, position)
801   DO i = 1, this%flavors
802     this%overlaps(i,aF) = this%overlaps(i,aF) + this%updates(i)
803     this%overlaps(aF,i) = this%overlaps(i,aF)
804   END DO
805 
806 END SUBROUTINE ImpurityOperator_add

ABINIT/m_ImpurityOperator/ImpurityOperator_checkOverlap [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_checkOverlap

FUNCTION

  check the calculation of the overlap (very very slow routine)
  between Tmin and Tmax (c+ and c)

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  Tmin=c+
  Tmax=c
  iOverlap=input overlap (fast calculation)
  iflavor=active flavor

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

2217 SUBROUTINE ImpurityOperator_checkOverlap(this, Tmin, Tmax, iOverlap, iflavor)
2218 
2219 !Arguments ------------------------------------
2220 
2221 !This section has been created automatically by the script Abilint (TD).
2222 !Do not modify the following lines by hand.
2223 #undef ABI_FUNC
2224 #define ABI_FUNC 'ImpurityOperator_checkOverlap'
2225 !End of the abilint section
2226 
2227   TYPE(ImpurityOperator), INTENT(INOUT)  :: this
2228   DOUBLE PRECISION      , INTENT(IN   )  :: Tmin
2229   DOUBLE PRECISION      , INTENT(IN   )  :: Tmax
2230   DOUBLE PRECISION      , INTENT(IN   )  :: iOverlap
2231   INTEGER               , INTENT(IN   )  :: iflavor 
2232 !Local variables ------------------------------
2233   INTEGER, PARAMETER                     :: size=10000000
2234   INTEGER                                :: imin
2235   INTEGER                                :: imax
2236   INTEGER                                :: imaxbeta
2237   INTEGER                                :: isegment
2238   INTEGER                                :: tail
2239   INTEGER(1), DIMENSION(1:size,1:2)      :: checktab 
2240   CHARACTER(LEN=4)                       :: a
2241   DOUBLE PRECISION                       :: dt
2242   DOUBLE PRECISION                       :: inv_dt
2243   DOUBLE PRECISION                       :: overlap
2244   DOUBLE PRECISION                       :: erreur
2245   DOUBLE PRECISION                       :: weight
2246   INTEGER :: try
2247 
2248   checktab = INT(0,1)
2249   overlap = 0.d0
2250 
2251   dt = this%beta / DBLE((size-1))
2252   inv_dt = 1.d0 / dt
2253   imin = INT(Tmin / dt + 0.5d0) + 1
2254   imax = INT(Tmax / dt + 0.5d0) + 1
2255   MODCYCLE(imax, size, imaxbeta)
2256 
2257   tail = this%particles(iflavor)%tail
2258 
2259   DO try = imin, MIN(imax,size)
2260     checktab(try,1)=INT(1,1)!IBSET(checktab(try,1),0)
2261   END DO
2262 
2263   IF ( imax .NE. imaxbeta ) THEN 
2264     DO try = 1, imaxbeta
2265       checktab(try,1)=INT(1,1)!IBSET(checktab(try,1),0)
2266     END DO
2267   END IF
2268 
2269   IF ( tail .NE. 0 ) THEN
2270     DO isegment=1, tail
2271       imin = INT(this%particles(iflavor)%list(isegment,Cdag_)* inv_dt + 0.5d0) + 1
2272       imax = INT(this%particles(iflavor)%list(isegment,C_   )* inv_dt + 0.5d0) + 1
2273       MODCYCLE(imax, size, imaxbeta)
2274       DO try = imin, MIN(imax,size)
2275         checktab(try,2)=INT(1,1)!IBSET(checktab(try,2),0)
2276       END DO
2277       IF ( imax .NE. imaxbeta ) THEN
2278         DO try = 1, imaxbeta
2279           checktab(try,2)=INT(1,1)!IBSET(checktab(try,2),0)
2280         END DO
2281       END IF
2282     END DO
2283   ELSE IF ( this%particles(iflavor)%list(0,C_) .EQ. 0.d0 ) THEN
2284     DO try = 1, size
2285       checktab(try,2)=INT(1,1)!IBSET(checktab(try,2),0)
2286     END DO
2287   END IF
2288 
2289   DO isegment = 1, size
2290     IF ( IAND(checktab(isegment,1),checktab(isegment,2)) .EQ. INT(1,1) ) &
2291       overlap = overlap + 1.d0
2292   END DO
2293 
2294   overlap = overlap * dt
2295 
2296   IF ( iOverlap .EQ. 0.d0 ) THEN
2297     erreur = ABS(overlap)
2298   ELSE
2299     erreur = ABS(overlap                - iOverlap)
2300   END IF
2301   weight = ABS(2.d0 * DBLE(tail) * dt - iOverlap)
2302   IF ( erreur .GT. weight  ) THEN 
2303     WRITE(a,'(I4)') INT(erreur*100.d0)
2304     CALL WARN("ImpurityOperator_checkOverlap : "//a//"%              ") 
2305   END IF
2306   IF ( iOverlap .LE. (2.d0 * DBLE(tail) * dt) ) &
2307     this%meanError = this%meanError + 1.d0
2308   this%checkNumber = this%checkNumber + 1.d0 !weight 
2309 
2310 END SUBROUTINE ImpurityOperator_checkOverlap

ABINIT/m_ImpurityOperator/ImpurityOperator_cleanOverlaps [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_cleanOverlaps

FUNCTION

  Compute from scratch all overlaps

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

1900 SUBROUTINE ImpurityOperator_cleanOverlaps(this)
1901 
1902 !Arguments ------------------------------------
1903 
1904 !This section has been created automatically by the script Abilint (TD).
1905 !Do not modify the following lines by hand.
1906 #undef ABI_FUNC
1907 #define ABI_FUNC 'ImpurityOperator_cleanOverlaps'
1908 !End of the abilint section
1909 
1910   TYPE(ImpurityOperator), INTENT(INOUT) :: this
1911 !Local variables ------------------------------
1912   INTEGER                                       :: iflavor1
1913   INTEGER                                       :: iflavor2
1914   INTEGER                                       :: flavors
1915 
1916   IF ( .NOT. ALLOCATED(this%particles) ) &
1917     CALL ERROR("ImpurityOperator_cleanOverlap : no particle set   ")
1918 
1919   flavors = this%flavors
1920   DO iflavor1 = 1, flavors
1921     DO iflavor2 = iflavor1+1, flavors
1922       this%overlaps(iflavor2,iflavor1) = ImpurityOperator_overlapIJ(this,iflavor1,iflavor2) 
1923     END DO
1924   END DO
1925 
1926 END SUBROUTINE ImpurityOperator_cleanOverlaps

ABINIT/m_ImpurityOperator/ImpurityOperator_computeU [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_computeU

FUNCTION

  Compute an interaction this for t2g like interaction

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  U=Coulomb scrren interaction
  J=Hund couplage

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

310 SUBROUTINE ImpurityOperator_computeU(this, U, J)
311 
312 !Arguments ------------------------------------
313 
314 !This section has been created automatically by the script Abilint (TD).
315 !Do not modify the following lines by hand.
316 #undef ABI_FUNC
317 #define ABI_FUNC 'ImpurityOperator_computeU'
318 !End of the abilint section
319 
320   TYPE(ImpurityOperator), INTENT(INOUT) :: this
321   DOUBLE PRECISION      , INTENT(IN   ) :: U
322   DOUBLE PRECISION      , INTENT(IN   ) :: J
323 !Local variables ------------------------------
324   INTEGER                               :: flavor11
325   INTEGER                               :: flavor12
326   INTEGER                               :: flavor21
327   INTEGER                               :: flavor22
328   INTEGER                               :: flavors
329   INTEGER                               :: flavors_2
330   DOUBLE PRECISION                      :: Uprime
331 
332   Uprime = U - 2.d0 * J
333   flavors = this%flavors
334   flavors_2 = flavors / 2
335   DO flavor11 = 1, flavors_2
336     flavor12 = flavors - flavor11 + 1
337     this%mat_U(flavor11, flavor11) = 0.d0
338     this%mat_U(flavor12, flavor12) = 0.d0
339     this%mat_U(flavor11+flavors_2, flavor11) = U
340     this%mat_U(flavor12-flavors_2, flavor12) = U
341     DO flavor21 = flavor11+1, flavors_2
342       flavor22 = flavors - flavor21 + 1
343       this%mat_U(flavor21, flavor11) = Uprime
344       this%mat_U(flavor22-flavors_2, flavor12-flavors_2) = Uprime
345       this%mat_U(flavor21+flavors_2, flavor11+flavors_2) = Uprime
346       this%mat_U(flavor22, flavor12) = Uprime
347     END DO
348     DO flavor21 = flavor11+flavors_2+1, flavors
349       flavor22 = flavors - flavor21 + 1
350       this%mat_U(flavor21, flavor11) = Uprime - J
351       this%mat_U(flavor22+flavors_2, flavor12-flavors_2) = Uprime - J
352       this%mat_U(flavor21-flavors_2, flavor11+flavors_2) = Uprime - J
353       this%mat_U(flavor22, flavor12) = Uprime - J
354     END DO
355   END DO
356 END SUBROUTINE ImpurityOperator_computeU 

ABINIT/m_ImpurityOperator/ImpurityOperator_destroy [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_destroy

FUNCTION

  destroy and deallocate

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

2031 SUBROUTINE ImpurityOperator_destroy(this)
2032 
2033 !Arguments ------------------------------------
2034 
2035 !This section has been created automatically by the script Abilint (TD).
2036 !Do not modify the following lines by hand.
2037 #undef ABI_FUNC
2038 #define ABI_FUNC 'ImpurityOperator_destroy'
2039 !End of the abilint section
2040 
2041   TYPE(ImpurityOperator), INTENT(INOUT) :: this
2042 !Local variables ------------------------------
2043   INTEGER                               :: IT
2044 
2045   IF ( ALLOCATED(this%particles) ) THEN
2046     DO IT = 1, this%flavors
2047       CALL ListCdagC_destroy(this%particles(IT))
2048     END DO
2049     DT_FREE(this%particles)
2050   ENDIF
2051   CALL ListCdagC_destroy(this%list_swap)
2052   FREEIF(this%mat_U)
2053   FREEIF(this%overlaps)
2054   FREEIF(this%updates)
2055   this%activeFlavor = 0
2056   this%flavors      = 0
2057   this%beta         = 0.d0
2058 END SUBROUTINE ImpurityOperator_destroy

ABINIT/m_ImpurityOperator/ImpurityOperator_doCheck [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_doCheck

FUNCTION

  set the check mechanism

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  opt_check=1||3 do check

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

2164 SUBROUTINE ImpurityOperator_doCheck(this,opt_check)
2165 
2166 !Arguments ------------------------------------
2167 
2168 !This section has been created automatically by the script Abilint (TD).
2169 !Do not modify the following lines by hand.
2170 #undef ABI_FUNC
2171 #define ABI_FUNC 'ImpurityOperator_doCheck'
2172 !End of the abilint section
2173 
2174   TYPE(ImpurityOperator) , INTENT(INOUT) :: this
2175   INTEGER                , INTENT(IN   ) :: opt_check
2176 
2177   IF ( opt_check .EQ. 1 .OR. opt_check .EQ. 3 ) &
2178     this%doCheck = .TRUE.
2179 END SUBROUTINE ImpurityOperator_doCheck

ABINIT/m_ImpurityOperator/ImpurityOperator_getAvailableTime [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_getAvailableTime

FUNCTION

  get the time available and the position of the segment to consider
  negative if on a segment
  positive if outside a segment

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  time=time to look for

OUTPUT

  ImpurityOperator_getAvailableTime=Time available
  position=position of the next segment

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

560 DOUBLE PRECISION FUNCTION ImpurityOperator_getAvailableTime(this, time, position)
561 
562 !Arguments ------------------------------------
563 
564 !This section has been created automatically by the script Abilint (TD).
565 !Do not modify the following lines by hand.
566 #undef ABI_FUNC
567 #define ABI_FUNC 'ImpurityOperator_getAvailableTime'
568 !End of the abilint section
569 
570   TYPE(ImpurityOperator), INTENT(IN   ) :: this
571   DOUBLE PRECISION      , INTENT(IN   ) :: time
572   INTEGER               , INTENT(OUT  ) :: position
573 !Local variables ------------------------------
574   DOUBLE PRECISION                      :: t_avail
575   INTEGER                               :: position_dwn
576   INTEGER                               :: aF
577 #include "ListCdagC_firstHigher.h"
578   aF = this%activeFlavor
579   IF ( aF .LE. 0 ) &
580     CALL ERROR("ImpurityOperator_getAvailableTime : no active flav")
581   
582   IF ( this%particles(aF)%tail .EQ. 0 ) THEN
583     t_avail = this%particles(aF)%list(0,C_) - this%particles(aF)%list(0,Cdag_)
584     position = SIGN(1,INT(t_avail))
585   ELSE
586 !    position = ListCdagC_firstHigher( this%particles(aF), time ) 
587 #define list_1 this%particles(aF) 
588 #include "ListCdagC_firstHigher"
589 #undef list_1
590     position = firstHigher
591     position_dwn = position - 1
592     IF ( position_dwn .LE. 0) position_dwn = this%particles(aF)%tail
593   
594 !    t_avail = (time - this%particles(aF)%list(position_dwn)) .MOD. this%beta
595     t_avail = time - this%particles(aF)%list(position_dwn,C_)
596     IF ( this%particles(aF)%list(position_dwn,Cdag_) .GT. time ) &
597       t_avail = t_avail + this%beta 
598   
599     IF ( t_avail .GT. 0.d0 ) THEN  !! We are outside the position_dwn segment
600 !      t_avail = (this%particles(aF)%list(ABS(position)) - time ) .MOD. this%beta 
601       t_avail = this%particles(aF)%list(ABS(position),Cdag_) - time 
602       IF ( this%particles(aF)%list(ABS(position),Cdag_) .LT. time ) &
603         t_avail = t_avail + this%beta
604       ! ABS is used to prevent position to be -1 which is HERE the same as 1
605     ELSE
606       position = - position_dwn
607     END IF
608   END IF
609   
610     ImpurityOperator_getAvailableTime = t_avail
611 
612 END FUNCTION ImpurityOperator_getAvailableTime

ABINIT/m_ImpurityOperator/ImpurityOperator_getAvailedTime [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_getAvailedTime

FUNCTION

  get the time available without the segment "position"

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  position=position of the segment

OUTPUT

  ImpurityOperator_getAvailedTime=time available before ...

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

647 DOUBLE PRECISION FUNCTION ImpurityOperator_getAvailedTime(this, position)
648 
649 !Arguments ------------------------------------
650 
651 !This section has been created automatically by the script Abilint (TD).
652 !Do not modify the following lines by hand.
653 #undef ABI_FUNC
654 #define ABI_FUNC 'ImpurityOperator_getAvailedTime'
655 !End of the abilint section
656 
657   TYPE(ImpurityOperator), INTENT(IN   ) :: this
658   INTEGER               , INTENT(IN   ) :: position
659   DOUBLE PRECISION                      :: T_avail
660   INTEGER                               :: Pup
661   INTEGER                               :: ABSp
662   INTEGER                               :: tail
663   INTEGER                               :: aF
664 
665   aF = this%activeFlavor
666   IF ( aF .LE. 0 ) &
667     CALL ERROR("ImpurityOperator_getAvailedTime : no active flavor")
668   ABSp = ABS(position)
669 !  position_up = (ABSposition+1).MOD.this%particles(aF)%tail
670  tail = this%particles(aF)%tail
671   MODCYCLE(ABSp+1,tail,Pup)
672   IF ( position .GT. 0 ) THEN
673     t_avail = this%particles(aF)%list(Pup, Cdag_) &
674             - this%particles(aF)%list(ABSp,Cdag_)
675   ELSE
676     t_avail = this%particles(aF)%list(Pup ,C_) &
677             - this%particles(aF)%list(ABSp,C_)
678   END IF
679   IF ( t_avail .LE. 0.d0 ) t_avail = t_avail + this%beta
680   ImpurityOperator_getAvailedTime = t_avail
681 END FUNCTION ImpurityOperator_getAvailedTime

ABINIT/m_ImpurityOperator/ImpurityOperator_getError [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_getErro

FUNCTION

  get error on computing the overlap

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator

OUTPUT

  ImpurityOperator_getError=percentage error

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

2344 DOUBLE PRECISION FUNCTION ImpurityOperator_getError(this)
2345 
2346 !Arguments ------------------------------------
2347 
2348 !This section has been created automatically by the script Abilint (TD).
2349 !Do not modify the following lines by hand.
2350 #undef ABI_FUNC
2351 #define ABI_FUNC 'ImpurityOperator_getError'
2352 !End of the abilint section
2353 
2354   TYPE(ImpurityOperator), INTENT(IN) :: this
2355 !Local variables ------------------------------
2356 !  DOUBLE PRECISION :: tolerance
2357   DOUBLE PRECISION :: error
2358 
2359   IF ( this%doCheck .EQV. .TRUE. ) THEN
2360     error     = ABS(this%meanError/this%checkNumber) 
2361 !  tolerance = ABS(this%tolerance/this%checkNumber) 
2362     ImpurityOperator_getError = error 
2363   ELSE
2364     ImpurityOperator_getError = 0.d0
2365   END IF
2366 END FUNCTION ImpurityOperator_getError

ABINIT/m_ImpurityOperator/ImpurityOperator_getErrorOverlap [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_getErrorOverlap

FUNCTION

  compute error on the overlap (numerical accumulation)

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator

OUTPUT

  DE=save the error

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

2092 SUBROUTINE ImpurityOperator_getErrorOverlap(this,DE)
2093 
2094 !Arguments ------------------------------------
2095 
2096 !This section has been created automatically by the script Abilint (TD).
2097 !Do not modify the following lines by hand.
2098 #undef ABI_FUNC
2099 #define ABI_FUNC 'ImpurityOperator_getErrorOverlap'
2100 !End of the abilint section
2101 
2102   TYPE(ImpurityOperator), INTENT(INOUT) :: this
2103   DOUBLE PRECISION, DIMENSION(:,:), INTENT(INOUT) :: DE
2104 !Local variables ------------------------------
2105   DOUBLE PRECISION                              :: localD1
2106   DOUBLE PRECISION                              :: localD2
2107   DOUBLE PRECISION                              :: totalE1
2108   DOUBLE PRECISION                              :: totalE2
2109   INTEGER                                       :: iflavor1
2110   INTEGER                                       :: iflavor2
2111   INTEGER                                       :: flavors
2112 
2113   IF ( .NOT. ALLOCATED(this%particles) ) &
2114     CALL ERROR("ImpurityOperator_getErrorOverlap : no particle set ")
2115 
2116   totalE1 = 0.d0
2117   totalE2 = 0.d0
2118   flavors = this%flavors
2119   DO iflavor1 = 1, flavors
2120     DO iflavor2 = iflavor1+1, flavors
2121       localD1 = ImpurityOperator_overlapIJ(this,iflavor1,iflavor2) 
2122       localD2 = this%overlaps(iflavor2,iflavor1)
2123       totalE1 = totalE1 + localD1 * this%mat_U(iflavor1,iflavor2)
2124       totalE2 = totalE2 + localD2 * this%mat_U(iflavor1,iflavor2)
2125     END DO
2126   END DO
2127 
2128   DE(2,2) = ABS(totalE1 - totalE2)
2129 
2130 END SUBROUTINE ImpurityOperator_getErrorOverlap

ABINIT/m_ImpurityOperator/ImpurityOperator_getNewOverlap [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_getNewOverlap

FUNCTION

  Get the overlap induced by CdagC_1 in the current configuration

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  CdagC_1=the segment

OUTPUT

  ImpurityOperator_getNewOverlap=overlap..

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

1009 DOUBLE PRECISION FUNCTION ImpurityOperator_getNewOverlap(this, CdagC_1)
1010 
1011 !Arguments ------------------------------------
1012 
1013 !This section has been created automatically by the script Abilint (TD).
1014 !Do not modify the following lines by hand.
1015 #undef ABI_FUNC
1016 #define ABI_FUNC 'ImpurityOperator_getNewOverlap'
1017 !End of the abilint section
1018 
1019   TYPE(ImpurityOperator), INTENT(INOUT) :: this
1020   DOUBLE PRECISION, DIMENSION(1:2), INTENT(IN) :: CdagC_1
1021 !Local variables ------------------------------
1022   DOUBLE PRECISION, DIMENSION(1:2)   :: CdagC_2
1023   DOUBLE PRECISION                   :: overlap
1024   DOUBLE PRECISION                   :: totalOverlap
1025   DOUBLE PRECISION                   :: sign
1026   INTEGER                            :: flavor
1027   INTEGER                            :: otherFlavor
1028 
1029   flavor = this%activeFlavor
1030   IF ( flavor .LE. 0 ) &
1031     CALL ERROR("ImpurityOperator_getNewOverlap : no active flavor ")
1032   IF ( CdagC_1(Cdag_) .LT. CdagC_1(C_) ) THEN ! segment C*C
1033     CdagC_2 = CdagC_1
1034     sign = -1.d0
1035   ELSE
1036     CdagC_2(C_) = CdagC_1(Cdag_)
1037     CdagC_2(Cdag_) = CdagC_1(C_)
1038     sign = 1.d0
1039   END IF
1040 
1041   totalOverlap = 0.d0
1042 
1043   DO otherFlavor = 1, this%flavors
1044     IF ( otherFlavor .EQ. flavor ) CYCLE
1045     overlap = ImpurityOperator_overlapSegFlav(this,CdagC_2(1:2),otherflavor)
1046     totalOverlap = totalOverlap &
1047                  + overlap * this%mat_U(otherFlavor,flavor)
1048     this%updates(otherFlavor) = -sign * overlap
1049   END DO
1050 
1051   totalOverlap = totalOverlap * sign
1052   ImpurityOperator_getNewOverlap = totalOverlap
1053 
1054 END FUNCTION ImpurityOperator_getNewOverlap

ABINIT/m_ImpurityOperator/ImpurityOperator_getSegment [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_getSegment

FUNCTION

  Return the segment at position_val

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  position_val=position of the asked segment

OUTPUT

  ImpurityOperator_getSegment(2)=the couple of time

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

841 FUNCTION ImpurityOperator_getSegment(this,position_val)
842 
843 !Arguments ------------------------------------
844 
845 !This section has been created automatically by the script Abilint (TD).
846 !Do not modify the following lines by hand.
847 #undef ABI_FUNC
848 #define ABI_FUNC 'ImpurityOperator_getSegment'
849 !End of the abilint section
850 
851   TYPE(ImpurityOperator), INTENT(INOUT) :: this
852   INTEGER               , INTENT(IN   ) :: position_val
853 !Local variables ------------------------------
854   INTEGER                               :: position
855   INTEGER                               :: tail
856   INTEGER                               :: aF
857   DOUBLE PRECISION                      :: beta
858   DOUBLE PRECISION                      :: ImpurityOperator_getSegment(1:2)
859 
860   aF = this%activeFlavor
861   IF ( aF .LE. 0 ) &
862     CALL ERROR("ImpurityOperator_getSegment : no active flavor    ")
863 
864   IF ( position_val .GT. 0 ) THEN
865     ImpurityOperator_getSegment = this%particles(aF)%list(position_val,1:2)
866   ELSE
867     position = ABS(position_val)
868     tail = this%particles(aF)%tail
869     beta = this%beta
870     ImpurityOperator_getSegment(C_)  = this%particles(aF)%list(position,C_)
871     position = position + 1
872     IF ( position .GT. tail ) THEN
873       IF ( ImpurityOperator_getSegment(C_) .LT. beta ) THEN
874         ImpurityOperator_getSegment(Cdag_) = this%particles(aF)%list(1,Cdag_) + beta
875       ELSE
876         ImpurityOperator_getSegment(Cdag_) = this%particles(aF)%list(1,Cdag_)
877         ImpurityOperator_getSegment(C_)    = ImpurityOperator_getSegment(C_) -beta
878       END IF
879     ELSE
880       ImpurityOperator_getSegment(Cdag_) = this%particles(aF)%list(position,Cdag_)
881     END IF
882 
883   END IF
884 END FUNCTION ImpurityOperator_getSegment

ABINIT/m_ImpurityOperator/ImpurityOperator_getsign [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_getsign

FUNCTION

  Get the sign of the ratio of impurity traces

COPYRIGHT

  Copyright (C) 2013-2014 ABINIT group (B. Amadon)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this     = ImpurityOperator
  time2    = for segment/antisegment addition, end of segment
  position = for segment/antisegment removal, position  of segment/antisegment removed
  action = > 0.5 addition 
           < 0.5 removal

OUTPUT

  ImpurityOperator_getsign = sign of ratio of impurity traces

SIDE EFFECTS

NOTES

PARENTS

  Ctqmc_tryAddRemove

CHILDREN

SOURCE

1091 DOUBLE PRECISION FUNCTION ImpurityOperator_getsign(this, time2, i, action, position)
1092 
1093 !Arguments ------------------------------------
1094 
1095 !This section has been created automatically by the script Abilint (TD).
1096 !Do not modify the following lines by hand.
1097 #undef ABI_FUNC
1098 #define ABI_FUNC 'ImpurityOperator_getsign'
1099 !End of the abilint section
1100 
1101   TYPE(ImpurityOperator), INTENT(IN) :: this
1102   DOUBLE PRECISION, INTENT(IN) :: time2, action
1103   INTEGER ,  INTENT(IN) :: i,position
1104 !Local variables ------------------------------
1105   INTEGER                            :: tailint
1106   DOUBLE PRECISION                   :: sign_imp
1107 ! ************************************************************************
1108   tailint=this%particles(this%activeflavor)%tail
1109   if(action < 0.5d0) then
1110     if(tailint>=1) then
1111       if ( this%particles(this%activeFlavor)%list(tailint,2)>this%beta ) then ! segment winds around
1112         if (i==1) then ! add segment do not change winding
1113            sign_imp = 1
1114         else if (i==2) then ! antisegment
1115            if(time2>this%beta) then ! suppress winding around
1116              sign_imp = -1
1117            else   ! winding around still here
1118              sign_imp = 1
1119            endif
1120         endif
1121       else ! segment do not wind around
1122         if (i==1) then ! segment
1123           if(time2>this%beta) then ! create winding
1124             sign_imp = -1
1125           else   ! do not create winding
1126             sign_imp = 1
1127           endif
1128         else if (i==2) then ! no winding in any case
1129           sign_imp = 1
1130         endif
1131       endif
1132     else if (tailint==0) then
1133       if (i==1) then ! segment
1134         if(time2>this%beta) then ! create winding
1135            sign_imp = -1
1136         else   ! do not create winding
1137            sign_imp = 1
1138         endif
1139       else if (i==2) then ! antisegment
1140         if(time2>this%beta) then ! do not create winding
1141           sign_imp = 1
1142         else   ! create winding
1143           sign_imp = -1
1144         endif
1145       endif
1146     endif
1147   else
1148     if ( this%particles(this%activeFlavor)%list(tailint,2)>this%beta ) then ! segment winds around
1149       if (i==1) then ! remove segment
1150         if(position==tailint) then ! suppress winding around
1151           sign_imp = -1
1152         else  ! winding around still here
1153           sign_imp = 1
1154         endif
1155       else if (i==2) then ! remove antisegment
1156         if(tailint==1) then ! if tailint=1, create full orbital
1157           sign_imp = -1
1158         else  ! if tailint >1 preserve winding
1159           sign_imp = 1
1160         endif
1161       endif
1162     else ! segments do not wind around
1163       if (i==1) then ! suppress segment do not change winding
1164         sign_imp = 1
1165       else if (i==2) then ! antisegment 
1166         if(abs(position)==tailint) then  ! create winding around only tailint >=1
1167           if(tailint==1)  then 
1168             sign_imp = 1
1169           else 
1170             sign_imp = -1
1171           endif
1172         else  !do not create winding around
1173           sign_imp = 1
1174         endif
1175       endif
1176     endif
1177   endif
1178 
1179   ImpurityOperator_getsign=sign_imp
1180 
1181 
1182 END FUNCTION ImpurityOperator_getsign

ABINIT/m_ImpurityOperator/ImpurityOperator_getTraceAdd [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_getTraceAdd

FUNCTION

  Get the ratio of the traces of the impurity hamiltonien with and without the
  new (anti-)segment.

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  CdagC_1=the segment

OUTPUT

  ImpurityOperator_getTraceAdd = Tr[exp(-beta !H_impurity)c(t1)cd(t1)c(t2)cd(t2)...]/Tr[..]

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

1218 FUNCTION ImpurityOperator_getTraceAdd(this, CdagC_1) RESULT(trace)
1219 
1220 
1221 !This section has been created automatically by the script Abilint (TD).
1222 !Do not modify the following lines by hand.
1223 #undef ABI_FUNC
1224 #define ABI_FUNC 'ImpurityOperator_getTraceAdd'
1225 !End of the abilint section
1226 
1227   TYPE(ImpurityOperator)          , INTENT(INOUT) :: this
1228   DOUBLE PRECISION, DIMENSION(1:2), INTENT(IN   ) :: CdagC_1
1229   LOGICAL          :: antiseg
1230   DOUBLE PRECISION :: trace
1231   DOUBLE PRECISION :: overlap
1232   DOUBLE PRECISION :: length
1233   DOUBLE PRECISION :: antisym_sign
1234   DOUBLE PRECISION :: beta
1235 
1236   beta = this%beta
1237   antisym_sign = 1.0d0
1238   overlap   = ImpurityOperator_getNewOverlap(this,CdagC_1)
1239   length    = CdagC_1(C_   ) - CdagC_1(Cdag_)
1240   antiseg    = length .LT. 0.d0
1241   ! length > 0 if segment; < 0 if antisegment
1242   if ( this%particles(this%activeFlavor)%tail .GT. 0  .AND. &
1243        ( ( (.NOT. antiseg) .AND. CdagC_1(C_) .GT. beta ) .OR. &! for seg only
1244          ( antiseg .AND. CdagC_1(C_) .LT. beta .AND. CdagC_1(Cdag_) .GT. beta ) & ! SIGN > 0 for antiseg only
1245        ) &
1246      ) THEN
1247     antisym_sign = -1.d0
1248   ELSE IF ( this%particles(this%activeFlavor)%tail .EQ. 0 .AND. &
1249             ( ( (.NOT. antiseg) .AND. CdagC_1(C_) .GT. beta ) .OR. & ! >beta only possible for seg
1250               ( antiseg .AND. CdagC_1(Cdag_) .LT. beta ) & ! antiseg cdag < beta
1251             ) & 
1252           ) THEN
1253     antisym_sign = -1.d0
1254   END IF
1255 
1256   trace = antisym_sign * DEXP(this%mat_U(this%activeFlavor,this%activeFlavor)*length + overlap) 
1257 
1258 END FUNCTION ImpurityOperator_getTraceAdd

ABINIT/m_ImpurityOperator/ImpurityOperator_getTraceRemove [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_getTraceRemove

FUNCTION

  Get the ratio of the traces of the impurity hamiltonien without and with the
  (anti-)segment.

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  position=position of the segment

OUTPUT

  ImpurityOperator_getTraceRemove = Tr[exp(-beta !H_impurity)c(t1)cd(t1)c(t2)cd(t2)...]/Tr[..]

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

1294 FUNCTION ImpurityOperator_getTraceRemove(this, position) RESULT(trace)
1295 
1296 
1297 !This section has been created automatically by the script Abilint (TD).
1298 !Do not modify the following lines by hand.
1299 #undef ABI_FUNC
1300 #define ABI_FUNC 'ImpurityOperator_getTraceRemove'
1301 !End of the abilint section
1302 
1303   TYPE(ImpurityOperator), INTENT(INOUT) :: this
1304   INTEGER               , INTENT(IN   ) :: position
1305   INTEGER          :: tail
1306   DOUBLE PRECISION :: trace
1307   DOUBLE PRECISION :: overlap
1308   DOUBLE PRECISION :: length
1309   DOUBLE PRECISION :: antisym_sign
1310   DOUBLE PRECISION :: last_C
1311   DOUBLE PRECISION :: beta
1312   DOUBLE PRECISION, DIMENSION(1:2) :: CdagC_1
1313 
1314   beta = this%beta
1315   antisym_sign = 1.0d0
1316 
1317   CdagC_1    = ImpurityOperator_getSegment(this,position)
1318   length     = CdagC_1(C_) - CdagC_1(Cdag_)
1319   ! length > 0 if segment; < 0 if antisegment
1320   overlap    = ImpurityOperator_getNewOverlap(this,CdagC_1)
1321 
1322   tail = this%particles(this%activeFlavor)%tail
1323   last_C = this%particles(this%activeFlavor)%list(tail,C_)
1324   IF ( last_C .GT. beta ) THEN ! tail > 0 since if tail == 0 {0,beta}
1325     IF ( ( position .EQ. tail ) .OR. & ! only possible for segment (<0 if antiseg)
1326          ( length .LT. 0.d0 .AND. tail .EQ. 1 ) ) THEN
1327       antisym_sign = -1.d0
1328     END IF
1329   ELSE 
1330     IF ( tail .GT. 1 .AND. position .EQ. -tail ) & !tail>1 and last antisegment
1331     antisym_sign = -1.d0
1332   END IF
1333 
1334   trace = antisym_sign * DEXP(-this%mat_U(this%activeFlavor,this%activeFlavor)*length-overlap)
1335 
1336 END FUNCTION ImpurityOperator_getTraceRemove

ABINIT/m_ImpurityOperator/ImpurityOperator_init [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_init

FUNCTION

  Initialize and allocate

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurtiyOperator
  flavors=number of flavors
  beta=inverse temperature

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

154 SUBROUTINE ImpurityOperator_init(this, flavors, beta)
155 
156 !Arguments ------------------------------------
157 
158 !This section has been created automatically by the script Abilint (TD).
159 !Do not modify the following lines by hand.
160 #undef ABI_FUNC
161 #define ABI_FUNC 'ImpurityOperator_init'
162 !End of the abilint section
163 
164   TYPE(ImpurityOperator), INTENT(INOUT) :: this
165   INTEGER               , INTENT(IN   ) :: flavors
166   !DOUBLE PRECISION      , INTENT(IN   ) :: U
167   !DOUBLE PRECISION      , INTENT(IN   ) :: J
168   DOUBLE PRECISION      , INTENT(IN   ) :: beta
169   !INTEGER               , INTENT(IN   ) :: N
170 !Local variables ------------------------------
171   INTEGER                               :: IT
172   
173   this%flavors      = flavors
174   this%activeFlavor = 0
175   this%beta         = beta
176 
177   IF ( MOD(flavors,2) .NE. 0 ) &
178     CALL ERROR("ImpurityOperator_init : flavors is not even        ")
179 
180 !#ifdef CTQMC_CHECK
181   this%meanError    = 0.d0
182   this%checkNumber  = 0.d0
183   this%tolerance    = 0.d0
184   this%doCheck      = .FALSE.
185 !#endif
186   DT_FREEIF(this%particles)
187   DT_MALLOC(this%particles,(1:flavors))
188   FREEIF(this%mat_U)
189   MALLOC(this%mat_U,(1:flavors,1:flavors))
190   FREEIF(this%overlaps)
191   MALLOC(this%overlaps,(1:flavors,1:flavors))
192   this%overlaps = 0.d0
193   FREEIF(this%updates)
194   MALLOC(this%updates,(1:flavors))
195   this%updates = 0.d0
196   !CALL ImpurityOperator_computeU(this, U, J)
197   !this%mat_U = U
198   !IF ( ASSOCIATED(this%mu) ) FREE(this%mu)
199   !MALLOC(this%mu,(1:flavors))
200  
201   !this%shift_mu = SUM(this%mat_U(:,1)) * .5d0 
202   DO IT = 1,flavors
203     !CALL ListCdagC_init(this%particles(IT), DBLE(N)/beta,100) !FIXME size of the List
204     CALL ListCdagC_init(this%particles(IT),100) !FIXME size of the List
205     this%particles(IT)%list(0,C_   ) = beta ! Empty orbital 
206     this%particles(IT)%list(0,Cdag_) = 0.d0
207 !    this%particles(IT)%list(0)%Cdag = beta ! Full orbital 
208 !    this%particles(IT)%list(0)%C    = 0.d0
209   END DO
210   this%activeFlavor = 0
211 END SUBROUTINE ImpurityOperator_init 

ABINIT/m_ImpurityOperator/ImpurityOperator_measDE [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_measDE

FUNCTION

  measure double occupancy and interaction energy

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator

OUTPUT

  DE=array accumulating duoble occupancy and energy

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

1832 SUBROUTINE ImpurityOperator_measDE(this,DE)
1833 
1834 !Arguments ------------------------------------
1835 
1836 !This section has been created automatically by the script Abilint (TD).
1837 !Do not modify the following lines by hand.
1838 #undef ABI_FUNC
1839 #define ABI_FUNC 'ImpurityOperator_measDE'
1840 !End of the abilint section
1841 
1842   TYPE(ImpurityOperator), INTENT(IN) :: this
1843   DOUBLE PRECISION, DIMENSION(:,:), INTENT(INOUT) :: DE
1844 !Local variables ------------------------------
1845   DOUBLE PRECISION                              :: localD
1846   DOUBLE PRECISION                              :: totalE
1847   INTEGER                                       :: iflavor1
1848   INTEGER                                       :: iflavor2
1849   INTEGER                                       :: flavors
1850 
1851   IF ( .NOT. ALLOCATED(this%particles) ) &
1852     CALL ERROR("ImpurityOperator_measD : no particle set   ")
1853 
1854   totalE = 0.d0
1855   flavors = this%flavors
1856   DO iflavor1 = 1, flavors
1857     DO iflavor2 = iflavor1+1, flavors
1858       !localD = ImpurityOperator_overlapIJ(this,iflavor1,iflavor2) 
1859       localD = this%overlaps(iflavor2,iflavor1)
1860       DE(iflavor2,iflavor1) = DE(iflavor2,iflavor1) + localD  
1861       totalE = totalE + localD * this%mat_U(iflavor1,iflavor2)
1862     END DO
1863   END DO
1864 
1865   DE(1,1) = DE(1,1) + totalE
1866 
1867 END SUBROUTINE ImpurityOperator_measDE

ABINIT/m_ImpurityOperator/ImpurityOperator_measN [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_measN

FUNCTION

  measure the number of electrons on flavor flavor

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  flavor=the flavor

OUTPUT

  ImpurityOperator_measN=number of electrons

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

1961 DOUBLE PRECISION FUNCTION ImpurityOperator_measN(this,flavor)
1962 
1963 !Arguments ------------------------------------
1964 
1965 !This section has been created automatically by the script Abilint (TD).
1966 !Do not modify the following lines by hand.
1967 #undef ABI_FUNC
1968 #define ABI_FUNC 'ImpurityOperator_measN'
1969 !End of the abilint section
1970 
1971   TYPE(ImpurityOperator), INTENT(IN) :: this
1972   INTEGER,      OPTIONAL, INTENT(IN) :: flavor
1973 !Local variables ------------------------------
1974   DOUBLE PRECISION                   :: totalCdag
1975   DOUBLE PRECISION                   :: totalC
1976   INTEGER                            :: scanning
1977   INTEGER                            :: aF
1978 
1979   IF ( PRESENT(flavor) ) THEN
1980     aF = flavor
1981   ELSE
1982     aF = this%activeFlavor
1983   END IF
1984 
1985   IF ( aF .LE. 0 ) & 
1986     CALL ERROR("ImpurityOperator_measN : no active flavor     ")
1987 
1988   totalC    = (this%particles(aF)%list(0,Cdag_) - this%particles(aF)%list(0,C_) + this%beta) * .5d0 
1989   totalCdag = 0.d0
1990 
1991   DO scanning = 1, this%particles(aF)%tail
1992     totalCdag = totalCdag + this%particles(aF)%list(scanning,Cdag_)
1993     totalC    = totalC    + this%particles(aF)%list(scanning,C_   )
1994   END DO
1995 
1996   ImpurityOperator_measN = totalC - totalCdag
1997 
1998 END FUNCTION ImpurityOperator_measN

ABINIT/m_ImpurityOperator/ImpurityOperator_overlapFlavor [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_overlapFlavor

FUNCTION

  Returns the overlap of flavor with the others

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  flavor=the one we want

OUTPUT

  ImpurityOperator_overlapFlavor=result

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

1552 DOUBLE PRECISION FUNCTION ImpurityOperator_overlapFlavor(this,flavor)
1553 
1554 !Arguments ------------------------------------
1555 
1556 !This section has been created automatically by the script Abilint (TD).
1557 !Do not modify the following lines by hand.
1558 #undef ABI_FUNC
1559 #define ABI_FUNC 'ImpurityOperator_overlapFlavor'
1560 !End of the abilint section
1561 
1562   TYPE(ImpurityOperator), INTENT(IN) :: this
1563   INTEGER,      OPTIONAL, INTENT(IN) :: flavor
1564 !Local variables ------------------------------
1565   INTEGER                            :: otherFlavor
1566   DOUBLE PRECISION                   :: overlap
1567   DOUBLE PRECISION                   :: totalOverlap
1568 
1569   totalOverlap = 0.d0
1570   DO otherFlavor = 1, this%flavors
1571     IF ( otherFlavor .EQ. flavor ) CYCLE
1572     overlap = this%overlaps(otherFlavor,flavor)
1573     totalOverlap = totalOverlap &
1574                  + overlap * this%mat_U(otherFlavor,flavor)
1575   END DO
1576 
1577   ImpurityOperator_overlapFlavor = totalOverlap
1578 
1579 END FUNCTION ImpurityOperator_overlapflavor

ABINIT/m_ImpurityOperator/ImpurityOperator_overlapIJ [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_overlapIJ

FUNCTION

  Compute overlap between two flavors

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  i=first flavor
  j=second flavor

OUTPUT

  ImpurityOperator_overlapIJ=result

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

1758 DOUBLE PRECISION FUNCTION ImpurityOperator_overlapIJ(this,i,j)
1759 
1760 !Arguments ------------------------------------
1761 
1762 !This section has been created automatically by the script Abilint (TD).
1763 !Do not modify the following lines by hand.
1764 #undef ABI_FUNC
1765 #define ABI_FUNC 'ImpurityOperator_overlapIJ'
1766 !End of the abilint section
1767 
1768   TYPE(ImpurityOperator), INTENT(INOUT) :: this
1769   INTEGER               , INTENT(IN) :: i
1770   INTEGER               , INTENT(IN) :: j
1771 !Local variables ------------------------------
1772 !  TYPE(ListCdagC)       , POINTER    :: particle1 => NULL()
1773 !  DOUBLE PRECISION, DIMENSION(:,:), POINTER :: list1 => NULL()
1774   INTEGER                            :: tail1
1775   DOUBLE PRECISION, DIMENSION(1:2)   :: CdagC_1
1776   INTEGER                            :: isegment
1777 
1778 !  particle1 => this%particles(i) 
1779 !  list1     => particle1%list
1780   tail1 = this%particles(i)%tail
1781 
1782   ImpurityOperator_overlapIJ = 0.d0
1783   IF ( tail1 .EQ. 0 .AND. this%particles(i)%list(0,C_) .EQ. 0.d0 ) THEN ! FULL
1784 !    CALL CdagC_init(CdagC_1,0.d0,this%beta)
1785     CdagC_1(Cdag_) = 0.d0
1786     CdagC_1(C_   ) = this%beta
1787 
1788     ImpurityOperator_overlapIJ = ImpurityOperator_overlapSegFlav(this,CdagC_1,j)
1789   ELSE IF ( tail1 .GT. 0) THEN
1790     this%activeFlavor = i
1791     DO isegment = 1, tail1
1792         CdagC_1(:) = this%particles(i)%list(isegment,1:2)
1793         ImpurityOperator_overlapIJ = ImpurityOperator_overlapIJ &
1794                    + ImpurityOperator_overlapSegFlav(this,CdagC_1,j)
1795     END DO
1796   END IF
1797 
1798 END FUNCTION ImpurityOperator_overlapIJ

ABINIT/m_ImpurityOperator/ImpurityOperator_overlapSegFlav [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_overlapSegFlav

FUNCTION

  Compute the overlap of a segment with a flavor

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  CdagC_1=segment
  flavor=flavor to use

OUTPUT

  ImpurityOperator_overlapSegFlav=overlap between CdagC_1 and flavor

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

1372 DOUBLE PRECISION FUNCTION ImpurityOperator_overlapSegFlav(this,CdagC_1,flavor)
1373 
1374 !Arguments ------------------------------------
1375 
1376 !This section has been created automatically by the script Abilint (TD).
1377 !Do not modify the following lines by hand.
1378 #undef ABI_FUNC
1379 #define ABI_FUNC 'ImpurityOperator_overlapSegFlav'
1380 !End of the abilint section
1381 
1382   TYPE(ImpurityOperator), INTENT(INOUT) :: this
1383 !  TYPE(CdagC)           , INTENT(IN) :: CdagC_1
1384   DOUBLE PRECISION, DIMENSION(1:2), INTENT(IN) :: CdagC_1
1385   INTEGER               , INTENT(IN) :: flavor
1386 !Local variables ------------------------------
1387 !  TYPE(CdagC), DIMENSION(:), POINTER :: list => NULL()
1388   DOUBLE PRECISION                   :: totalCdag
1389   DOUBLE PRECISION                   :: totalC
1390   DOUBLE PRECISION                   :: beta
1391   DOUBLE PRECISION                   :: Time
1392   DOUBLE PRECISION                   :: Tmin
1393   DOUBLE PRECISION                   :: Tmax
1394   DOUBLE PRECISION                   :: TmaxBeta
1395   DOUBLE PRECISION                   :: TscanMin
1396   DOUBLE PRECISION                   :: TscanMax
1397 !  DOUBLE PRECISION                   :: sign
1398   DOUBLE PRECISION                   :: C
1399   DOUBLE PRECISION                   :: Cdag
1400   DOUBLE PRECISION                   :: loop
1401   DOUBLE PRECISION                   :: itmin
1402   DOUBLE PRECISION                   :: itmax
1403   INTEGER                            :: tail
1404   INTEGER                            :: tp1
1405   INTEGER                            :: scanning 
1406   INTEGER                            :: imin 
1407   INTEGER                            :: imax 
1408   INTEGER                            :: loops
1409   INTEGER                            :: iloop
1410 #include "ListCdagC_firstHigher.h"
1411 
1412   beta = this%beta
1413   Tmin = CdagC_1(Cdag_)
1414   Tmax = CdagC_1(C_)
1415   itmin= 0.d0
1416 
1417 !  TmaxBeta     = Tmax.MOD.beta
1418   MODCYCLE(Tmax,beta,TmaxBeta)
1419 
1420   tail = this%particles(flavor)%tail
1421 
1422   totalC = 0.d0
1423   totalCdag = 0.d0
1424   IF ( tail .NE. 0 ) THEN
1425     tp1  = tail + 1
1426     loop = 0.d0
1427 !    imin = ListCdagC_firstHigher( this%particles(flavor), Tmin ) - 1
1428     Time = Tmin
1429 #define list_1 this%particles(flavor) 
1430 #include "ListCdagC_firstHigher"
1431     imin = firstHigher - 1
1432 
1433     SELECT CASE ( imin ) 
1434       CASE(0)
1435         scanning = tail
1436         loop = -1.d0
1437       CASE(-2)
1438         scanning = tail
1439       CASE DEFAULT
1440         scanning = imin
1441     END SELECT
1442 !    imax = ListCdagC_firstHigher( this%particles(flavor), TmaxBeta ) !- 1 Jamais atteint
1443     Time = TmaxBeta
1444 #include "ListCdagC_firstHigher"
1445 #undef list_1
1446     imax = firstHigher
1447 
1448     TscanMin = Tmin
1449     TscanMax = Tmax
1450 
1451     ! Regarder avant 
1452     IF ( (imin .EQ. 0) ) THEN
1453       C = this%particles(flavor)%list(scanning,C_) +loop*  beta
1454       Cdag = this%particles(flavor)%list(scanning,Cdag_) +loop* beta
1455       itmax = MAX(TscanMin, Cdag)
1456       itmin = MIN(TscanMax, C   )
1457 
1458       IF ( itmin .GT. itmax ) THEN ! si egal alors overlap de 0
1459         totalC = totalC + itmin
1460         totalCdag = totalCdag + itmax
1461       END IF
1462       scanning = scanning+1
1463       IF ( scanning .EQ. tp1 ) THEN
1464         scanning = 1
1465       END IF
1466     END IF
1467 
1468     loops = imax - scanning
1469     IF ( TmaxBeta .NE. Tmax ) THEN
1470       loops = tail - loops
1471     ELSE IF ( imax .EQ. -1 ) THEN
1472       loops = tail - imin
1473     END IF
1474 
1475     !Comparer betement 2 segments
1476     DO iloop =0, loops
1477       C = this%particles(flavor)%list(scanning,C_)
1478       Cdag = this%particles(flavor)%list(scanning,Cdag_)
1479       itmax = MAX(TscanMin, Cdag)
1480       itmin = MIN(TscanMax,C)
1481 
1482       IF ( itmin .GT. itmax ) THEN ! si egal alors overla de 0
1483         totalC = totalC + itmin
1484         totalCdag = totalCdag + itmax
1485       END IF
1486       scanning = scanning + 1
1487       IF ( scanning .EQ. tp1 ) THEN
1488         scanning = 1
1489         IF ( itmin .EQ. TScanMax ) EXIT
1490         TscanMin = TscanMin - beta
1491         TscanMax = TscanMax - beta
1492       END IF
1493     END DO
1494 
1495     ! Regarder apres le segment
1496     IF ( (itmin .NE. TscanMax) ) THEN
1497       C = this%particles(flavor)%list(scanning,C_)
1498       Cdag = this%particles(flavor)%list(scanning,Cdag_) 
1499       itmax = MAX(TscanMin, Cdag)
1500       itmin = MIN(TscanMax,C)
1501 
1502       IF ( itmin .GT. itmax ) THEN ! si egal alors overla de 0
1503         totalC = totalC + itmin
1504         totalCdag = totalCdag + itmax
1505       END IF
1506     END IF
1507   ELSE IF ( this%particles(flavor)%list(0,C_) .EQ. 0.d0 ) THEN ! full orbital
1508       totalC    = Tmax
1509       totalCdag = Tmin
1510   END IF
1511 !#ifdef CTQMC_CHECK
1512   IF ( this%doCheck .EQV. .TRUE. ) &
1513     CALL ImpurityOperator_checkOverlap(this, Tmin, Tmax,totalC-totalCdag,flavor)
1514 !#endif
1515   ImpurityOperator_overlapSegFlav = totalC - totalCdag 
1516 
1517 END FUNCTION ImpurityOperator_overlapSegFlav

ABINIT/m_ImpurityOperator/ImpurityOperator_overlapSwap [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_overlapSwap

FUNCTION

  compute the overlap of flavor1 with the configuration of flavor2

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  flavor1=interaction value
  flavor2=configuration

OUTPUT

  ImpurityOperator_overlapSwap=new overlap

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

1615 DOUBLE PRECISION FUNCTION ImpurityOperator_overlapSwap(this,flavor1,flavor2)
1616 
1617 !Arguments ------------------------------------
1618 
1619 !This section has been created automatically by the script Abilint (TD).
1620 !Do not modify the following lines by hand.
1621 #undef ABI_FUNC
1622 #define ABI_FUNC 'ImpurityOperator_overlapSwap'
1623 !End of the abilint section
1624 
1625   TYPE(ImpurityOperator), INTENT(IN) :: this
1626   INTEGER               , INTENT(IN) :: flavor1
1627   INTEGER               , INTENT(IN) :: flavor2
1628 !Local variables ------------------------------
1629   INTEGER                            :: otherFlavor
1630   DOUBLE PRECISION                   :: overlap
1631   DOUBLE PRECISION                   :: totalOverlap
1632 
1633   totalOverlap = 0.d0
1634 ! Calcul l'overlap de flavor1 en utilisant la configuration de flavor2
1635   DO otherFlavor = 1, this%flavors
1636     IF ( otherFlavor .EQ. flavor2 ) THEN
1637       CYCLE
1638     ELSE IF ( otherFlavor .EQ. flavor1 ) THEN
1639       overlap = this%overlaps(otherFlavor,flavor2)
1640       totalOverlap = totalOverlap &
1641                    + overlap * this%mat_U(otherFlavor,flavor2)
1642     ELSE
1643       overlap = this%overlaps(otherFlavor,flavor2)
1644       totalOverlap = totalOverlap &
1645                    + overlap * this%mat_U(otherFlavor,flavor1)
1646     END IF
1647   END DO
1648 
1649   ImpurityOperator_overlapSwap = totalOverlap
1650 
1651 END FUNCTION ImpurityOperator_overlapSwap

ABINIT/m_ImpurityOperator/ImpurityOperator_printLatex [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_printLatex

FUNCTION

  print in a latex format all the configuration

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  ostream=file stream
  isweep=current sweep number

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

2402 SUBROUTINE ImpurityOperator_printLatex(this, ostream, isweep)
2403 
2404 !Arguments ------------------------------------
2405 
2406 !This section has been created automatically by the script Abilint (TD).
2407 !Do not modify the following lines by hand.
2408 #undef ABI_FUNC
2409 #define ABI_FUNC 'ImpurityOperator_printLatex'
2410 !End of the abilint section
2411 
2412   TYPE(ImpurityOperator), INTENT(IN) :: this
2413   INTEGER               , INTENT(IN) :: ostream
2414   INTEGER               , INTENT(IN) :: isweep
2415 !Local variables ------------------------------
2416   INTEGER                            :: flavors
2417   INTEGER                            :: iflavor
2418   INTEGER                            :: tail
2419   INTEGER                            :: it
2420   DOUBLE PRECISION                   :: C
2421   DOUBLE PRECISION                   :: Cdag
2422   INTEGER                            :: ordo
2423   INTEGER                            :: y
2424   INTEGER                            :: lines
2425   INTEGER                            :: letters
2426   DOUBLE PRECISION                   :: length
2427 
2428   flavors = this%flavors
2429 
2430   WRITE(ostream,'(A13)')    "\begin{frame}"
2431   WRITE(ostream,'(2x,A14)') "\begin{figure}"
2432   WRITE(ostream,'(4x,A28)') "\setlength{\unitlength}{1mm}"
2433   WRITE(ostream,'(4x,A23)') "\begin{picture}(104,90)"
2434   WRITE(ostream,'(6x,A29,I6,A2)') "\put(52,00){\makebox(0,0)[c]{",isweep,"}}"
2435   y = INT(90.d0/DBLE(flavors+1))
2436   DO iflavor = 1, flavors
2437     tail =  this%particles(iflavor)%tail
2438     ordo = iflavor * y
2439     lines = ordo - 1
2440     letters = ordo - 5
2441     WRITE(ostream,'(6x,A6,I2)') "%ligne", iflavor
2442     WRITE(ostream,'(6x,A41,I2,A16)') "\linethickness{0.5pt}\color{black}\put(2,",lines,"){\line(0,1){2}}"
2443     WRITE(ostream,'(6x,A7,I2,A24)')  "\put(2,",letters,"){\makebox(0,0)[c]{$0$}}"
2444     WRITE(ostream,'(6x,A7,I2,A18)')  "\put(2,",ordo,"){\line(1,0){100}}"
2445     WRITE(ostream,'(6x,A9,I2,A16)')  "\put(102,",lines,"){\line(0,1){2}}"
2446     WRITE(ostream,'(6x,A9,I2,A28)')  "\put(102,",letters,"){\makebox(0,0)[c]{$\beta$}}"
2447     DO it = 1, tail 
2448       Cdag = 2.d0+(this%particles(iflavor)%list(it,Cdag_)/this%beta*100.d0)
2449       C    = 2.d0+(this%particles(iflavor)%list(it,C_   )/this%beta*100.d0)
2450       length = C - Cdag
2451       IF ( this%particles(iflavor)%list(it,C_) .LE. this%beta ) THEN
2452         WRITE(ostream,'(8x,A9,I2)')             "%segments", it
2453         WRITE(ostream,'(8x,A37,F5.1,A1,I2,A13,F5.1,A2)') &
2454         "\linethickness{2pt}\color{black}\put(",Cdag,",",ordo,"){\line(1,0){",length,"}}"
2455         WRITE(ostream,'(8x,A5)')                "%Cdag"
2456         WRITE(ostream,'(8x,A12)')               "\color{blue}"
2457         WRITE(ostream,'(8x,A5,F5.1,A1,I2,A14)') "\put(",Cdag,",",ordo,"){\circle*{1}}"
2458         WRITE(ostream,'(8x,A2)')                "%C"
2459         WRITE(ostream,'(8x,A11)')               "\color{red}"
2460         WRITE(ostream,'(8x,A5,F5.1,A1,I2,A14)') "\put(",C,",",ordo,"){\circle*{1}}"
2461       ELSE
2462         WRITE(ostream,'(8x,A9,I2)')             "%segments", it
2463         WRITE(ostream,'(8x,A37,F5.1,A1,I2,A13,F5.1,A2)') &
2464         "\linethickness{2pt}\color{black}\put(",Cdag,",",ordo,"){\line(1,0){",102.d0-Cdag,"}}"
2465         WRITE(ostream,'(8x,A7,I2,A13,F5.1,A2)') "\put(2,",ordo,"){\line(1,0){",C-102.d0,"}}"
2466         WRITE(ostream,'(8x,A5)')                "%Cdag"
2467         WRITE(ostream,'(8x,A12)')               "\color{blue}"
2468         WRITE(ostream,'(8x,A5,F5.1,A1,I2,A14)') "\put(",Cdag,",",ordo,"){\circle*{1}}"
2469         WRITE(ostream,'(8x,A2)')                "%C"
2470         WRITE(ostream,'(8x,A11)')               "\color{red}"
2471         WRITE(ostream,'(8x,A5,F5.1,A1,I2,A14)') "\put(",C-100.d0,",",ordo,"){\circle*{1}}"
2472       END IF
2473     END DO
2474     IF ( tail .EQ. 0 .AND. this%particles(iflavor)%list(0,C_) .EQ. 0.d0 ) THEN 
2475       WRITE(ostream,'(8x,A9,I2)')      "%segments", it
2476       WRITE(ostream,'(8x,A39,I2,A18)') "\linethickness{2pt}\color{black}\put(2,",ordo,"){\line(1,0){100}}"
2477     END IF
2478   END DO
2479   WRITE(ostream,'(4x,A13)') "\end{picture}"
2480   WRITE(ostream,'(2x,A12)') "\end{figure}"
2481   WRITE(ostream,'(2x,A17)') "\transduration{0}"
2482   WRITE(ostream,'(A11)')    "\end{frame}"
2483 END SUBROUTINE ImpurityOperator_printLatex

ABINIT/m_ImpurityOperator/ImpurityOperator_remove [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_remove

FUNCTION

  Remove a segment for the active flavor

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurityOperator
  ieme=segment to remove

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

918 SUBROUTINE ImpurityOperator_remove(this,ieme)
919 
920 !Arguments ------------------------------------
921 
922 !This section has been created automatically by the script Abilint (TD).
923 !Do not modify the following lines by hand.
924 #undef ABI_FUNC
925 #define ABI_FUNC 'ImpurityOperator_remove'
926 !End of the abilint section
927 
928   TYPE(ImpurityOperator), INTENT(INOUT) :: this
929   INTEGER               , INTENT(IN   ) :: ieme
930 !Local variables ------------------------------
931   DOUBLE PRECISION, DIMENSION(1:2)      :: CdagC_1
932   INTEGER                               :: position
933   INTEGER                               :: position_dwn
934   INTEGER                               :: i
935   INTEGER                               :: tail
936   INTEGER                               :: aF
937 !  DOUBLE PRECISION                      :: toRemove
938 
939   aF = this%activeFlavor
940   IF ( aF .LE. 0 ) &
941     CALL ERROR("ImpurityOperator_removeIeme : no active flavor    ")
942   position = ABS(ieme)
943   IF ( position .GT. this%particles(aF)%tail ) &
944     CALL ERROR("ImpurityOperator_removeIeme : out of range        ")
945 
946   IF ( (ieme .LT. 0)  .AND. (this%particles(aF)%tail .GT. 1) ) THEN 
947     position_dwn = position
948 !    position = (position+1).MOD.this%particles(aF)%tail
949     tail = this%particles(aF)%tail
950     MODCYCLE((position+1),tail,position)
951     CdagC_1(Cdag_) = this%particles(aF)%list(position_dwn,Cdag_)
952     CdagC_1(C_   ) = this%particles(aF)%list(position,C_)
953     IF (position_dwn .GT. position) CdagC_1(C_) = CdagC_1(C_) + this%beta
954 !    toRemove  = this%particles(aF)%list(position)%C - (CdagC_1%C.MOD.this%beta)
955 !    CdagC_1%C = CdagC_1%C + toRemove  
956     this%particles(aF)%list(position_dwn,:) = CdagC_1
957   END IF
958 
959   IF ( position .EQ. 1 ) THEN
960     SELECT CASE (ieme)
961       CASE (1) 
962         this%particles(aF)%list(0,C_   ) = this%beta
963         this%particles(aF)%list(0,Cdag_) = 0.d0 
964       CASE (-1)
965         this%particles(aF)%list(0,C_   ) = 0.d0 
966         this%particles(aF)%list(0,Cdag_) = this%beta
967     END SELECT
968   END IF
969   CALL ListCdagC_erase(this%particles(aF),position)
970   DO i = 1, this%flavors
971     this%overlaps(i,aF) = this%overlaps(i,aF) - this%updates(i)
972     this%overlaps(aF,i) = this%overlaps(i,aF)
973   END DO
974 END SUBROUTINE ImpurityOperator_remove

ABINIT/m_ImpurityOperator/ImpurityOperator_reset [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_reset

FUNCTION

  reset operator

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurtiyOperator

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

244 SUBROUTINE ImpurityOperator_reset(this)
245 
246 !Arguments ------------------------------------
247 
248 !This section has been created automatically by the script Abilint (TD).
249 !Do not modify the following lines by hand.
250 #undef ABI_FUNC
251 #define ABI_FUNC 'ImpurityOperator_reset'
252 !End of the abilint section
253 
254   TYPE(ImpurityOperator), INTENT(INOUT) :: this
255 !Local variables ------------------------------
256   INTEGER                               :: IT
257 
258   this%activeFlavor = 0
259   this%overlaps = 0.d0
260   this%updates = 0.d0
261 !#ifdef CTQMC_CHECK
262   this%meanError    = 0.d0
263   this%checkNumber  = 0.d0
264   this%tolerance    = 0.d0
265   this%doCheck      = .FALSE.
266 !#endif
267   DO IT = 1,this%flavors
268     CALL ListCdagC_clear(this%particles(IT)) 
269     this%particles(IT)%list(0,C_   )    = this%beta ! Empty orbital 
270     this%particles(IT)%list(0,Cdag_) = 0.d0
271 !    this%particles(IT)%list(0)%Cdag = beta ! Full orbital 
272 !    this%particles(IT)%list(0)%C    = 0.d0
273   END DO
274 
275 END SUBROUTINE ImpurityOperator_reset

ABINIT/m_ImpurityOperator/ImpurityOperator_setMu [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_setMu

FUNCTION

  Set directly the chemical potential

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurtityOperator
  mu=chimical potential

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

448 SUBROUTINE ImpurityOperator_setMu(this, mu)
449 
450 !Arguments ------------------------------------
451 
452 !This section has been created automatically by the script Abilint (TD).
453 !Do not modify the following lines by hand.
454 #undef ABI_FUNC
455 #define ABI_FUNC 'ImpurityOperator_setMu'
456 !End of the abilint section
457 
458   TYPE(ImpurityOperator), INTENT(INOUT) :: this
459   DOUBLE PRECISION, DIMENSION(:), INTENT(IN   ) :: mu
460   INTEGER :: iflavor
461 
462   IF ( SIZE(mu) .NE. this%flavors ) &
463     CALL ERROR("ImpurityOperator_setMu : Wrong chimical potentials")
464 
465   DO iflavor = 1, this%flavors
466     this%mat_U(iflavor,iflavor) = mu(iflavor)
467   END DO
468 END SUBROUTINE ImpurityOperator_setMu

ABINIT/m_ImpurityOperator/ImpurityOperator_setUmat [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_setUmat

FUNCTION

  Set directly the U interaction this

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurtityOperator
  matU=interaction this

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

390 SUBROUTINE ImpurityOperator_setUmat(this, matU)
391 
392 !Arguments ------------------------------------
393 
394 !This section has been created automatically by the script Abilint (TD).
395 !Do not modify the following lines by hand.
396 #undef ABI_FUNC
397 #define ABI_FUNC 'ImpurityOperator_setUmat'
398 !End of the abilint section
399 
400   TYPE(ImpurityOperator), INTENT(INOUT) :: this
401   DOUBLE PRECISION, DIMENSION(:,:), INTENT(IN   ) :: matU
402   INTEGER :: iflavor1
403   INTEGER :: iflavor2
404 
405   IF ( SIZE(matU) .NE. this%flavors*this%flavors ) &
406     CALL ERROR("ImpurityOperator_setUmat : Wrong interaction this")
407 
408   DO iflavor1 = 1, this%flavors
409     DO iflavor2 = iflavor1+1, this%flavors
410       this%mat_U(iflavor1,iflavor2) = matU(iflavor1,iflavor2)
411       this%mat_U(iflavor2,iflavor1) = matU(iflavor2,iflavor1)
412     END DO
413   END DO
414 END SUBROUTINE ImpurityOperator_setUmat

ABINIT/m_ImpurityOperator/ImpurityOperator_swap [ Functions ]

[ Top ] [ Functions ]

NAME

  ImpurityOperator_swap

FUNCTION

  Swap to flavors

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=ImpurtiyOperator
  flavor1=to swap
  flavor2=to swap

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

1686 SUBROUTINE ImpurityOperator_swap(this,flavor1, flavor2)
1687 
1688 !Arguments ------------------------------------
1689 
1690 !This section has been created automatically by the script Abilint (TD).
1691 !Do not modify the following lines by hand.
1692 #undef ABI_FUNC
1693 #define ABI_FUNC 'ImpurityOperator_swap'
1694 !End of the abilint section
1695 
1696   TYPE(ImpurityOperator), INTENT(INOUT) :: this
1697   INTEGER               , INTENT(IN   ) :: flavor1
1698   INTEGER               , INTENT(IN   ) :: flavor2
1699 !Local variables ------------------------------
1700   INTEGER                               :: iflavor
1701   DOUBLE PRECISION                      :: overlap_tmp
1702 
1703   DO iflavor = 1, this%flavors
1704     IF ( iflavor .NE. flavor1  .AND. iflavor .NE. flavor2) THEN
1705       overlap_tmp = this%overlaps(iflavor,flavor1)
1706       this%overlaps(iflavor,flavor1) = this%overlaps(iflavor,flavor2)
1707       this%overlaps(flavor1,iflavor) = this%overlaps(iflavor,flavor2)
1708       this%overlaps(iflavor,flavor2) = overlap_tmp
1709       this%overlaps(flavor2,iflavor) = overlap_tmp
1710     END IF
1711   END DO
1712 
1713   !CALL ListCdagC_print(this%particles(flavor1),233)
1714   !CALL ListCdagC_print(this%particles(flavor2),233)
1715   CALL ListCdagC_assign(this%list_swap, this%particles(flavor1)) !list_swap = particle
1716   this%particles(flavor1) = this%particles(flavor2)
1717   this%particles(flavor2) = this%list_swap
1718   !CALL ListCdagC_swap(this%particles(flavor1),this%particles(flavor2))
1719   !CALL ListCdagC_print(this%particles(flavor1),233)
1720   !CALL ListCdagC_print(this%particles(flavor2),233)
1721 
1722 END SUBROUTINE ImpurityOperator_swap

m_ImpurityOperator/ImpurityOperator [ Types ]

[ Top ] [ m_ImpurityOperator ] [ Types ]

NAME

  ImpurityOperator

FUNCTION

  This structured datatype contains the necessary data

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

SOURCE

53 TYPE, PUBLIC :: ImpurityOperator
54   LOGICAL          _PRIVATE :: doCheck = .FALSE.
55   INTEGER          _PRIVATE :: flavors
56    !  Number of flavors
57   INTEGER                   :: activeFlavor
58    !  Flavor considered e.g when a segment is added
59 
60 
61   DOUBLE PRECISION _PRIVATE          :: beta
62    !  Inverse of temperature.
63 
64   DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:)          :: mat_U 
65    !  for iflavor1 and iflavor2, mat_U(iflavor1,iflavor2) is the
66    !  coulomb interaction between iflavor1 and iflavor2.
67 
68 
69   DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:) _PRIVATE :: overlaps   ! total overlaps
70    !  for iflavor1 and iflavor2 overlaps(iflavor1,iflavor2) is the total
71    !  overlap between segments of iflavor1 and segments of iflavor2.
72 
73   DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:  ) _PRIVATE :: updates    ! new_(anti)seg 
74    !  For a given flavor (activeflavor), gives for each other flavors, the
75    !  supplementary overlaps, called updates(otherflavor).
76 
77   TYPE(ListCdagC)                               _PRIVATE :: list_swap
78   TYPE(ListCdagC) , ALLOCATABLE, DIMENSION(:  )          :: particles 
79    !  for each flavor, particles(iflavor)%list(2,maxnbofsegment) 
80    !  gives the beginning and end of each segment.
81 
82   DOUBLE PRECISION _PRIVATE :: checkNumber
83   DOUBLE PRECISION _PRIVATE :: tolerance
84   DOUBLE PRECISION _PRIVATE :: meanError
85 END TYPE ImpurityOperator