Reference: List of functions

pyqcm.CPT_Green_function(z, k, spin_down=False, label=0)

computes the CPT Green function at a given frequency

Parameters
  • z – complex frequency

  • k – single wavevector (ndarray(3)) or array of wavevectors (ndarray(N,3)) in units of \(\pi\)

  • spin_down (boolean) – True is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance

Returns

a single or an array of complex-valued matrices

pyqcm.CPT_Green_function_inverse(z, k, spin_down=False, label=0)

computes the inverse CPT Green function at a given frequency

Parameters
  • z – complex frequency

  • k – array of wavevectors (ndarray(N,3)) in units of \(\pi\)

  • spin_down (boolean) – True is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance

Returns

a single or an array of complex-valued matrices

pyqcm.Green_function_average(cluster=0, spin_down=False)

Computes the cluster Green function average (integral over frequencies)

Parameters
  • cluster (int) – label of the cluster (0 to the number of clusters-1)

  • spin_down (boolean) – true is the spin down sector is to be computed (applies if mixing = 4)

Returns

a complex-valued matrix

pyqcm.Green_function_dimension()

returns the dimension of the CPT Green function matrix :return: int

pyqcm.Green_function_solve(label=0)

Usually, the Green function representation is computed only when needed, in a just-in-time fashion (i.e. in a lazy way). This forces the computation of the Green function representation for the current instance (i.e. non lazy).

Parameters

label (int) – label of the model instance

Returns

None

pyqcm.Lehmann_Green_function(k, orb=1, spin_down=False, label=0)

computes the Lehmann representation of the periodized Green function for a set of wavevectors

Parameters
  • k – single wavevector (ndarray(3)) or array of wavevectors (ndarray(N,3)) in units of \(\pi\)

  • orb (int) – orbital index (starts at 1)

  • spin_down (boolean) – True is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance

Returns

a list of pairs {poles, residues}, each of poles and residues being itself a list.

exception pyqcm.MinimizationError
exception pyqcm.MissingArgError
exception pyqcm.OutOfBoundsError(variable)
exception pyqcm.ParseError
pyqcm.Potthoff_functional(hartree=None, file='sef.tsv', label=0, symmetrized_operator=None)

computes the Potthoff functional for a given instance

Parameters
  • label (int) – label of the model instance

  • file (str) – name of the file to append with the result

  • hartree ((class hartree)) – Hartree approximation couplings (see pyqcm/hartree.py)

  • symmetrized_operator (str) – name of an operator wrt which the functional must be symmetrized

Returns

the value of the self-energy functional

pyqcm.QP_weight(k, eta=0.01, orb=1, spin_down=False, label=0)

computes the k-dependent quasi-particle weight from the self-energy derived from the periodized Green function

Parameters
  • k – single wavevector (ndarray(3)) or array of wavevectors (ndarray(N,3)) in units of \(\pi\)

  • eta (float) – increment in the imaginary axis direction used to computed the derivative of the self-energy

  • orb (int) – orbital index (starts at 1)

  • spin_down (boolean) – True is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance

Returns

a single float or an array of floats, depending on the shape of k

exception pyqcm.SolverError
exception pyqcm.TooManyIterationsError
pyqcm.V_matrix(z, k, spin_down=False, label=0)

Computes the matrix \(V=G_0^{-1}-G^{c-1}_0\) at a given frequency and wavevectors, where \(G_0\) is the noninteracting Green function on the infinite lattice and \(G^c_0\) is the noninteracting Green function on the cluster.

Parameters
  • z (complex) – frequency

  • k (wavevector) – wavevector (ndarray(3)) in units of \(\pi\)

  • spin_down (boolean) – True is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance

Returns

a single (d,d) or an array (N,d,d) of complex-valued matrices. d is the reduced GF dimension.

exception pyqcm.VarParamMismatchError
exception pyqcm.WrongArgumentError
pyqcm.add_cluster(name, pos, sites, ref=0)

Adds a cluster to the repeated unit

Parameters
  • name (str) – name of the cluster model

  • pos ([int]) – base position of cluster (array of ints)

  • sites ([[int]]) – list of positions of sites (2D array of ints)

  • ref ([int]) – label of a previous cluster (starts at 1) to which this one is entirely equivalent (0 = no equivalence)

