Example #1
0
e_f, Beta = -U / 2.0, 50

# The impurity solver
S = Solver(
    Beta=Beta,  # inverse temperature
    GFstruct=[('up', [1]),
              ('down', [1])],  # Structure of the Green's function 
    H_Local=U * N('up', 1) * N('down', 1),  # Local Hamiltonian 
    Quantum_Numbers={  # Quantum Numbers 
        'Nup': N('up', 1),  # (operators commuting with H_Local) 
        'Ndown': N('down', 1)
    },
    N_Cycles=500000,  # Number of QMC cycles
    Length_Cycle=200,  # Length of one cycle 
    N_Warmup_Cycles=10000,  # Warmup cycles
    N_Legendre_Coeffs=50,  # Number of Legendre coefficients
    Random_Generator_Name='mt19937',  # Name of the random number generator
    Use_Segment_Picture=True,  # Use the segment picture
    Measured_Operators={  # Operators to be averaged
        'Nimp': N('up', 1) + N('down', 1)
    },
    Global_Moves=[  # Global move in the QMC
        (0.05, lambda (a, alpha, dag): ({
            'up': 'down',
            'down': 'up'
        }[a], alpha, dag))
    ],
)

# Initialize the non-interacting Green's function S.G0
for spin, g0 in S.G0:
Example #2
0
U = 2.5
Chemical_Potential = U / 2.0
Beta = 100
N_loops = 5

# Construct a CTQMC solver
from pytriqs.Solvers.Operators import *  # imports the class manipulating C, C_dagger and N = C_dagger C
from pytriqs.Solvers.HybridizationExpansion import Solver  # imports the solver class
S = Solver(
    Beta=Beta,  # inverse temperature
    GFstruct=[('up', [1]), ('down', [1])],  # Structure of the Green function 
    H_Local=U * N('up', 1) * N('down', 1),  # Local Hamiltonian 
    Quantum_Numbers={
        'Nup': N('up', 1),
        'Ndown': N('down', 1)
    },  # Quantum Numbers (operators commuting with H_Local)
    N_Cycles=5000,  # Number of QMC cycles
    Length_Cycle=200,  # Length of a cycle
    N_Warmup_Cycles=1000,  # How many warmup cycles
    N_Legendre_Coeffs=30,  # Use 30 Legendre coefficients to represent G(tau)
    Random_Generator_Name=
    "mt19937",  # Use the Mersenne Twister 19937 random generator
    Use_Segment_Picture=True)  # Here we can use the segment picture

# Initalize the Green's function to a semi circular
S.G <<= SemiCircular(Half_Bandwidth)

# Now do the DMFT loop
for IterationNumber in range(N_loops):

    # Compute S.G0 with the self-consistency condition while imposing paramagnetism
Example #3
0
Chemical_Potential = U / 2.0
Beta = 100

# Construct a CTQMC solver
from pytriqs.Solvers.Operators import *  # imports the class manipulating C, C_dagger and N = C_dagger C
from pytriqs.Solvers.HybridizationExpansion import Solver  # imports the solver class

S = Solver(
    Beta=Beta,  # inverse temperature
    GFstruct=[('up', [1]), ('down', [1])],  # Structure of the Green function 
    H_Local=U * N('up', 1) * N('down', 1),  # Local Hamiltonian 
    Quantum_Numbers={
        'Nup': N('up', 1),
        'Ndown': N('down', 1)
    },  # Quantum Numbers (operators commuting with H_Local)
    N_Cycles=
    5000,  #200000,                                         # Number of QMC cycles
    Length_Cycle=500,
    N_Warmup_Cycles=5000,
    N_Time_Slices_Delta=10000,
    N_Time_Slices_Gtau=1000,
    Random_Generator_Name="",
    N_Legendre_Coeffs=30,
    #Random_Generator_Name = "mt19937",
    Use_Segment_Picture=True)

#S.Proba_Move = 0.0
#S.Global_Moves =  [ (0.01,  lambda (a,alpha,dag) : (a, alpha, dag)),
#                   (0.01,  lambda (a,alpha,dag) : ({'up' : 'down', 'down' : 'up'}[a], alpha, dag)) ]

# init the Green function
#S.G <<= GF_Initializers.SemiCircular(Half_Bandwidth)
Example #4
0
from pytriqs.Base.GF_Local import *
from pytriqs.Solvers.Operators import *
from pytriqs.Solvers.HybridizationExpansion import Solver

D, V, U = 1.0, 0.2, 4.0
e_f, Beta = -U/2.0, 50

# The impurity solver
S = Solver(Beta = Beta,                             # inverse temperature
           GFstruct = [ ('up',[1]), ('down',[1]) ], # Structure of the Green's function 
           H_Local = U * N('up',1) * N('down',1),   # Local Hamiltonian 
           Quantum_Numbers = {                      # Quantum Numbers 
               'Nup' : N('up',1),                   # (operators commuting with H_Local) 
               'Ndown' : N('down',1) },          
           N_Cycles = 100000,                       # Number of QMC cycles
           Length_Cycle = 200,                      # Length of one cycle 
           N_Warmup_Iteration = 10000,              # Warmup cycles
           Use_Segment_Picture = True,              # Use the segment picture
           Global_Moves = [                         # Global move in the QMC
               (0.05, lambda (a,alpha,dag) : ( {'up':'down','down':'up'}[a],alpha,dag ) ) ], 
           )

from pytriqs.Base.Archive import HDF_Archive
import pytriqs.Base.Utility.MPI as MPI

for random_name in ['mt11213b','lagged_fibonacci607']:

  # Solve using random_name as a generator
  S.Random_Generator_Name = random_name
  for spin, g0 in S.G0 :
    g0 <<= inverse( iOmega_n - e_f - V**2 * Wilson(D) )