2021-02-18 19:43:20 +01:00
|
|
|
Sold = dlmread('Slater_old.dat');
|
|
|
|
Sold_inv = dlmread('Slater_old_inv.dat');
|
|
|
|
S = dlmread('Slater.dat');
|
|
|
|
S_inv = dlmread('Slater_inv.dat');
|
2021-09-30 16:36:18 +02:00
|
|
|
dim = columns(Sold);
|
2021-09-21 11:21:36 +02:00
|
|
|
cutoff = 1e-3;
|
2021-02-18 19:43:20 +01:00
|
|
|
|
2021-02-22 09:50:42 +01:00
|
|
|
printf("\n")
|
2021-09-21 11:21:36 +02:00
|
|
|
printf("============================================\n")
|
2021-02-22 09:50:42 +01:00
|
|
|
printf("OLD Slater-matrix and inverse\n")
|
2021-09-21 11:21:36 +02:00
|
|
|
printf("--------------------------------------------\n")
|
|
|
|
printf("Determinant of S x S_inv - Id : %f\n", det(Sold*Sold_inv-eye(dim)))
|
|
|
|
printf("Trace of S x S_inv - Id : %f\n", trace(Sold*Sold_inv-eye(dim)))
|
|
|
|
printf("Norm of S x S_inv - Id : %f\n", norm(Sold*Sold_inv-eye(dim)))
|
2021-02-18 19:43:20 +01:00
|
|
|
|
2021-09-30 16:36:18 +02:00
|
|
|
printf("\n")
|
|
|
|
printf("Cutoff set to %e: S x S_inv - Id = \n", cutoff)
|
|
|
|
printf("--------------------------------------------\n")
|
|
|
|
res=Sold*Sold_inv-eye(dim);
|
|
|
|
for i = 1:dim
|
|
|
|
for j = 1:dim
|
|
|
|
if ( abs(res(i,j)) < cutoff )
|
|
|
|
res(i,j) = 0;
|
|
|
|
elseif ( abs(res(i,j) - 1) < cutoff )
|
|
|
|
res(i,j) = 1;
|
|
|
|
endif
|
|
|
|
endfor
|
|
|
|
endfor
|
|
|
|
format free;
|
|
|
|
disp(res);
|
|
|
|
printf("===========================================\n")
|
|
|
|
|
|
|
|
|
2021-02-22 09:50:42 +01:00
|
|
|
printf("\n")
|
|
|
|
printf("NEW Slater-matrix and inverse\n")
|
2021-09-21 11:21:36 +02:00
|
|
|
printf("--------------------------------------------\n")
|
|
|
|
printf("Determinant of S x S_inv - Id : %f\n", det(S*S_inv-eye(dim)))
|
|
|
|
printf("Trace of S x S_inv - Id : %f\n", trace(S*S_inv-eye(dim)))
|
|
|
|
printf("Norm of S x S_inv - Id : %f\n", norm(S*S_inv-eye(dim)))
|
2021-03-12 12:38:50 +01:00
|
|
|
|
|
|
|
printf("\n")
|
2021-09-21 11:21:36 +02:00
|
|
|
printf("Cutoff set to %e: S x S_inv - Id = \n", cutoff)
|
|
|
|
printf("--------------------------------------------\n")
|
|
|
|
res=S*S_inv-eye(dim);
|
2021-03-12 12:38:50 +01:00
|
|
|
for i = 1:dim
|
|
|
|
for j = 1:dim
|
2021-09-21 11:21:36 +02:00
|
|
|
if (res(i,j) < cutoff)% && i!=j)
|
2021-03-12 12:38:50 +01:00
|
|
|
res(i,j) = 0;
|
|
|
|
endif
|
|
|
|
endfor
|
|
|
|
endfor
|
|
|
|
format free;
|
|
|
|
disp(res);
|
2021-09-21 11:21:36 +02:00
|
|
|
printf("===========================================\n")
|