Python API Reference

This section contains the complete Python API reference for the triqs_xca package, including all modules, classes, and compiled extensions.

Main Module

The main triqs_xca module provides access to all submodules and the high-level Solver interface.

High-Level Solver Interface

class triqs_xca.block_sparse_solver.BlockSparseSolver(H_loc, beta, w_max, eps, gf_struct, conserved_operators='automatic', dlr_symmetrize=False, timer=None, atom_diag=None, verbose=True)[source]

Solver class for triqs_xca using the block sparse algorithm.

Parameters:
H_loctriqs.operators.Operator

Local Hamiltonian, including both quadratic and quartic terms (\(H_{\textrm{loc}} = \sum c^\dagger c + \sum c^\dagger c^\dagger c c\)).

betafloat

Inverse temperature \(\beta\).

w_maxfloat

Imaginary time DLR discretization frequency cutoff \(\omega_{\text{max}}\).

epsfloat

Imaginary time DLR accuracy tolerance \(\epsilon\).

gf_structdict

Triqs style Green’s function structure, e.g. [('up', 1), ('down', 1)], matching the operator content of H_loc.

conserved_operatorslist, optional

List of conserved operators (triqs.operators.Operator instances). Default is 'automatic' using the autopartition algorithm of triqs.atom_diag. To disable symmetries and use the dense diagram evaluator (DenseDiagramEvaluator), pass an empty list [].

timerTimer, optional

Timer for performance measurements. Default: None (will be setup automatically).

atom_diagAtomDiag, optional

Triqs AtomDiag object triqs.atom_diag.AtomDiag. Default: None. If not provided, it will be initialized automatically using the provided local Hamiltonian and conserved operators.

verbosebool/int, optional

Verbosity flag controlling level of printouts. Default: True.

Methods

expectation_value(operator)

Expectation value \(\langle \hat{O} \rangle\) of an operator \(\hat{O}\), computed from the pseudo particle Green's function as

partition_function()

Partition function \(Z\) of the impurity model, computed from the pseudo particle Green's function as

pseudo_particle_chemical_potential()

Pseudo particle chemical potential \(\eta\).

solve(max_order[, tol, maxiter, mix, ...])

Solve the impurity problem using pseudo particle self-consistent perturbation theory.

Notes

The hybridization function is available as the Delta_tau attribute, which is a block Green’s function in imaginary time. It has to be set by the user before calling solve(). If not set by the user, it will be initialized to zero.

The main method of the class is solve(), which runs the pseudo particle self-consistent perturbation theory until convergence.

The single particle Green’s function is available as the G_tau attribute after calling solve(). It is a block Green’s function in imaginary time.

expectation_value(operator)[source]

Expectation value \(\langle \hat{O} \rangle\) of an operator \(\hat{O}\), computed from the pseudo particle Green’s function as

\[\langle \hat{O} \rangle = -\mathrm{Tr}[ \hat{O} G(\beta) ]\]
Parameters:
operatortriqs.operators.Operator

Operator \(\hat{O}\) for which the expectation value is computed. It has to be compatible with the operator content of the local Hamiltonian and the Green’s function structure.

Returns:
float

Expectation value \(\langle \hat{O} \rangle\) of the operator \(\hat{O}\).

partition_function()[source]

Partition function \(Z\) of the impurity model, computed from the pseudo particle Green’s function as

\[Z = -\mathrm{Tr}[ G(\beta) ] \cdot e^{-\beta \eta}\]
Returns:
float

Partition function \(Z\) of the impurity model.

pseudo_particle_chemical_potential()[source]

Pseudo particle chemical potential \(\eta\).

The pseudo particle chemical potential \(\eta\) is a shift of the pseudo particle energies used to enforce the normalization condition \(\textrm{Tr}[G(\beta)] = -1\) on the pseudo particle Green’s function \(G\).

Returns:
float

Pseudo particle chemical potential \(\eta\).

solve(max_order, tol=0.0001, maxiter=10, mix=1.0, hyb_tol=None, hyb_comp=True, normalization='classic', spgf_max_order=None, verbose=True)[source]

Solve the impurity problem using pseudo particle self-consistent perturbation theory.

Parameters:
max_orderint

Maximum order of the perturbation theory.

tolfloat, optional

Tolerance for the convergence criterion.

maxiterint, optional

Maximum number of iterations.

mixfloat, optional

Mixing parameter for the self-consistent iteration.

hyb_tolfloat, optional

Tolerance for the hybridization function compression. Defaults to 0.1 * tol if not provided.

hyb_compbool, optional

Whether to compress the hybridization function. Default: True. When set to False, the hybridization function is represented using the full DLR basis.

spgf_max_orderint, optional

Maximum order for the single particle Green’s function evaluation. If not provided, it defaults to max_order.

normalizationstr, optional

Normalization method for the pseudo particle Green’s function. Default: 'classic'.

Returns:
None

Notes

Available normalization methods:

  • 'classic': Classical normalization (Default)

  • 'root': Root normalization

  • 'ode+classic': ODE with classic normalization

  • 'ode+root': ODE with root normalization

  • 'odeG+classic': ODE on G with classic normalization

  • 'odeG+root': ODE on G with root normalization