Cluster Dynamical Mean Field Theory

This submodule provides functions that perform the CDMFT algorithm. The class CDMFT contains the CDMFT algorithm per se and implements it. Some auxiliary classes are also defined:

  • convergence_manager defines a test for assessing convergence of the CDMFT procedure

  • frequency_grid defines a grid of imaginary frequencies for computing the CDMFT distance function.

  • hybridization defines the hybridization function, mostly for import/export.

  • general_bath defines general cluster models with bath, with automatic bath parameter definitions, etc.

  • observable defines quantities that can be used to assess the convergence of the CDMFT procedure, if the latter is not base on the bath parameters themselves

class CDMFT(model, varia, beta=50, wc=2.0, grid_type='sharp', maxiter=32, miniter=0, convergence='parameters', depth=2, accur_bath=0.001, accur=0.0001, accur_dist=1e-09, converge_with_stdev=False, alpha=0.0, method='Nelder-Mead', file='cdmft.tsv', averages=False, eps_algo=0, initial_step=0.1, hartree=None, SEF=False, check_ground_state=False, max_function_eval=500000, compute_potential_energy=False, host_function=None, pre_host=None, max_value=100)

class containing the elements of a CDMFT computation. The constructor executes the computation.

Parameters:
  • varia ([str]) – list of variational parameters OR tuple of two lists : bath energies and bath hybridizations OR function that returns dicts of bath energies and bath hybridizations given numeric arrays

  • beta (float) – inverse fictitious temperature (for the frequency grid)

  • wc (float) – cutoff frequency (for the frequency grid)

  • grid_type (str) – type of frequency grid along the imaginary axis : ‘sharp’, ‘ifreq’, ‘self’

  • maxiter (int) – maximum number of CDMFT iterations

  • miniter (int) – minimum number of CDMFT iterations

  • accur_bath (float) – the x-tolerance for distance function optimization

  • convergence ([str]) – the convergence tests (sequence of strings or single string)

  • accur ([float]) – the tolerance for the various convergence tests (sequence of floats or single float)

  • converge_with_stdev (boolean) – If True, checks convergence using the standard deviation of the convergence tests, not the difference

  • alpha (float) – damping parameter (fraction of the previous iteration in the new one)

  • displaymin (boolean) – displays the minimum distance function when minimized

  • method (str) – method to use, as used in scipy.optimize.minimize()

  • file (str) – name of the file where the solution is written

  • averages (boolean) – if True, computes the lattice averages after each iteration. Computes them at the end anyway.

  • eps_algo (int) – number of elements in the epsilon algorithm convergence accelerator = 2*eps_algo + 1 (0 = no acceleration)

  • initial_step (float) – initial step in the minimization routine

  • hartree ([hartree]) – mean-field hartree couplings to incorportate in the convergence procedure

  • SEF (boolean) – if True, computes the Potthoff functional at the end

  • check_ground_state (boolean) – if True, checks the ground state consistency and raises exception if inconsistent

  • max_function_eval (int) – maximum number of distance function evaluations when minimizing distance

  • compute_potential_energy (boolean) – If True, computes Tr(Sigma*G) along with the averages

  • host_function (ndarray) – if not None, function that computes the host array and passes it to qcm

  • pre_host (function) – function to be executed before computing the host. Takes a model instance as argument

  • max_value (float) – maximum absolute value of variational parameters

Variables:
  • model (lattice_model) – (unique) model on which the computation is based

  • Hyb (ndarray) – host function

  • Hyb_down (ndarray) – host function for the spin down component in the case of mixing=4

  • I – current model instance (changes in the course of the computation)

diff_matrix(X, Y)

Computes a difference in hybridization functions between the current iteration (Hyb) and the previous one (Hyb0) :param object X : the current test object :param object Y : any past test object (same structure as X) :returns float: the difference in hybridization arrays

diff_sigma()

Computes a difference in self-energy between the current iteration (sigma) and the previous one (sigma0)

Returns float:

the difference in self-energy arrays

plot_iterations()

Plots the variational parameters as a function of iteration, for diagnostics purposes

set_Hyb()

Computes the hybridization function, i.e. an array of arrays of matrices. Hyb[i], for cluster #i, is a (nw,d,d) Numpy array. with nw frequencies, and d sites

:returns None

set_sigma()

Computes the self-energy on the frequency grid an array of arrays of matrices. sigma[i], for cluster #i, is a (nw,d,d) Numpy array. with nw frequencies, and d sites

:returns None

class convergence_manager(name, diff_func, tol, depth=2, stdev=False)

class managing a convergence test. One or more instances of this class must be used by the CDMFT procedure. One instance corresponds to a quantity that is evaluated at each iteration and then compared with the corresponding quantities at a number (depth) of previous iterations. A difference function (diff_func) is applied to the current value of the quantity and each of its predecessors, and convergence is declared when the result of this difference (a float) is smaller than the tolerance (tol) for each of the depth previous iterations. The possible values of the ‘name’ argument are:

  • ‘parameters’ : the set of bath parameters is the quantity used.

  • ‘GS energy’ : the ground state energy of the impurity problem is used. In the case of more than one cluster, the sum is used.

  • ‘hybridization’ : the hybridization function (or set thereof, in the case of many clusters). The test is based on the norm of the matrix differences, summed over grid frequencies.

  • ‘self-energy’ : same as above, but using the impurity self-energy instead.

  • any one-body or anomalous lattice operator name. The lattice average is used as test value.

