5
namespace psi{ namespace mcscf{
7
void SCF::construct_S_inverse_sqrt()
9
SBlockVector lambda("lambda",nirreps,sopi);
10
SBlockMatrix L("L",nirreps,sopi,sopi);
11
SBlockMatrix Lambda("Lambda",nirreps,sopi,sopi);
13
S.diagonalize(L,lambda);
18
for(int h = 0; h < nirreps; ++h){
19
for(int i = 0; i < sopi[h]; ++i){
20
Lambda->set(h, i, i, 1.0 / sqrt(lambda->get(h,i)) );
25
T.multiply(false,true,Lambda,L);
26
S_sqrt_inv.multiply(false,false,L,T);
28
for(int h = 0; h < nirreps; ++h){
29
for(int i = 0; i < sopi[h]; ++i){
30
Lambda->set(h, i, i, sqrt(lambda->get(h,i)) );
34
T.multiply(false,true,Lambda,L);
35
S_sqrt.multiply(false,false,L,T);
38
}} /* End Namespaces */