Returns

None

pyqcm.anomalous_operator(name, link, amplitude, orbitals=None, **kwargs)

Defines an anomalous operator

Parameters
  • name (str) – name of operator

  • link ([int]) – bond vector (3-component integer array)

  • amplitude (complex) – pairing multiplier

  • orbitals ((int,int)) – lattice orbital labels (start at 1); if None, tries all possibilities.

Keyword Arguments
  • type (str) – one of ‘singlet’ (default), ‘dz’, ‘dy’, ‘dx’

Returns

None

pyqcm.averages(ops=[], label=0, file='averages.tsv')

Computes the lattice averages of the operators present in the model

Parameters
  • label (int) – label of the model instance

  • file (str) – name of the file in which the information is appended

Return {str,float}

a dict giving the values of the averages for each parameter

pyqcm.band_Green_function(z, k, spin_down=False, label=0)

computes the periodized Green function at a given frequency and wavevectors, in the band basis (defined in the noninteracting model). It only differs from the periodized Green function in multi-band models.

Parameters
  • z (complex) – frequency

  • k – single wavevector (ndarray(3)) or array of wavevectors (ndarray(N,3)) in units of \(\pi\)

  • spin_down (boolean) – true is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance

Returns

a single (d,d) or an array (N,d,d) of complex-valued matrices. d is the reduced GF dimension.

pyqcm.cluster_Green_function(cluster, z, spin_down=False, label=0, blocks=False)

Computes the cluster Green function

Parameters
  • cluster (int) – label of the cluster (0 to the number of clusters-1)

  • z (complex) – frequency

  • spin_down (boolean) – true is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance (default 0)

  • blocks (boolean) – true if returned in the basis of irreducible representations

Returns

a complex-valued matrix

pyqcm.cluster_Green_function_dimension(clus=0)

returns the dimension of the cluster Green function matrix :param int clus: label of the cluster :return: int

pyqcm.cluster_QP_weight(cluster=0, eta=0.01, orb=1, spin_down=False, label=0)

computes the cluster quasi-particle weight from the cluster self-energy

Parameters
  • cluster (int) – cluster label (starts at 0)

  • eta (float) – increment in the imaginary axis direction used to computed the derivative of the self-energy

  • orb (int) – orbital index (starts at 1)

  • spin_down (boolean) – True is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance

Returns

a float

pyqcm.cluster_averages(label=0)

Computes the average and variance of all operators of the cluster model in the cluster ground state.

Parameters

label (int) – label of the cluster model instance

Returns

a dict str : (float, float) with the averages and variances as a function of operator name

pyqcm.cluster_hopping_matrix(clus=0, spin_down=False, label=0, full=0)

returns the one-body matrix of cluster no i for instance ‘label’

Parameters
  • cluster – label of the cluster (0 to the number of clusters - 1)

  • spin_down (boolean) – True is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance

  • full (boolean) – if True, returns the full hopping matrix, including bath

Returns

a complex-valued matrix

pyqcm.cluster_info()
Return:A list of 4-tuples

(str, int, int, int, int): name of the cluster model, number of physical sites, number of bath sites, dimension of the Green function, number of point-group symmetry operations

pyqcm.cluster_parameters(label=0)

returns the values of the cluster parameters in a given instance, as well as the cluster model name

Parameters

label (int) – label of the cluster model instance

Returns

a tuple: dict{string,float}, str

pyqcm.cluster_self_energy(cluster, z, spin_down=False, label=0)

Computes the cluster self-energy

Parameters
  • cluster (int) – label of the cluster (0 to the number of clusters -1)

  • z (complex) – frequency

  • spin_down (boolean) – true is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance (default 0)

Returns

a complex-valued matrix

pyqcm.complex_HS(label=0)

returns True if the model needs a complex Hilbert space. False otherwise.

pyqcm.density_matrix(sites, label=0)

Computes the density matrix of subsystem A, defined by the array of site indices “sites” :param [int] sites: list of sites defining subsystem A :return [complex], [int32], [int32]: the density matrix, the left and right bases (spins up and down)