print()

Prints the status of the convergence (differences are printed, with a number “depth” of previous iterations)

test(x)

tests for convergence and stores the test object x in an array for comparisons with ‘depth’ future iterations

Parameters:

x (object) – the object containing the current test quantity

Returns:

True if converged, False otherwise

class frequency_grid(I=None, grid_type='sharp', beta=50, wc=2)

This class contains the imaginary frequency grid data, including weights

Parameters:
  • I (model_instance) – current model instance

  • grid_type (str) – type of frequency grid along the imaginary axis : ‘sharp’, ‘ifreq’, ‘self’

  • beta (float) – inverse fictitious temperature (for the frequency grid)

  • wc (float) – cutoff frequency (for the frequency grid)

Variables:
  • beta (float) – inverse fictitious temperature

  • wc (float) – cutoff frequency (for the frequency grid)

  • grid_type (str) – type of frequency grid along the imaginary axis : ‘sharp’, ‘ifreq’, ‘self’

  • wr – array of frequencies (real array, i.e., imaginary part of the frequencies)

  • weight ([float]) – array of weights for the different frequencies of the grid

  • nw (int) – number of frequencies in the grid

class hybridization(file)

Defines hybridization data from a data file. the frequency is purely imaginary; it is its imaginary part that appears in the file

Parameters:

file (str) – name of the file or string. Format : each line starts with a frequency and then has N*N columns for Delta_{ij}(w)

distance(I)

Evaluates the distance function bewteen the data and the hybridization function of an impurity model instance of label I

Parameters:

I ([model_instance]) – model instance

optimize_bath(model, varia, x, method='Nelder-Mead', accur=0.0001, accur_dist=1e-08)

Optimizes the bath parameters to fit the hybridization function delta :param [str] varia: list of variational parameters (bath parameters) from PyQCM :param [float] x: starting values of the parameters

class general_bath(ns, nb, name='clus', spin_dependent=False, spin_flip=False, singlet=False, triplet=False, complex=False, sites=None)

Class that construct a cluster model with nb bath orbitals, in the most general way possible, with possible restrictions.

Parameters:
  • name (str) – name of the cluster-bath model to be defined

  • ns (int) – number of sites in the cluster

  • nb (int) – number of bath orbitals in the cluster

  • spin_dependent (boolean) – if True, the parameters are spin dependent

  • spin_flip (boolean) – if True, spin-flip hybridizations are present

  • singlet (boolean) – if True, defines anomalous singlet hybridizations

  • triplet (boolean) – if True, defines anomalous triplet hybridizations

  • complex (boolean) – if True, defines imaginary parts as well, when appropriate

  • sites ([[int]]) – 2-level list of sites to couple to the bath orbitals (labels from 1 to ns). Format resembles [[site labels to bind to orbital 1], …] .

Variables:
  • ns (int) – number of physical sites in the cluster

  • nb (int) – number of bath orbitals in the cluster

  • name (str) – name of the cluster model

  • var_E ([str]) – list of bath parameters of the type “energy level”

  • var_H ([str]) – list of bath parameters of the type “hybridization”

  • spin_dependent (boolean) – True if the bath parameter conserve spin, but are different for spins up and down

  • spin_flip (boolean) – True if we include spin-flip hybridizations terms

  • singlet (boolean) – True if we include anomalous hybridizations of the singlet type

  • triplet (boolean) – True if we include anomalous hybridizations of the triplet type

  • complex (boolean) – True if the model is complex-valued and thus hybridization operators have both real and imaginary components

starting_values(c=1, e=(0.5, 1.5), hyb=(0.5, 0.2), shyb=(0.1, 0.05), pr=False)

returns an initialization string for the bath parameters

Parameters:
  • c (int) – cluster label (starts at 1)

  • e ((float,float)) – bounds of the values for the bath energies (absolute value)

  • hyb ((float,float)) – average and deviation of the normal hybridization parameters

  • shyb ((float,float)) – average and deviation of the anomalous hybridization parameters

  • pr (boolean) – prints the starting values if True

Return str:

initialization string

starting_values_PH(c=1, e=(1, 0.5), hyb=(0.5, 0.2), phi=None, pr=False)

returns an initialization string for the bath parameters, in the particle-hole symmetric case.

Parameters:
  • c (int) – cluster label

  • e ((float)) – range of bath energies

  • hyb ((float,float)) – average and deviation of the normal hybridization parameters

  • phi ([int]) – PH phases of the cluster sites proper

  • pr (boolean) – if True, prints info

Return str:

initialization string

varia(H=None, E=None, c=1, spin_down=False)

creates a dict of variational parameters to values taken from the hybridization matrix H and the energies E, for cluster c

Parameters:
  • H (ndarray) – matrix of hybridization values

  • E (ndarray) – array of energy values

  • spin_down (boolean) – True for the spin-down values

Return {str,float}:

dict of variational parameters to values

varia_E(c=1)

returns a list of parameter names from the bath energies with the suffix appropriate for cluster c

Parameters:

c (int) – label of the cluster (starts at 1)

Return [str]:

list of parameter names from the bath energies with the suffix appropriate for cluster c

varia_H(c=1)

returns a list of parameter names from the bath hybridization with the suffix appropriate for cluster c

Parameters:

c (int) – label of the cluster (starts at 1)

Return [str]:

list of parameter names from the bath hybridization with the suffix appropriate for cluster c