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\).

set_dynamic_interactions(dynint_ops, dynint_tau)

Set retarded (dynamical) interactions of the impurity problem.

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\).

set_dynamic_interactions(dynint_ops, dynint_tau)[source]

Set retarded (dynamical) interactions of the impurity problem.

The interactions enter the impurity action as the term

\[\iint_0^\beta d\tau d\tau' \sum_{ij} O_i^\dagger(\tau) \, D_{ij}(\tau - \tau') \, O_j(\tau')\]

where \(O_i\) are the operators in dynint_ops and \(D_{ij}(\tau)\) is the kernel dynint_tau. The retarded interaction lines are expanded on the same footing as the hybridization lines, i.e. the expansion order max_order of solve() counts both kinds of lines.

Parameters:
dynint_opslist or tuple of triqs.operators.Operator

Local many-body operators \(O_i\) coupled by the retarded interaction, e.g. [n('up', 0)] for a density-density interaction. Each operator has to map every atom_diag subspace to at most one subspace.

dynint_tautriqs.gfs.Gf

Retarded interaction kernel \(D_{ij}(\tau)\) with target shape [len(dynint_ops)]*2, on a DLR imaginary time mesh (MeshDLRImTime) of either statistic, with the same beta as the solver, w_max smaller than or equal to, and eps larger than or equal to those of the solver. If the mesh differs from the solver mesh mesh_tau, the kernel is interpolated onto mesh_tau.

Returns:
None

Notes

The action term has no prefactor \(\frac{1}{2}\). A density-density interaction written as \(\frac{1}{2} \iint d\tau d\tau' \, n(\tau) \mathcal{U}(\tau - \tau') n(\tau')\) is therefore set with dynint_ops=[n] and dynint_tau equal to \(\frac{1}{2} \mathcal{U}(\tau)\).

The interaction kernel is fitted together with the hybridization function when calling solve(), so this method has to be called before solve(). Calling it again replaces the previously set interactions.

See the tutorial on the one-boson retarded interaction for a complete example.

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 of the single particle Green’s function diagram expansion. Default: max_order, is the Luttinger-Ward-consistent choice. However, using spgf_max_order = max_order + 1 improves convergence order by one, while giving up the conserving property of Luttinger-Ward.

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