pyqcm.density_wave(name, t, Q, **kwargs)

Defines a density wave

Parameters
  • name (str) – name of operator

  • t (str) – type of density-wave – one of ‘Z’, ‘X’, ‘Y’, ‘N’=’cdw’, ‘singlet’, ‘dz’, ‘dy’, ‘dx’

  • Q (wavevector) – wavevector of the density wave (in multiple of \(pi\))

Keyword Arguments
  • link ([int]) – bond vector, for bond density waves

  • amplitude (complex) – amplitude multiplier. Caution: A factor of 2 must be used in some situations (see Density waves)

  • orb (int) – orbital label (0 by default = all orbitals)

  • phase (float) – real phase (as a multiple of \(pi\))

Returns

None

pyqcm.dispersion(k, spin_down=False, label=0)

computes the dispersion relation for a single or an array of wavevectors

Parameters
  • k (wavevector) – single wavevector (ndarray(3)) or array of wavevectors (ndarray(N,3)) in units of \(\pi\)

  • spin_down (boolean) – True is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance

Returns

a single (ndarray(d)) or an array (ndarray(N,d)) of real values (energies). d is the reduced GF dimension.

pyqcm.dos(z, label=0)

computes the density of states at a given frequency.

Parameters
  • z (complex) – frequency

  • label (int) – label of the model instance

Returns

ndarray(d) of real values, d being the reduced GF dimension

pyqcm.double_counting_correct(DC)

Modifies some kinetic parameters in view of the presence of interactions and averages values, in order to account minimally for double counting. :param [(str,str,str,float,float)] DC: list of recipes for the correction: (kinetic operator, interaction operator, density operator, coefficient, value of the kinetic operator without interaction)

pyqcm.epsilon(y, pr=False)

Performs the epsilon algorithm for accelerated convergence

Parameters
  • y ([float]) – sequence to be extrapolated

  • pr (boolean) – if True, prints the resulting extrapolation

Return [float]

the extrapolated values

pyqcm.explicit_operator(name, elem, **kwargs)

Defines an explicit operator

Parameters
  • name (str) – name of operator

  • elem ([(list, list, complex)]) – List of tuples. Each tuple contains three elements (in order): a list representing position, a list representing link and a complex amplitude.

Keyword Arguments
  • tau (int) – specifies the tau Pauli matrix (0,1,2,3)

  • sigma (int) – specifies the sigma Pauli matrix (0,1,2,3)

  • type (str) – one of ‘one-body’ [default], ‘singlet’, ‘dz’, ‘dy’, ‘dx’, ‘Hubbard’, ‘Hund’, ‘Heisenberg’, ‘X’, ‘Y’, ‘Z’

Returns

None

pyqcm.general_interaction_matrix_elements(e, n)

Translates a list of matrix elements (i,j,k,l,v) for a general interaction into a list of compound elements (I,J,v) where I = i+n*j and J = k+n*l and v is the value of the matrix element Also checks that only non redundant elements are given :param (int,int,int,int,float) e: list of matrix elements :param int n: number of orbitals in the impurity model (excluding spin; 2*n with spin)

pyqcm.get_global_parameter(name, value=None)

gets the value of a global parameter.

Parameters

name (str) – name of the global option

Returns

the value, according to type

pyqcm.ground_state(file=None)
Returns

a list of pairs (float, str) of the ground state energy and sector string, for each cluster of the system

pyqcm.hopping_operator(name, link, amplitude, orbitals=None, **kwargs)

Defines a hopping term or, more generally, a one-body operator

Parameters
  • name (str) – name of operator

  • link ([int]) – bond vector (3-component integer array)

  • amplitude (float) – hopping amplitude multiplier

  • orbitals ((int,int)) – lattice orbital labels (start at 1); if None, tries all possibilities.

Keyword Arguments
  • tau (int) – specifies the tau Pauli matrix (0,1,2,3)

  • sigma (int) – specifies the sigma Pauli matrix (0,1,2,3)

Returns

None

pyqcm.hybridization_function(clus, z, spin_down=False, label=0)

returns the hybridization function for cluster ‘cluster’ and instance ‘label’

Parameters
  • clus (int) – label of the cluster (0 to the number of clusters-1)

  • z (complex) – frequency

  • spin_down (boolean) – True is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance

Returns

a complex-valued matrix

pyqcm.interaction_operator(name, link=None, orbitals=None, **kwargs)

Defines an interaction operator of type Hubbard, Hund, Heisenberg or X, Y, Z

Parameters
  • name (str) – name of the operator

  • orbitals ((int,int)) – lattice orbital labels (start at 1); if None, tries all possibilities.

  • link (list) – link of the operator (None by default)

Keyword Arguments
  • amplitude (float): amplitude multiplier

  • type (str): one of ‘Hubbard’, ‘Heisenberg’, ‘Hund’, ‘X’, ‘Y’, ‘Z’

Returns

None

pyqcm.interactions(clus=0)

returns the one-body matrix of cluster no i for instance ‘label’

Parameters

cluster – label of the cluster (0 to the number of clusters - 1)

Returns

a real-valued matrix

pyqcm.lattice_model(name, superlattice, lattice=None)

initiates the lattice model.

Parameters
  • name (str) – the name of the model

  • superlattice ([[int]]) – array of integers of shape (d,3), d being the dimension

  • lattice ([[int]]) – array of integers of shape (d,3), d being the dimension. If None, will be replaced by the unit lattice.

Returns

None

pyqcm.matrix_elements(model, op)

returns the type and matrix elements defining a Hermitian operator

Parameters
  • model (str) – name of the cluster model

  • op (str) – name of the operator

Returns

a tuple (typ, elem)

pyqcm.mixing()

returns the mixing state of the system:

  • 0 – normal. GF matrix is n x n, n being the number of sites

  • 1 – anomalous. GF matrix is 2n x 2n

  • 2 – spin-flip. GF matrix is 2n x 2n

  • 3 – anomalous and spin-flip (full Nambu doubling). GF matrix is 4n x 4n

  • 4 – up and down spins different. GF matrix is n x n, but computed twice, with spin_down = false and true

Returns

int

pyqcm.model_is_closed()

returns True if the model can no longer be modified. False otherwise.

pyqcm.model_size()
Returns

a 5-tuple:

  1. the size of the supercell

  2. the number of bands

  3. a tuple containing the sizes of each cluster

  4. a tuple containing the sizes of each cluster’s bath

  5. a tuple containing the references of each cluster (label of reference cluster, from 0 to the nunber of clusters-1)

pyqcm.momentum_profile(name, k, label=0)

computes the momentum-resolved average of an operator

Parameters
  • name (str) – name of the lattice operator

  • k – array of wavevectors (ndarray(N,3)) in units of \(\pi\)

  • label (int) – label of the model instance

Returns

an array of values

pyqcm.new_cluster_model(name, n_sites, n_bath=0, generators=None, bath_irrep=False)

Initiates a new model (no operators yet)

Parameters
  • name (str) – name to be given to the model

  • n_sites (int) – number of cluster sites

  • n_bath (int) – number of bath sites

  • generators ([[int]]) – symmetry generators (2D array of ints)

  • bath_irrep ([boolean]) – True if bath orbitals belong to irreducible representations of the symmetry group

Returns

None

pyqcm.new_cluster_model_instance(name, values, sec, label=0)

Initiates a new instance of the cluster model

Parameters
  • name (str) – name of the cluster model

  • values ({str,float}) – values of the operators

  • sec (str) – target Hilbert space sectors

  • label (int) – label of model_instance

Returns

None

pyqcm.new_cluster_operator(name, op_name, op_type, elem)

creates a new operator from its matrix elements

Parameters
  • name (str) – name of the cluster model to which the operator will belong

  • op_name (str) – name of the operator

  • op_type (str) – type of operator (‘one-body’, ‘anomalous’, ‘interaction’, ‘Hund’, ‘Heisenberg’, ‘X’, ‘Y’, ‘Z’)

  • elem ([(int,int,float)]) – array of matrix elements (list of tuples)

Returns

None

pyqcm.new_cluster_operator_complex(name, op_name, op_type, elem)

creates a new operator from its complex-valued matrix elements

