spin_coupling Module

This module is for the calculation of spin configurations according to genealogical coupling written by Ludger Inhester in 2016 at DESY CFEL



Derived Types

type, public ::  umatrixtable

structure to keep precompute spin coupling matrices

Components

Type Visibility Attributes Name Initial
integer, public :: nopenmax

maximum numer of open shells

integer, public :: multp

spin multiplicity

integer, public, allocatable :: f(:)

number of spin configurations for multp for given number of open shells

integer, public, allocatable :: indn(:)

starting index for n open shells

real(kind=long), public, allocatable :: umatrix(:)

array containing Umarix data

real(kind=long), public, allocatable :: ucyclematrix(:)

array containing Umarix data


Functions

public pure function num_csf(nopen, multp)

returns the number of possible spin configurations

Arguments

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

number of open shells

integer, intent(in) :: multp

spin multiplicity

Return Value integer

number of configurations

public pure function csfdet(t, p)

returns the coefficient for determinant specified by determinant path P in csf specified by path T

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: t(:)
integer, intent(in) :: p(:)

Return Value real(kind=long)

public pure function detstring(occ, det) result(string)

returns a readable string for printing out determinant specified by occupation and determinant path det

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: occ(:)
integer, intent(in) :: det(:)

Return Value character(len=100)

public pure function csfstring(occ, csf) result(string)

returns printable string for a given spin configuration

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: occ(:)
integer, intent(in) :: csf(:)

Return Value character(len=size)


Subroutines

public subroutine constructumatrixtable(nopenmax, multp, ut)

make a table of coupling matrices for a set of transpositions of a set of maximal NopenMax un-paired electrons

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nopenmax
integer, intent(in) :: multp
type(umatrixtable), intent(out) :: ut

public subroutine purge_umatrixtable(ut)

deallocates Umatrixtable structure

Arguments

Type IntentOptional Attributes Name
type(umatrixtable), intent(inout) :: ut

public pure subroutine getumatrixfromtable(ut, n, mu, nu, u)

returns the coupling matrix for translocation mu-<nu using the previously prepared table UT

Arguments

Type IntentOptional Attributes Name
type(umatrixtable), intent(in) :: ut
integer, intent(in) :: n
integer, intent(in) :: mu
integer, intent(in) :: nu
real(kind=long), intent(out) :: u(:,:)

public pure subroutine getucyclematrixfromtable(ut, n, mu, nu, u)

returns the coupling matrix for translocation mu-<nu using the previously prepared table UT

Arguments

Type IntentOptional Attributes Name
type(umatrixtable), intent(in) :: ut
integer, intent(in) :: n
integer, intent(in) :: mu
integer, intent(in) :: nu
real(kind=long), intent(out) :: u(:,:)

public pure subroutine one_particle_dm(dm, occ, dets, csf)

returns the one-particle density matrix

Arguments

Type IntentOptional Attributes Name
real(kind=long), intent(out) :: dm(:,:)
integer, intent(in) :: occ(:)
integer, intent(in) :: dets(:,:)
integer, intent(in) :: csf(:)

public subroutine s_two_particle_dm(s_tpdm, occ, dets, csf)

symmetrized two particle density matrix

Arguments

Type IntentOptional Attributes Name
real(kind=long), intent(out) :: s_tpdm(:)
integer, intent(in) :: occ(:)
integer, intent(in) :: dets(:,:)
integer, intent(in) :: csf(:)

public pure subroutine nopen2dets(nopen, multp, dets)

routine calculates the genealogical pathes for all high spin determinants for given multiplicity multp with Nopen open shells. pathes are returned in arrays dets(1:Nopen,:) example pathes for multp=2 and Nopen=3 1,2,1 means spin up up down 1,0,1 means spin up down up -1,0,1 means spin down up up

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nopen
integer, intent(in) :: multp
integer, intent(out), allocatable :: dets(:,:)

public pure subroutine nopen2csfs(nopen, multp, csfs)

routine calculates the genealogical pathes for all configuration state functions for given multiplicity multp with Nopen open shells. pathes are returned in arrays csfs(1:Nopen, :) example pathes for multp=2 and Nopen=3 there are two spin configurations: 1,2,1 means spin configuration '//\' 1,0,1 means spin configuration '/\/'

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nopen
integer, intent(in) :: multp
integer, intent(out), allocatable :: csfs(:,:)

public pure subroutine spin_string(occ, det, spin_string_a, spin_string_b, sign)

returns a determinant given in genealogical path as alpha and beta strings plus sign

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: occ(:)
integer, intent(in) :: det(:)
integer, intent(out) :: spin_string_a(:)
integer, intent(out) :: spin_string_b(:)
integer, intent(inout) :: sign

public pure subroutine compare_det(coef_sign, only_left, only_left_spin, only_right, only_right_spin, left_occ, left_det, right_occ, right_det)

compares two determinants specified by determinant path left_det(1:Nopen) right_det(1:Nopen) and occupation left_occ(:) and right_occ(:), respectively. only_left(1:M) and only_right(1:M) returns the orbital indices of electrons that are only present in left and right determinant only_left_spin(1:M) and only_right_spin(1:M) the respective spin of the electrons coef_sign returns the sign produced by flips to bring the determinants into best congruence. The array length M can be arbitrarily. When the number of electrons only present in one determinant exceeds M comparison is quit and coef_sign=0 is returned

Arguments

Type IntentOptional Attributes Name
integer, intent(out) :: coef_sign
integer, intent(out) :: only_left(:)
integer, intent(out) :: only_left_spin(:)
integer, intent(out) :: only_right(:)
integer, intent(out) :: only_right_spin(:)
integer, intent(in) :: left_occ(:)
integer, intent(in) :: left_det(:)
integer, intent(in) :: right_occ(:)
integer, intent(in) :: right_det(:)

public pure subroutine makecycleuij(ut, oi, oj, nsingle, u, yes_cache)

computes coupling matrix for transposition uj->ui oj is moved down to position oi

Arguments

Type IntentOptional Attributes Name
type(umatrixtable), intent(in) :: ut
integer, intent(in) :: oi
integer, intent(in) :: oj
integer, intent(in) :: nsingle
real(kind=long), intent(out) :: u(:,:)
logical, intent(in), optional :: yes_cache