anchor.diff:     deallocate(work,iwork)
      allocate(work(lwork), iwork(liwork) )
   
  -   call dsygvd(1,'v','u',mo_tot_num,F,size(F,1),S,size(S,1),&
  +   call dsygvd(1,'v','u',ao_num,F,size(F,1),S,size(S,1),&
        diagonal_Fock_matrix_mo, work, lwork, iwork, liwork, info)
   
      if (info /= 0) then
        print *,  irp_here//' failed'
        stop 1
      endif
  -   do j=1,ao_num
  +   do j=1,mo_tot_num
        do i=1,ao_num
          eigenvectors_Fock_matrix_mo(i,j) = F(i,j)
        enddo
  
positive.code:  BEGIN_PROVIDER [ double precision, diagonal_Fock_matrix_mo, (mo_tot_num) ]
  &BEGIN_PROVIDER [ double precision, eigenvectors_Fock_matrix_mo, (ao_num_align,mo_tot_num) ]
     implicit none
     BEGIN_DOC
  
negative.code: 
     lwork = -1
     liwork = -1
     call dsygvd(1,'v','u',ao_num,F,size(F,1),S,size(S,1),&
       diagonal_Fock_matrix_mo, work, lwork, iwork, liwork, info)
  
     if (info /= 0) then
  