dgamore.interaction#
Interaction tensors. LocalInteraction wraps the momentum-independent (Hubbard/Kanamori) interaction
\(U_{abcd}\); Interaction adds a momentum dimension for the non-local interaction \(V_{abcd}^q\).
Both provide the channel projections (density/magnetic/singlet/triplet) and the algebra used in the ladder
equations.
- class dgamore.interaction.Interaction(mat: ndarray, channel: SpinChannel = SpinChannel.NONE, nq: tuple[int, int, int] = (1, 1, 1), has_compressed_q_dimension: bool = False)[source]#
Bases:
IAmNonLocal,LocalInteractionClass for the non-local (momentum-dependent) interaction \(V_{abcd}^q\).
- Parameters:
- add(other) Interaction[source]#
Adds another (non-)local interaction or a raw numpy array (a local operand is broadcast over the momentum axis); see
_add().- Parameters:
other – An
Interaction, aLocalInteraction, or a numpy array.- Returns:
A new
Interactionholding the sum (inheriting the non-NONEchannel of the operands).- Return type:
- as_channel(channel: SpinChannel) Interaction[source]#
Projects the bare non-local interaction onto a given spin channel. Only the non-local particle-hole contribution enters the ladder DGA equations and the ph-bar contribution to the spin channels vanishes, so the projections reduce to \(V_d = 2V\), \(V_m = 0\), \(V_s = V_t = V\).
- Parameters:
channel (SpinChannel) – Target spin channel (density, magnetic, singlet or triplet).
- Returns:
A new
Interactionin the requested channel.- Raises:
ValueError – If the object is already in a (non-
NONE) channel, or the target channel is unsupported.- Return type:
- permute_orbitals(permutation: str = 'abcd->abcd') Interaction[source]#
Permutes the four orbital axes (leaving the momentum axis untouched).
- Parameters:
permutation (str) – Einsum permutation of the four orbital labels, e.g.
"abcd->adcb".- Returns:
A new
Interactionwith permuted orbitals (a deep copy for the identity permutation).- Raises:
ValueError – If the permutation string is not a valid four-orbital permutation.
- Return type:
- pow(power) Interaction[source]#
Raises the interaction to an integer power via repeated momentum-diagonal orbital contraction \(V^{(n);q}_{abef} = V^{q}_{abcd} V^{(n-1);q}_{dcef}\).
- Parameters:
power – Positive integer exponent (must be greater than zero).
- Returns:
A new
Interactionin the same momentum-compression state asself.- Raises:
ValueError – If
poweris not a positive integer greater than zero.- Return type:
- sub(other) Interaction[source]#
Subtracts another (non-)local interaction or a raw numpy array; see
_add().- Parameters:
other – An
Interaction, aLocalInteraction, or a numpy array.- Returns:
A new
Interactionholding the differenceself - other.- Return type:
- class dgamore.interaction.LocalInteraction(mat: ndarray, channel: SpinChannel = SpinChannel.NONE)[source]#
Bases:
IHaveMat,IHaveChannelClass for the local (momentum-independent) interaction \(U_{abcd}\).
- Parameters:
mat (ndarray)
channel (SpinChannel)
- add(other) LocalInteraction[source]#
Adds another interaction or a raw numpy array element-wise; see
_add().- Parameters:
other – A
LocalInteractionor a numpy array broadcastable tomat.- Returns:
A new
LocalInteractionholding the sum (inheriting the non-NONEchannel of the operands).- Return type:
- as_channel(channel: SpinChannel) LocalInteraction[source]#
Projects the bare interaction onto a given spin channel. With the crossing-permuted tensor \(\tilde U_{abcd} = U_{adcb}\) the projections are \(U_d = 2U - \tilde U\), \(U_m = -\tilde U\), \(U_s = U + \tilde U\), \(U_t = U - \tilde U\).
- Parameters:
channel (SpinChannel) – Target spin channel (density, magnetic, singlet or triplet).
- Returns:
A new
LocalInteractionin the requested channel.- Raises:
ValueError – If the object is already in a (non-
NONE) channel, or the target channel is unsupported.- Return type:
- property n_bands: int#
Returns the number of bands (orbitals).
- Returns:
Number of bands, i.e. the size of the first orbital axis.
- permute_orbitals(permutation: str = 'abcd->abcd') LocalInteraction[source]#
Permutes the four orbital axes according to an einsum-style permutation string.
- Parameters:
permutation (str) – Einsum permutation of the four orbital labels, e.g.
"abcd->adcb".- Returns:
A new
LocalInteractionwith permuted orbitals (a deep copy for the identity permutation).- Raises:
ValueError – If the permutation string is not a valid four-orbital permutation.
- Return type:
- pow(power) LocalInteraction[source]#
Raises the interaction to an integer power via repeated orbital contraction \(U^{(n)}_{abef} = U_{abcd} U^{(n-1)}_{dcef}\).
- Parameters:
power – Positive integer exponent (must be greater than zero).
- Returns:
A new
LocalInteractionequal toselfcontracted with itselfpowertimes.- Raises:
ValueError – If
poweris not a positive integer greater than zero.- Return type:
- sub(other) LocalInteraction[source]#
Subtracts another interaction or a raw numpy array element-wise; see
_add().- Parameters:
other – A
LocalInteractionor a numpy array broadcastable tomat.- Returns:
A new
LocalInteractionholding the differenceself - other.- Return type: