dgamore.local_two_point#

Base class for the local (momentum-independent) two-point quantities. LocalTwoPoint wraps a single array carrying two orbital indices and exactly one fermionic frequency axis (no bosonic axis), e.g. a local Green’s function or self-energy, and collects the orbital bookkeeping shared by every two-point object: locating the orbital axes for the current layout, orbital permutation/transposition and orbital symmetrization. It mirrors LocalFourPoint for the two-orbital case; the momentum-dependent counterpart TwoPoint adds the single momentum dimension on top (just as FourPoint extends LocalFourPoint).

class dgamore.local_two_point.LocalTwoPoint(mat: ndarray, full_niv_range: bool = True)[source]#

Bases: LocalNPoint

Base class for the local (momentum-independent) two-point objects. They carry two orbital dimensions, no bosonic and exactly one fermionic frequency dimension. The orbital-axis lookup and the orbital permutation/symmetrization helpers are shared and live here; the momentum-dependent subclass TwoPoint overrides the orbital permutation to account for the leading momentum axis and adds the irreducible-to-full-BZ unfold.

Parameters:
is_orbitally_symmetrized(orbitals: list | ndarray) bool[source]#

Checks whether the object is already symmetric under all permutations of the given orbitals.

Parameters:

orbitals (list | ndarray) – 1-based orbital indices to test for equivalence.

Returns:

True if the object is invariant under permutations of those orbitals.

Return type:

bool

permute_orbitals(permutation: str = 'ab->ab') LocalTwoPoint[source]#

Permutes the two orbital axes according to an einsum-style string, returning a copy (the identity permutation returns self). The frequency axis is kept fixed.

Parameters:

permutation (str) – A permutation of the form "ab->..." using exactly the two orbital labels.

Returns:

The orbital-permuted object (a copy), or self for the identity permutation.

Raises:

ValueError – If the permutation is malformed or does not list both orbitals on each side.

Return type:

LocalTwoPoint

symmetrize_orbitals(orbitals: list | ndarray) LocalTwoPoint[source]#

Symmetrizes the object with respect to the given (equivalent) orbitals by averaging over all permutations of those orbitals applied to the two orbital axes. The orbital labels are 1-based, ranging from 1 to the number of bands; e.g. for a 3-band object orbitals=[1, 3] symmetrizes the first and third orbital.

Parameters:

orbitals (list | ndarray) – 1-based orbital indices to treat as equivalent.

Returns:

The symmetrized object (self unchanged if already symmetrized).

Return type:

LocalTwoPoint

transpose_orbitals() LocalTwoPoint[source]#

Transposes the two orbital indices, \(M_{ab} \to M_{ba}\) (see permute_orbitals()).

Returns:

The orbitally transposed object (a copy).

Return type:

LocalTwoPoint