sltcnd_mod Module

@brief A module to evaluate the Slater-Condon Rules.

@details Heavily relies on the excitation_types module to represent different excitations.

The main functions are sltcnd_excit and dyn_sltcnd_excit. Because sltcnd_excit dispatches statically at compile time, depending on the excitation type, it is the preferred function, if the excitation level is known at compile time.

If the excitation level is not known at compile time, use dyn_sltcnd_excit which accepts a polymorphic excitation_t class.

The procedures create_excitation, get_excitation, and get_bit_excitation from the excitation_types module can be used, to create excitations from nIs, or iluts at runtime.



Contents


Variables

Type Visibility Attributes Name Initial
procedure(sltcnd_0_t), private, pointer :: sltcnd_0 => null()
procedure(sltcnd_0_t), private, pointer :: nonadjoint_sltcnd_0 => null()
procedure(sltcnd_1_t), private, pointer :: sltcnd_1 => null()
procedure(sltcnd_1_t), private, pointer :: nonadjoint_sltcnd_1 => null()
procedure(sltcnd_2_t), private, pointer :: sltcnd_2 => null()
procedure(sltcnd_2_t), private, pointer :: nonadjoint_sltcnd_2 => null()
procedure(sltcnd_3_t), private, pointer :: sltcnd_3 => null()
procedure(sltcnd_3_t), private, pointer :: nonadjoint_sltcnd_3 => null()
procedure(nI_invariant_sltcnd_2_t), private, pointer :: nI_invariant_sltcnd_2 => null()
procedure(nI_invariant_sltcnd_3_t), private, pointer :: nI_invariant_sltcnd_3 => null()
procedure(diagH_after_exc_1_t), private, pointer :: diagH_after_exc_1 => null()
procedure(diagH_after_exc_2_t), private, pointer :: diagH_after_exc_2 => null()
procedure(diagH_after_exc_3_t), private, pointer :: diagH_after_exc_3 => null()

Interfaces

public interface sltcnd_excit

@brief Evaluate Matrix Element for different excitations using the Slater-Condon rules.

@details This generic function uses compile time dispatch. This means that exc cannot be just of class(Excitation_t) but has to be a proper non-polymorphic type. For run time dispatch use dyn_sltcnd_excit.

@param[in] exc, An excitation of a subtype of Excitation_t.

  • private function sltcnd_excit_Excite_Further_t(nI, exc)

    @brief Excitations further than max_excit_rank should return 0

    @param[in] exc

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: nI(nEl)
    type(Excite_Further_t), intent(in) :: exc

    Return Value real(kind=dp)

  • private function sltcnd_excit_SpinOrbIdx_t_Excite_1_t(ref, exc, tParity)

    @brief Evaluate Matrix Element for Excite_1_t.

    @param[in] ref, The occupied spin orbitals of the reference. @param[in] exc, An excitation of type Excite_1_t. @param[in] tParity, The parity of the excitation.

    Arguments

    Type IntentOptional Attributes Name
    type(SpinOrbIdx_t), intent(in) :: ref
    type(Excite_1_t), intent(in) :: exc
    logical, intent(in) :: tParity

    Return Value real(kind=dp)

  • private function sltcnd_excit_SpinOrbIdx_t_Excite_2_t(ref, exc, tParity)

    @brief Evaluate Matrix Element for Excite_2_t.

    @param[in] ref, The occupied spin orbitals of the reference. @param[in] exc, An excitation of type Excite_2_t. @param[in] tParity, The parity of the excitation.

    Arguments

    Type IntentOptional Attributes Name
    type(SpinOrbIdx_t), intent(in) :: ref
    type(Excite_2_t), intent(in) :: exc
    logical, intent(in) :: tParity

    Return Value real(kind=dp)

  • Dummy Procedures and Procedure Pointers

    Type Attributes Name Initial
    procedure(sltcnd_0_t), pointer :: sltcnd_0 => null()
    procedure(sltcnd_1_t), pointer :: sltcnd_1 => null()
    procedure(sltcnd_2_t), pointer :: sltcnd_2 => null()
    procedure(sltcnd_3_t), pointer :: sltcnd_3 => null()

