dyson.expressions.expression#
Base class for expressions.
Classes
Base class for expressions. |
|
Collection of expressions for different parts of the Green's function. |
- class dyson.expressions.expression.BaseExpression[source]#
Bases:
ABCBase class for expressions.
- hermitian_downfolded#
Whether the expression is Hermitian when downfolded into the physical space.
- Type:
- abstractmethod classmethod from_mf(mf: RHF) BaseExpression[source]#
Create an expression from a mean-field object.
- Parameters:
mf – Mean-field object.
- Returns:
Expression object.
- abstractmethod apply_hamiltonian(vector: Array) Array[source]#
Apply the Hamiltonian to a vector.
- Parameters:
vector – Vector to apply Hamiltonian to.
- Returns:
Output vector.
- apply_hamiltonian_left(vector: Array) Array[source]#
Apply the Hamiltonian to a vector on the left.
- Parameters:
vector – Vector to apply Hamiltonian to.
- Returns:
Output vector.
- apply_hamiltonian_right(vector: Array) Array[source]#
Apply the Hamiltonian to a vector on the right.
- Parameters:
vector – Vector to apply Hamiltonian to.
- Returns:
Output vector.
- abstractmethod diagonal() Array[source]#
Get the diagonal of the Hamiltonian.
- Returns:
Diagonal of the Hamiltonian.
- build_matrix() Array[source]#
Build the Hamiltonian matrix.
- Returns:
Hamiltonian matrix.
Notes
This method uses
apply_hamiltonian()to build the matrix by applying unit vectors, it is not designed to be efficient.
- abstractmethod get_excitation_vector(orbital: int) Array[source]#
Obtain the vector corresponding to a fermionic operator acting on the ground state.
This vector is a generalisation of
\[f_i^{\pm} \left| \Psi_0 \right>\]where \(f_i^{\pm}\) is the fermionic creation or annihilation operator, or a product thereof, depending on the particular expression and what Green’s function it corresponds to.
The vector defines the excitaiton manifold probed by the Green’s function corresponding to the expression.
- Parameters:
orbital – Orbital index.
- Returns:
Excitation vector.
- get_excitation_bra(orbital: int) Array[source]#
Obtain the bra vector corresponding to a fermionic operator acting on the ground state.
The bra vector is the excitation vector corresponding to the bra state, which may or may not be the same as the ket state vector.
- Parameters:
orbital – Orbital index.
- Returns:
Bra excitation vector.
See also
get_excitation_vector(): Function to get the excitation vector when the bra and ket are the same.
- get_excitation_ket(orbital: int) Array[source]#
Obtain the ket vector corresponding to a fermionic operator acting on the ground state.
The ket vector is the excitation vector corresponding to the ket state, which may or may not be the same as the bra state vector.
- Parameters:
orbital – Orbital index.
- Returns:
Ket excitation vector.
See also
get_excitation_vector(): Function to get the excitation vector when the bra and ket are the same.
- get_excitation_vectors() list[Array][source]#
Get the excitation vectors for all orbitals.
- Returns:
List of excitation vectors for all orbitals.
See also
get_excitation_vector(): Function to get the excitation vector for a single orbital.
- get_excitation_bras() list[Array][source]#
Get the bra excitation vectors for all orbitals.
- Returns:
List of bra excitation vectors for all orbitals.
See also
get_excitation_bra(): Function to get the bra excitation vector for a single orbital.
- get_excitation_kets() list[Array][source]#
Get the ket excitation vectors for all orbitals.
- Returns:
List of ket excitation vectors for all orbitals.
See also
get_excitation_ket(): Function to get the ket excitation vector for a single orbital.
- build_gf_moments(nmom: int, store_vectors: bool = True, left: bool = False, reduction: Reduction = Reduction.NONE) Array[source]#
Build the moments of the Green’s function.
- Parameters:
nmom – Number of moments to compute.
store_vectors – Whether to store the vectors on disk. Storing the vectors makes the memory overhead scale worse, but the CPU overhead scales better.
left – Whether to use the left-handed Hamiltonian application.
reduction – Reduction to apply to the moments.
- Returns:
Moments of the Green’s function.
Notes
Unlike
dyson.representations.lehmann.Lehmann.moments(), this function takes the number of moments to compute as an argument, rather than a single order or list of orders. This is because in this case, the moments are computed recursively.
- build_gf_chebyshev_moments(nmom: int, store_vectors: bool = True, left: bool = False, scaling: tuple[float, float] | None = None, reduction: Reduction = Reduction.NONE) Array[source]#
Build the moments of the Green’s function using Chebyshev polynomials.
- Parameters:
nmom – Number of moments to compute.
store_vectors – Whether to store the vectors on disk. Storing the vectors makes the memory overhead scale worse, but the CPU overhead scales better.
left – Whether to use the left-handed Hamiltonian application.
scaling – Scaling factors to ensure the energy scale of the Lehmann representation is in
[-1, 1]. The scaling is applied as(energies - scaling[1]) / scaling[0]. IfNone, the default scaling is computed as(max(energies) - min(energies)) / (2.0 - 1e-3)and(max(energies) + min(energies)) / 2.0, respectively.reduction – Reduction to apply to the moments.
- Returns:
Chebyshev polynomial moments of the Green’s function.
Notes
Unlike
dyson.representations.lehmann.Lehmann.chebyshev_moments(), this function takes the number of moments to compute as an argument, rather than a single order or list of orders. This is because in this case, the moments are computed recursively.
- abstractmethod build_se_moments(nmom: int, reduction: Reduction = Reduction.NONE) Array[source]#
Build the self-energy moments.
- Parameters:
nmom – Number of moments to compute.
reduction – Reduction to apply to the moments.
- Returns:
Moments of the self-energy.
- abstract property mol: Mole#
Molecule object.