Parameters
  • name (str) – name of the cluster model to which the operator will belong

  • op_name (str) – name of the operator

  • op_type (str) – type of operator (‘one-body’, ‘anomalous’, ‘interaction’, ‘Hund’, ‘Heisenberg’, ‘X’, ‘Y’, ‘Z’)

  • elem ([(int, int, complex)]) – array of matrix elements (list of tuples)

Returns

None

pyqcm.new_model_instance(label=0, record=False)

Creates a new instance of the lattice model, with values associated to terms of the Hamiltonian.

Parameters
  • label (int) – label of the model instance

  • record (boolean) – if True, keeps a str-valued record of the instance in memory, containing all the data necessary to read the instance back without solving.

Return (class model_instance)

an instance of the class model_instance

pyqcm.orbital_manager(orbitals, from_zero=False)
pyqcm.parameter_set(opt='all')

returns the content of the parameter set

Parameters

opt (str) – governs the action of the function

Returns

depends on opt

if opt = ‘all’, all parameters as a dictionary {str,(float, str, float)}. The three components are

  1. the value of the parameter,

  2. the name of its overlord (or None),

  3. the multiplier by which its value is obtained from that of the overlord.

if opt = ‘independent’, returns only the independent parameters, as a dictionary {str,float} if opt = ‘report’, returns a string with parameter values and dependencies.

pyqcm.parameter_string(lattice=True, CR=False)

Returns a string with the model parameters. :param boolean lattice : if True, only indicates the independent lattice parameters. :param boolean CR : if True, put each parameter on a line.

pyqcm.parameters(label=0)

returns the values of the parameters in a given instance

Parameters

label (int) – label of the model instance

Returns

a dict {string,float}

pyqcm.params_from_file(out_file, n=0)

reads an output file for parameters

Parameters
  • out_file (str) – name of output file from which parameters are read

  • n (int) – line number of data in output file (excluding titles).

Returns

a dict of (parameter, value)

pyqcm.periodized_Green_function(z, k, spin_down=False, label=0)

computes the periodized Green function at a given frequency and wavevectors

Parameters
  • z (complex) – frequency

  • k – single wavevector (ndarray(3)) or array of wavevectors (ndarray(N,3)) in units of \(\pi\)

  • spin_down (boolean) – true is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance

Returns

a single (d,d) or an array (N,d,d) of complex-valued matrices. d is the reduced GF dimension.

pyqcm.periodized_Green_function_element(r, c, z, k, spin_down=False, label=0)

computes the element (r,c) of the periodized Green function at a given frequency and wavevectors (starts at 0)

Parameters
  • r (int) – a row index (starts at 0)

  • c (int) – a column index (starts at 0)

  • z (complex) – frequency

  • k – array of wavevectors (ndarray(N,3)) in units of \(\pi\)

  • spin_down (boolean) – true is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance

Returns

a vector of complex numbers

pyqcm.potential_energy(label=0)

computes the potential energy for a given instance, as the functional trace of Sigma x G

Parameters

label (int) – label of the model instance

Returns

the value of the potential energy

pyqcm.print_averages(ave)

Prints the averages nicely on the screen

Parameters

ave (dict) – the dictionary produced by qcm.averages()

pyqcm.print_cluster_averages(ave)

Prints the averages nicely on the screen

Parameters

ave (dict) – the dictionary produced by qcm.averages()

pyqcm.print_graph(name, sites)

prints a graphiz (dot) program for the cluster

Parameters
  • name (str) – name of the cluster model

  • sites ([[int]]) – list of positions of sites (2D array of ints)

Returns

None

pyqcm.print_model(filename)

Prints a description of the model into a file

Parameters

filename (str) – name of the file

Returns

None

pyqcm.print_options(opt=0)

Prints the list of global options and parameters on the screen

Parameters

opt (int) – 0 -> prints to screen. 1 -> prints to latex. 2 -> prints to RST

pyqcm.print_parameter_set()

prints the content of the parameter set

pyqcm.print_parameters(P)

Prints the parameters nicely on the screen

Parameters

P (dict) – the dictionary of parameters

pyqcm.print_wavefunction(label=0, pr=True)

prints the ground state wavefunction(s) on the screen

Parameters
  • label (int) – label of the model instance

  • pr (bool) – prints wavefucntion to screen if pr=True

