dyson.expressions.hamiltonian#

Hamiltonian-driven expressions.

Classes

Hamiltonian(hamiltonian[, bra, ket])

Hamiltonian-driven expressions for the Green's function.

class dyson.expressions.hamiltonian.Hamiltonian(hamiltonian: Array | SparseArray, bra: Array | None = None, ket: Array | None = None)[source]#

Bases: BaseExpression

Hamiltonian-driven expressions for the Green’s function.

classmethod from_mf(mf: RHF) Hamiltonian[source]#

Create an expression from a mean-field object.

Parameters:

mf – Mean-field object.

Returns:

Expression object.

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.

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.

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 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_vector(orbital: int) Array#

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.

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 method to apply to the moments.

Returns:

Moments of the self-energy.

property mol: Mole#

Molecule object.

property non_dyson: bool#

Whether the expression produces a non-Dyson Green’s function.

property nphys: int#

Number of physical orbitals.

property nsingle: int#

Number of configurations in the singles sector.

property nconfig: int#

Number of configurations in the non-singles sectors.

property shape: tuple[int, int]#

Shape of the Hamiltonian matrix.

property nocc: int#

Number of occupied orbitals.

property nvir: int#

Number of virtual orbitals.