3
\brief Enter brief description of file here
6
* Revision 1.1 2000/02/04 22:52:32 evaleev
9
/* Revision 1.2 1999/08/17 19:04:17 evaleev
10
/* Changed the default symmetric orthogonalization to the canonical
11
/* orthogonalization. Now, if near-linear dependencies in the basis are found,
12
/* eigenvectors of the overlap matrix with eigenvalues less than 1E-6 will be
13
/* left out. This will lead to num_mo != num_so, i.e. SCF eigenvector is no
14
/* longer a square matrix. Had to rework some routines in libfile30, and add some.
15
/* The progrem prints out a warning if near-linear dependencies are found. TRANSQT
16
/* and a whole bunch of other codes has to be fixed to work with such basis sets.
18
/* Revision 1.1.1.1 1999/04/12 16:59:27 evaleev
19
/* Added a version of CSCF that can work with CINTS.
27
namespace psi { namespace cscf {
29
void check_rot(int nn, int num_mo, double **cold, double **cnew,
30
double *smat_pac, double *fock_evals, int irrep);
31
extern void formg_two(int iju, int* optest);
32
extern void formg_open();
36
int i,j,ij,k,nn,num_mo;
40
double **scr1,**scr2,**scr3;
44
scr1 = (double **) init_matrix(nsfmax,nsfmax);
45
scr2 = (double **) init_matrix(nsfmax,nsfmax);
46
scr3 = (double **) init_matrix(nsfmax,nsfmax);
51
/* optest = (int *) init_array(ioff[nbasis]/2); */
52
optest = (int *) init_int_array(ioff[nbasis]);
54
/* find open shells */
56
for (i=0; i < num_ir ; i++) {
57
iju += scf_info[i].num_so;
58
if(scf_info[i].nopen) {
64
/* set up array of flags indicating open shells */
66
for (k=0,joff=0; k < num_ir ; k++) {
69
for (i=0; i < nn ; i++)
70
for (j=0; j <= i ; j++)
71
if(s->nopen) optest[ioff[i+joff]+j+joff] = 1;
76
formg_two(iju,optest);
80
for(i=0; i < num_ir ; i++) {
86
add_arr(s->hmat,s->gmat,s->fock_pac,ioff[nn]);
88
tri_to_sq(s->fock_pac,scr1,nn);
89
mmult(s->cmat,1,scr1,0,scr2,0,num_mo,nn,nn,0);
90
mmult(scr2,0,s->cmat,0,scr1,0,num_mo,nn,num_mo,0);
93
for(j=0; j < nc ; j++)
94
for(k=0; k < nc ; k++)
95
scr2[j][k]=scr1[j][k];
96
for(j=nc; j < nc+no ; j++)
97
for(k=nc; k < nc+no ; k++)
98
scr2[j][k]=scr1[j][k];
99
for(j=nc+no; j < num_mo ; j++)
100
for(k=nc+no; k < num_mo ; k++)
101
scr2[j][k]=scr1[j][k];
103
sq_rsp(num_mo,num_mo,scr2,s->fock_evals,1,scr3,tol);
105
mmult(s->cmat,0,scr3,0,scr2,0,nn,num_mo,num_mo,0);
108
check_rot(nn, num_mo, s->cmat, scr2, s->smat, s->fock_evals, i);
110
for(j=0; j < nn ; j++)
111
for(k=0; k < num_mo ; k++)
112
s->cmat[j][k]=scr2[j][k];
116
free_matrix(scr1,nsfmax);
117
free_matrix(scr2,nsfmax);
118
free_matrix(scr3,nsfmax);
121
}} // namespace psi::cscf