Returns

the wavefunction

pyqcm.projected_Green_function(z, spin_down=False, label=0)

computes the projected Green function at a given frequency, as used in CDMFT.

Parameters
  • z (complex) – frequency

  • spin_down (boolean) – true is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance

Returns

the projected Green function matrix (d x d), d being the dimension of the CPT Green function.

pyqcm.properties(label=0)

Returns two strings of properties of a model instance

Parameters

label (int) – label of the model instance

Returns

a pair of strings (the description line and the data line).

pyqcm.qmatrix(label=0)

Returns the Lehmann representation of the Green function

Parameters

label (int) – label of the cluster model instance

Returns

2-tuple made of 1. the array of M real eigenvalues, M being the number of poles in the representation 2. a rectangular (L x M) matrix (real of complex), L being the dimension of the Green function

pyqcm.read_cluster_model_instance(S, label=0)

reads the solution from a string

Parameters
  • S (str) – long string containing the solution

  • label (int) – label of model_instance

Returns

None

pyqcm.read_from_file(out_file, n=0)

reads an output file for parameters

Parameters
  • out_file (str) – name of output file from which parameters are read

  • n (int) – line number of data in output file (excluding titles)

Returns

string to be added to an eventual input file

pyqcm.read_from_file_legacy(filename)

reads model parameters from a text file, for legacy results :param str filename: name of the input text file

pyqcm.read_model(filename)

Reads the definition of the model from a file

Parameters

file – name of the file, the same as that of the model, i.e., without the ‘.model’ suffix.

Returns

None

pyqcm.reduced_Green_function_dimension()

returns the dimension of the reduced Green function, i.e. a simple multiple of the number of bands n, depending on the mixing state: n, 2n or 4n, and the number of bands

pyqcm.sectors(R=None, N=None, S=None)

Alternative method of setting target sectors (see set_target_sectors(…)). An example of usage is, R = [[1,2], [3,4]] –> [“R1…/R2…”, “R3…/R4…”].

Parameters
  • R (int or [int] or [[int]]) – Symmetry sector.

  • N (int or [int] or [[int]]) – Particle number.

  • S (int or [int] or [[int]]) – Total spin.

Returns

None

pyqcm.self_energy(z, k, spin_down=False, label=0)

computes the self-energy associated with the periodized Green function at a given frequency and wavevectors

Parameters
  • z (complex) – frequency

  • k – single wavevector (ndarray(3)) or array of wavevectors (ndarray(N,3)) in units of \(\pi\)

  • spin_down (boolean) – True is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance

Returns

a single (d,d) or an array (N,d,d) of complex-valued matrices. d is the reduced GF dimension.

pyqcm.set_basis(B)
Parameters

B – the basis (a (D x 3) real matrix)

Returns

None

pyqcm.set_global_parameter(name, value=None)

sets the value of a global parameter. If the global parameter is Boolean, then value is True by default and should not be specified.

Parameters
  • name (str) – name of the global option

  • value – value of that option (None, int, float or str)

Returns

None

pyqcm.set_parameter(name, value, pr=False)

sets the value of a parameter within a parameter_set

Parameters
  • name (str) – name of the parameter

  • value (float) – its value

Returns

None

pyqcm.set_parameters(params, dump=True)

Defines a new set of parameters, including dependencies

param tuple/str params

the values/dependence of the parameters (array of 2- or 3-tuples), or string containing syntax

param boolean dump

if True, sets the global str parameter_set_str tothe value

Return [tuple]

list of tuples of the form (str, float) or (str, float, str). The first form gives the parameter name and its value. The second gives the parameter name, a multiplier and the name of the reference parameter. See the documentation on the hierarchy of parameters.

pyqcm.set_params_from_file(out_file, n=0)

reads an output file for parameters

Parameters
  • out_file (str) – name of output file from which parameters are read

  • n (int) – line number of data in output file (excluding titles)

Returns

nothing

pyqcm.set_target_sectors(sec)

Define the Hilbert space sectors in which to look for the ground state

Parameters

sec ([str]) – the target sectors

Returns

None

pyqcm.site_and_bond_profile()

Computes the site and bond profiles in all clusters of the repeated unit

