@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.
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() |
@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.
@brief Excitations further than max_excit_rank should return 0
@param[in] exc
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nEl) | |||
type(Excite_Further_t), | intent(in) | :: | exc |
@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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(SpinOrbIdx_t), | intent(in) | :: | ref | |||
type(Excite_1_t), | intent(in) | :: | exc | |||
logical, | intent(in) | :: | 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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(SpinOrbIdx_t), | intent(in) | :: | ref | |||
type(Excite_2_t), | intent(in) | :: | exc | |||
logical, | intent(in) | :: | tParity |
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() |
Evaluate the energy of a new determinant Dj quickly.
The calculation of a diagonal term of the hamiltonian, scales quadratically with the number of particles O(N2e). Often we start from a determinant Di, where we know the diagonal term, and excite to a new determinant Dj. Under this circumstance we can calculate the diagonal element of Dj in O(Ne) 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 ⟨Di|ˆH|Di⟩=∑I∈DihII+12∑I∈Di∑J∈Di(gIIJJ−gIJJI)
We want to calculate ⟨Dj|ˆH|Dj⟩−⟨Di|ˆH|Di⟩. Which we do by separately calculating the difference for the one- and two-electron term.
We can rewrite the one-electron term as: ∑I∈DihII=∑I∈Di∩DjhII+∑I∈Di∖DjhII Which gives ∑J∈DjhJJ−∑I∈DihII=∑J∈Dj∖DihJJ−∑I∈Di∖DjhII=∑J∈tgthJJ−∑I∈srchII
For the two electron term we define γIJ=(gIIJJ−gIJJI) and note the two properties γIJ=γJI γII=0
We write 12∑I∈Di∑J∈DiγIJ=12[∑I∈Di∩Dj∑J∈Di∩DjγIJ+∑I∈Di∩Dj∑J∈Di∖DjγIJ+∑I∈Di∖Dj∑J∈Di∩DjγIJ+∑I∈Di∖Dj∑J∈Di∖DjγIJ] =12[∑I∈Di∩Dj∑J∈Di∩DjγIJ+2(∑I∈Di∩Dj∑J∈Di∖DjγIJ)+∑I∈Di∖Dj∑J∈Di∖DjγIJ] In the last equality we used γIJ=γJI.
For the difference we get: 12∑I∈Dj∑J∈DjγIJ−12∑I∈Di∑J∈DiγIJ=12[2(∑I∈Di∩Dj∑J∈Dj∖DiγIJ)+∑I∈Dj∖Di∑J∈Dj∖DiγIJ−2(∑I∈Di∩Dj∑J∈Di∖DjγIJ)−∑I∈Di∖Dj∑J∈Di∖DjγIJ] =∑I∈Di∩Dj(∑J∈Dj∖DiγIJ−∑J∈Di∖DjγIJ)+∑I∈Dj∖Di∑J∈Dj∖Di,I<JγIJ−∑I∈Di∖Dj∑J∈Di∖Dj,I<JγIJ =∑I∈Di∩Dj(∑J∈tgtγIJ−∑J∈srcγIJ)+∑I∈tgt∑J∈tgt,I<JγIJ−∑I∈src∑J∈src,I<JγIJ
In total we obtain ⟨Dj|ˆH|Dj⟩−⟨Di|ˆH|Di⟩=∑J∈tgthJJ−∑I∈srchII+∑I∈Di∩Dj(∑J∈tgtγIJ−∑J∈srcγIJ)+∑I∈tgt∑J∈tgt,I<JγIJ−∑I∈src∑J∈src,I<JγIJ
Type | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|
procedure(diagH_after_exc_1_t), | pointer | :: | diagH_after_exc_1 | => | null() | |
procedure(diagH_after_exc_2_t), | pointer | :: | diagH_after_exc_2 | => | null() | |
procedure(diagH_after_exc_3_t), | pointer | :: | diagH_after_exc_3 | => | null() |
Type | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|
procedure(nI_invariant_sltcnd_2_t), | pointer | :: | nI_invariant_sltcnd_2 | => | null() | |
procedure(nI_invariant_sltcnd_3_t), | pointer | :: | nI_invariant_sltcnd_3 | => | null() |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_0_t), | intent(in) | :: | exc |
Type | Intent | Optional | 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. |
Type | Intent | Optional | 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. |
Type | Intent | Optional | 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. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nEl) | |||
real(kind=dp), | intent(in) | :: | E_0 | |||
type(Excite_1_t), | intent(in) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nEl) | |||
real(kind=dp), | intent(in) | :: | E_0 | |||
type(Excite_2_t), | intent(in) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nEl) | |||
real(kind=dp), | intent(in) | :: | E_0 | |||
type(Excite_3_t), | intent(in) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Excite_2_t), | intent(in) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Excite_3_t), | intent(in) | :: | exc |
Return the two-electron integral.
Type | Intent | Optional | 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 |
returns the adjoint sltcnd of the given rank: 1
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_1_t), | intent(in) | :: | ex | |||
logical, | intent(in) | :: | tSign | |||
logical, | intent(in), | optional | :: | assert_occupation |
returns the adjoint sltcnd of the given rank: 2
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_2_t), | intent(in) | :: | ex | |||
logical, | intent(in) | :: | tSign | |||
logical, | intent(in), | optional | :: | assert_occupation |
returns the adjoint sltcnd of the given rank: 3
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_3_t), | intent(in) | :: | ex | |||
logical, | intent(in) | :: | tSign | |||
logical, | intent(in), | optional | :: | assert_occupation |
Returns the adjoint for the diagonal element ⟨Di|ˆH|Di⟩
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_0_t), | intent(in) | :: | ex |
@brief Evaluate Matrix Element for different excitations using the Slater-Condon rules.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ref(nel) | |||
class(Excitation_t), | intent(in) | :: | exc | |||
logical, | intent(in) | :: | tParity | |||
logical, | intent(in), | optional | :: | assert_occupation |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
integer, | intent(in) | :: | IC | |||
integer, | intent(in), | optional | :: | ex(2,ic) | ||
logical, | intent(in), | optional | :: | tParity |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
integer, | intent(in) | :: | nJ(nel) | |||
integer, | intent(in) | :: | IC |
Type | Intent | Optional | 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 |
Type | Intent | Optional | 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 |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | Orb | |||
integer, | intent(in) | :: | HFDet(nel) |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
integer, | intent(in) | :: | HFDet(nel) |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_0_t), | intent(in) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_1_t), | intent(in) | :: | ex | |||
logical, | intent(in) | :: | tSign | |||
logical, | intent(in), | optional | :: | assert_occupation |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_1_t), | intent(in) | :: | ex |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Excite_2_t), | intent(in) | :: | ex |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Excite_2_t), | intent(in) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_0_t), | intent(in) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_1_t), | intent(in) | :: | ex | |||
logical, | intent(in) | :: | tSign | |||
logical, | intent(in), | optional | :: | assert_occupation |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_2_t), | intent(in) | :: | exc | |||
logical, | intent(in) | :: | tSign | |||
logical, | intent(in), | optional | :: | assert_occupation |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_3_t), | intent(in) | :: | ex | |||
logical, | intent(in) | :: | tSign | |||
logical, | intent(in), | optional | :: | assert_occupation |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Excite_3_t), | intent(in) | :: | ex |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_2_t), | intent(in) | :: | ex | |||
logical, | intent(in) | :: | tSign | |||
logical, | intent(in), | optional | :: | assert_occupation |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_3_t), | intent(in) | :: | ex | |||
logical, | intent(in) | :: | tSign | |||
logical, | intent(in), | optional | :: | assert_occupation |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_0_t), | intent(in) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_1_t), | intent(in) | :: | ex | |||
logical, | intent(in) | :: | tSign | |||
logical, | intent(in), | optional | :: | assert_occupation |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_1_t) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_2_t), | intent(in) | :: | ex | |||
logical, | intent(in) | :: | tSign | |||
logical, | intent(in), | optional | :: | assert_occupation |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Excite_2_t), | intent(in) | :: | ex |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_2_t), | intent(in) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_0_t), | intent(in) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_1_t), | intent(in) | :: | exc | |||
logical, | intent(in) | :: | tSign | |||
logical, | intent(in), | optional | :: | assert_occupation |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_2_t), | intent(in) | :: | ex | |||
logical, | intent(in) | :: | tSign | |||
logical, | intent(in), | optional | :: | assert_occupation |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nEl) | |||
type(Excite_3_t), | intent(in) | :: | ex | |||
logical, | intent(in) | :: | tSign | |||
logical, | intent(in), | optional | :: | assert_occupation |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_0_t), | intent(in) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nel) | |||
type(Excite_0_t), | intent(in) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Excite_2_t), | intent(in) | :: | exc |
@brief Evaluate Matrix Element for Excite_1_t.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(SpinOrbIdx_t), | intent(in) | :: | ref | |||
type(Excite_1_t), | intent(in) | :: | exc | |||
logical, | intent(in) | :: | tParity |
@brief Evaluate Matrix Element for Excite_2_t.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(SpinOrbIdx_t), | intent(in) | :: | ref | |||
type(Excite_2_t), | intent(in) | :: | exc | |||
logical, | intent(in) | :: | tParity |
@brief Excitations further than max_excit_rank should return 0
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nEl) | |||
type(Excite_Further_t), | intent(in) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nEl) | |||
real(kind=dp), | intent(in) | :: | E_0 | |||
type(Excite_1_t), | intent(in) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nEl) | |||
real(kind=dp), | intent(in) | :: | E_0 | |||
type(Excite_2_t), | intent(in) | :: | exc |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nI(nEl) | |||
real(kind=dp), | intent(in) | :: | E_0 | |||
type(Excite_3_t), | intent(in) | :: | exc |