public interface diagH_after_exc

Evaluate the energy of a new determinant quickly.

The calculation of a diagonal term of the hamiltonian, scales quadratically with the number of particles . Often we start from a determinant , where we know the diagonal term, and excite to a new determinant . Under this circumstance we can calculate the diagonal element of in time.

In the following we will derive the necessary equations. We assume the notations and conventions of the “purple book” (Helgaker et al). The diagonal term for a determinant is given as

We want to calculate . Which we do by separately calculating the difference for the one- and two-electron term.

We can rewrite the one-electron term as: Which gives

For the two electron term we define and note the two properties

We write In the last equality we used .

For the difference we get:

In total we obtain

public interface nI_invariant_sltcnd_excit


Abstract Interfaces

abstract interface

  • private function sltcnd_0_t(nI, exc)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: nI(nel)
    type(Excite_0_t), intent(in) :: exc

    Return Value real(kind=dp)

abstract interface

  • private function sltcnd_1_t(nI, exc, tParity, assert_occupation) result(hel)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: nI(nel)
    type(Excite_1_t), intent(in) :: exc
    logical, intent(in) :: tParity
    logical, intent(in), optional :: assert_occupation

    This argument is only used in debug mode. It ensures that src_i are indeed occupied and tgt_i are unoccupied. It is on by default.

    Return Value real(kind=dp)

abstract interface

  • private function sltcnd_2_t(nI, exc, tParity, assert_occupation) result(hel)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: nI(nel)
    type(Excite_2_t), intent(in) :: exc
    logical, intent(in) :: tParity
    logical, intent(in), optional :: assert_occupation

    This argument is only used in debug mode. It ensures that src_i are indeed occupied and tgt_i are unoccupied. It is on by default.

    Return Value real(kind=dp)

abstract interface

  • private function sltcnd_3_t(nI, exc, tParity, assert_occupation) result(hel)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: nI(nel)
    type(Excite_3_t), intent(in) :: exc
    logical, intent(in) :: tParity
    logical, intent(in), optional :: assert_occupation

    This argument is only used in debug mode. It ensures that src_i are indeed occupied and tgt_i are unoccupied. It is on by default.

    Return Value real(kind=dp)

abstract interface

  • private function diagH_after_exc_1_t(nI, E_0, exc)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: nI(nEl)
    real(kind=dp), intent(in) :: E_0
    type(Excite_1_t), intent(in) :: exc

    Return Value real(kind=dp)

abstract interface

  • private function diagH_after_exc_2_t(nI, E_0, exc)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: nI(nEl)
    real(kind=dp), intent(in) :: E_0
    type(Excite_2_t), intent(in) :: exc

    Return Value real(kind=dp)

abstract interface

  • private function diagH_after_exc_3_t(nI, E_0, exc)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: nI(nEl)
    real(kind=dp), intent(in) :: E_0
    type(Excite_3_t), intent(in) :: exc

    Return Value real(kind=dp)

abstract interface

  • private function nI_invariant_sltcnd_2_t(exc) result(hel)

    Arguments

    Type IntentOptional Attributes Name
    type(Excite_2_t), intent(in) :: exc

    Return Value real(kind=dp)

abstract interface

  • private function nI_invariant_sltcnd_3_t(exc) result(hel)

    Arguments

    Type IntentOptional Attributes Name
    type(Excite_3_t), intent(in) :: exc

    Return Value real(kind=dp)


Functions

private elemental function get_2el(src1, tgt1, src2, tgt2)

Return the two-electron integral.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: src1

The index conventions can be seen here

integer, intent(in) :: tgt1

The index conventions can be seen here

integer, intent(in) :: src2

The index conventions can be seen here

integer, intent(in) :: tgt2

The index conventions can be seen here

Return Value real(kind=dp)

private function adjoint_sltcnd_1(nI, ex, tSign, assert_occupation) result(hel)

returns the adjoint sltcnd of the given rank: 1

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_1_t), intent(in) :: ex
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation

Return Value real(kind=dp)

private function adjoint_sltcnd_2(nI, ex, tSign, assert_occupation) result(hel)

returns the adjoint sltcnd of the given rank: 2

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_2_t), intent(in) :: ex
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation

Return Value real(kind=dp)

private function adjoint_sltcnd_3(nI, ex, tSign, assert_occupation) result(hel)

returns the adjoint sltcnd of the given rank: 3

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_3_t), intent(in) :: ex
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation

Return Value real(kind=dp)

private function adjoint_sltcnd_0(nI, ex) result(hel)

Returns the adjoint for the diagonal element

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_0_t), intent(in) :: ex

Return Value real(kind=dp)

public function dyn_sltcnd_excit(ref, exc, tParity, assert_occupation) result(hel)

@brief Evaluate Matrix Element for different excitations using the Slater-Condon rules.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ref(nel)
class(Excitation_t), intent(in) :: exc
logical, intent(in) :: tParity
logical, intent(in), optional :: assert_occupation

Return Value real(kind=dp)

public function dyn_sltcnd_excit_old(nI, IC, ex, tParity) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
integer, intent(in) :: IC
integer, intent(in), optional :: ex(2,ic)
logical, intent(in), optional :: tParity

Return Value real(kind=dp)

public function sltcnd_compat(nI, nJ, IC) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
integer, intent(in) :: nJ(nel)
integer, intent(in) :: IC

Return Value real(kind=dp)

public function sltcnd_knowIC(nI, iLutI, iLutJ, IC) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
integer(kind=n_int), intent(in) :: iLutI(0:NIfTot)
integer(kind=n_int), intent(in) :: iLutJ(0:NIfTot)
integer, intent(in) :: IC

Return Value real(kind=dp)

public function sltcnd(nI, iLutI, iLutJ, ICret)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
integer(kind=n_int), intent(in) :: iLutI(0:NIfTot)
integer(kind=n_int), intent(in) :: iLutJ(0:NIfTot)
integer, intent(out), optional :: ICret

Return Value real(kind=dp)

public pure function CalcFockOrbEnergy(Orb, HFDet) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: Orb
integer, intent(in) :: HFDet(nel)

Return Value real(kind=dp)

public pure function SumFock(nI, HFDet) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
integer, intent(in) :: HFDet(nel)

Return Value real(kind=dp)

public pure function sltcnd_0_base(nI, exc) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_0_t), intent(in) :: exc

Return Value real(kind=dp)

private function sltcnd_1_base(nI, ex, tSign, assert_occupation) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_1_t), intent(in) :: ex
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation

Return Value real(kind=dp)

private function sltcnd_1_kernel(nI, ex) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_1_t), intent(in) :: ex

Return Value real(kind=dp)

private function nI_invariant_sltcnd_2_base(ex) result(hel)

Arguments

Type IntentOptional Attributes Name
type(Excite_2_t), intent(in) :: ex

Return Value real(kind=dp)

public function sltcnd_2_kernel(exc) result(hel)

Arguments

Type IntentOptional Attributes Name
type(Excite_2_t), intent(in) :: exc

Return Value real(kind=dp)

public function sltcnd_0_tc(nI, exc) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_0_t), intent(in) :: exc

Return Value real(kind=dp)

private function sltcnd_1_tc(nI, ex, tSign, assert_occupation) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_1_t), intent(in) :: ex
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation

Return Value real(kind=dp)

private function sltcnd_2_tc(nI, exc, tSign, assert_occupation) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_2_t), intent(in) :: exc
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation

Return Value real(kind=dp)

private function sltcnd_3_tc(nI, ex, tSign, assert_occupation) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_3_t), intent(in) :: ex
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation

Return Value real(kind=dp)

private function nI_invariant_sltcnd_3_base(ex) result(hel)

Arguments

Type IntentOptional Attributes Name
type(Excite_3_t), intent(in) :: ex

Return Value real(kind=dp)

private function sltcnd_2_use_nI_invariant(nI, ex, tSign, assert_occupation) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_2_t), intent(in) :: ex
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation

Return Value real(kind=dp)

private function sltcnd_3_use_nI_invariant(nI, ex, tSign, assert_occupation) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_3_t), intent(in) :: ex
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation

Return Value real(kind=dp)

private pure function sltcnd_0_base_ua(nI, exc) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_0_t), intent(in) :: exc

Return Value real(kind=dp)

private function sltcnd_1_base_ua(nI, ex, tSign, assert_occupation) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_1_t), intent(in) :: ex
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation

Return Value real(kind=dp)

private function sltcnd_1_kernel_ua(nI, exc) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_1_t) :: exc

Return Value real(kind=dp)

private function sltcnd_2_base_ua(nI, ex, tSign, assert_occupation) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_2_t), intent(in) :: ex
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation

Return Value real(kind=dp)

private function sltcnd_2_kernel_ua(ex) result(hel)

Arguments

Type IntentOptional Attributes Name
type(Excite_2_t), intent(in) :: ex

Return Value real(kind=dp)

private function sltcnd_2_kernel_ua_3b(nI, exc) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_2_t), intent(in) :: exc

Return Value real(kind=dp)

private pure function sltcnd_0_tc_ua(nI, exc) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_0_t), intent(in) :: exc

Return Value real(kind=dp)

private function sltcnd_1_tc_ua(nI, exc, tSign, assert_occupation) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_1_t), intent(in) :: exc
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation

Return Value real(kind=dp)

private function sltcnd_2_tc_ua(nI, ex, tSign, assert_occupation) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_2_t), intent(in) :: ex
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation

Return Value real(kind=dp)

private function sltcnd_3_tc_ua(nI, ex, tSign, assert_occupation) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nEl)
type(Excite_3_t), intent(in) :: ex
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation

Return Value real(kind=dp)

private function sltcnd_0_purify_spin_only_ladder(nI, exc) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_0_t), intent(in) :: exc

Return Value real(kind=dp)

private function sltcnd_0_purify_spin_full_s2(nI, exc) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_0_t), intent(in) :: exc

Return Value real(kind=dp)

private function nI_invariant_sltcnd_2_purify_spin(exc) result(hel)

Arguments

Type IntentOptional Attributes Name
type(Excite_2_t), intent(in) :: exc

Return Value real(kind=dp)

private function sltcnd_excit_SpinOrbIdx_t_Excite_1_t(ref, exc, tParity)

@brief Evaluate Matrix Element for Excite_1_t.

Read more…

Arguments

Type IntentOptional Attributes Name
type(SpinOrbIdx_t), intent(in) :: ref
type(Excite_1_t), intent(in) :: exc
logical, intent(in) :: tParity

Return Value real(kind=dp)

private function sltcnd_excit_SpinOrbIdx_t_Excite_2_t(ref, exc, tParity)

@brief Evaluate Matrix Element for Excite_2_t.

Read more…

Arguments

Type IntentOptional Attributes Name
type(SpinOrbIdx_t), intent(in) :: ref
type(Excite_2_t), intent(in) :: exc
logical, intent(in) :: tParity

Return Value real(kind=dp)

private function sltcnd_excit_Excite_Further_t(nI, exc)

@brief Excitations further than max_excit_rank should return 0

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nEl)
type(Excite_Further_t), intent(in) :: exc

Return Value real(kind=dp)

private pure function diagH_after_exc_1_base(nI, E_0, exc) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nEl)
real(kind=dp), intent(in) :: E_0
type(Excite_1_t), intent(in) :: exc

Return Value real(kind=dp)

private pure function diagH_after_exc_2_base(nI, E_0, exc) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nEl)
real(kind=dp), intent(in) :: E_0
type(Excite_2_t), intent(in) :: exc

Return Value real(kind=dp)

private pure function diagH_after_exc_3_base(nI, E_0, exc) result(hel)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nEl)
real(kind=dp), intent(in) :: E_0
type(Excite_3_t), intent(in) :: exc

Return Value real(kind=dp)


Subroutines

public subroutine initSltCndPtr()

Arguments

None