Returns

A pair of ndarrays

site profile – the components are x y z n Sx Sy Sz psi.real psi.imag

bond profile – the components are x1 y1 z1 x2 y2 z2 b0 bx by bz d0.real dx.real dy.real dz.real d0.imag dx.imag dy.imag dz.imag

pyqcm.spatial_dimension()

returns the spatial dimension (0, 1, 2, 3) of the model

pyqcm.spectral_average(name, z, label=0)

returns the contribution of a frequency to the average of an operator

Parameters
  • name – name of the operator

  • z – complex frequency

  • label (int) – label of the model instance

Returns

float

pyqcm.spin_spectral_function(freq, k, orb=None, label=0)

computes the k-dependent spin-resolved spectral function

Parameters
  • freq – complex freqency

  • k – single wavevector (ndarray(3)) or array of wavevectors (ndarray(N,3)) in units of \(\pi\)

  • orb (int) – if None, sums all the orbitals. Otherwise just shows the weight for that orbital (starts at 1)

  • label (int) – label of the model instance

Returns

depending on the shape of k, a nd.array(3) of nd.array(N,3)

pyqcm.susceptibility(op_name, freqs, label=0)

computes the dynamic susceptibility of an operator

Parameters
  • op_name (str) – name of the operator

  • freqs ([complex]) – array of complex frequencies

  • label (int) – label of cluster model instance

Returns

array of complex susceptibilities

pyqcm.susceptibility_poles(op_name, label=0)

computes the dynamic susceptibility of an operator

Parameters
  • name (str) – name of the operator

  • label (int) – label of cluster model instance

Returns [(float,float)]

array of 2-tuple (pole, residue)

pyqcm.switch_cluster_model(name)

switches cluster model to ‘name’. Hack used in DCA.

pyqcm.tk(k, spin_down=False, label=0)

computes the k-dependent one-body matrix of the lattice model

Parameters
  • k – single wavevector (ndarray(3)) or array of wavevectors (ndarray(N,3)) in units of \(\pi\)

  • spin_down (boolean) – True is the spin down sector is to be computed (applies if mixing = 4)

  • label (int) – label of the model instance

Returns

a single or an array of complex-valued matrices

pyqcm.update_bath(label=0)

updates the model parameters without creating a new instance or reseting the instance specified

Parameters

label (int) – label of the model instance

Returns

None

pyqcm.variational_parameters()
Returns

a list of the names of the variational parameters

pyqcm.wavevector_grid(n=100, orig=[- 1.0, - 1.0], side=2, k_perp=0, plane='z')

Produces a set of wavevectors for a MDC

Parameters
  • n (int) – number of wavevectors on the side

  • orig ([float]) – origin (in multiples of pi)

  • side (float) – length of the side (in multiples of pi)

  • k_perp (float) – momentum component in the third direction (in multiples of pi)

  • plane (str) – momentum plane, ‘xy’=’z’, ‘yz’=’x’=’zy’ or ‘xz’=’zx’=’y’

Returns

ndarray of wavevectors (n*n x 3)

pyqcm.wavevector_path(n=32, shape='triangle')

Builds a wavevector path and associated tick marks

Parameters
  • n (int) – number of wavevectors per segment

  • shape (str) – the geometry of the path, one of: line, halfline, triangle, graphene, graphene2, diagonal, cubic, cubic2, tetragonal, tetragonal2 OR a tuple with two wavevectors for a straight path between the two OR a filename ending with “.tsv”. In the latter case, the file contains a tab-separated list of wavevectors (in units of pi) and tick marks: the first three columns are the x,y,z components of the wavevectors, and the last columns the strings (possibly latex) for the tick marks (write - in that column if you do not want a tick mark for a specific wavevector).

Returns tuple
  1. a ndarray of wavevectors 2) a list of tick positions 3) a list of tick strings

pyqcm.write_cluster_instance_to_file(filename, clus=0)

Writes the solved cluster model instance to a text file

Parameters
  • filename (str) – name of the file

  • clus (int) – label of the cluster model instance

Returns

None

List of classes

class pyqcm.model
__init__()
class pyqcm.model_instance(model, label)
__init__(model, label)