<commit_before>BEGIN_PROVIDER [double precision, mo_nucl_elec_integral, (mo_tot_num_align,mo_tot_num)]
 implicit none
 integer :: i1,j1,i,j
 double precision :: c_i1,c_j1
 BEGIN_DOC
! interaction nuclear electron on the MO basis
 END_DOC

 mo_nucl_elec_integral = 0.d0
 !$OMP PARALLEL DO DEFAULT(none) &
 !$OMP PRIVATE(i,j,i1,j1,c_j1,c_i1) &
 !$OMP SHARED(mo_tot_num,ao_num,mo_coef, &
 !$OMP   mo_nucl_elec_integral, ao_nucl_elec_integral)
 do i = 1, mo_tot_num
   do j = 1, mo_tot_num
    do i1 = 1,ao_num
     c_i1 = mo_coef(i1,i)
     do j1 = 1,ao_num
       c_j1 = c_i1*mo_coef(j1,j)
       mo_nucl_elec_integral(j,i) = mo_nucl_elec_integral(j,i) + &
                             c_j1 * ao_nucl_elec_integral(j1,i1)
     enddo
    enddo
   enddo
 enddo
 !$OMP END PARALLEL DO
END_PROVIDER


BEGIN_PROVIDER [double precision, mo_nucl_elec_integral_per_atom, (mo_tot_num_align,mo_tot_num,nucl_num)]
 implicit none
 integer :: i1,j1,i,j,k
 double precision :: c_i1,c_j1
 BEGIN_DOC
! mo_nucl_elec_integral_per_atom(i,j,k) = -<MO(i)|1/|r-Rk|MO(j)> 
! where Rk is the geometry of the kth atom
 END_DOC

 mo_nucl_elec_integral_per_atom = 0.d0
 do k = 1, nucl_num 
 !$OMP PARALLEL DO DEFAULT(none) &
 !$OMP PRIVATE(i,j,i1,j1,c_j1,c_i1) &
 !$OMP SHARED(mo_tot_num,ao_num,mo_coef, &
 !$OMP   mo_nucl_elec_integral_per_atom, ao_nucl_elec_integral_per_atom,k)
  do i = 1, mo_tot_num
    do j = 1, mo_tot_num
     do i1 = 1,ao_num
      c_i1 = mo_coef(i1,i)
      do j1 = 1,ao_num
        c_j1 = c_i1*mo_coef(j1,j)
        mo_nucl_elec_integral_per_atom(j,i,k) = mo_nucl_elec_integral_per_atom(j,i,k) + &
                                            c_j1 * ao_nucl_elec_integral_per_atom(j1,i1,k)
      enddo
     enddo
    enddo
  enddo
 !$OMP END PARALLEL DO
 enddo
END_PROVIDER
<commit_msg>Accelerated pot_mo_ints.irp.f<commit_after>BEGIN_PROVIDER [double precision, mo_nucl_elec_integral, (mo_tot_num_align,mo_tot_num)]
 implicit none
 integer :: i1,j1,i,j
 double precision :: c_i1,c_j1
 BEGIN_DOC
! interaction nuclear electron on the MO basis
 END_DOC

 double precision, allocatable :: X(:,:)
 allocate(X(ao_num_align,mo_tot_num))

 call dgemm('N','N',ao_num,mo_tot_num,ao_num,                        &
     1.d0,                                                           &
     ao_nucl_elec_integral, size(ao_nucl_elec_integral,1),           &
     mo_coef,size(mo_coef,1),                                        &
     0.d0, X, size(X,1))

 call dgemm('T','N',mo_tot_num,mo_tot_num,ao_num,                    &
     1.d0,                                                           &
     mo_coef,size(mo_coef,1),                                        &
     X, size(X,1),                                                   &
     0.d0, mo_nucl_elec_integral, size(mo_nucl_elec_integral,1))

 deallocate(X)

END_PROVIDER


BEGIN_PROVIDER [double precision, mo_nucl_elec_integral_per_atom, (mo_tot_num_align,mo_tot_num,nucl_num)]
 implicit none
 integer :: i1,j1,i,j,k
 double precision :: c_i1,c_j1
 BEGIN_DOC
! mo_nucl_elec_integral_per_atom(i,j,k) = -<MO(i)|1/|r-Rk|MO(j)> 
! where Rk is the geometry of the kth atom
 END_DOC

 allocate(X(ao_num_align,mo_tot_num))
 double precision, allocatable  :: X(:,:)
 
 do k = 1, nucl_num
   
   call dgemm('N','N',ao_num,mo_tot_num,ao_num,                      &
       1.d0,                                                         &
       ao_nucl_elec_integral_per_atom, size(ao_nucl_elec_integral_per_atom,1),&
       mo_coef,size(mo_coef,1),                                      &
       0.d0, X, size(X,1))
   
   call dgemm('T','N',mo_tot_num,mo_tot_num,ao_num,                  &
       1.d0,                                                         &
       mo_coef,size(mo_coef,1),                                      &
       X, size(X,1),                                                 &
       0.d0, mo_nucl_elec_integral_per_atom(1,1,k), size(mo_nucl_elec_integral_per_atom,1))
   
 enddo

 deallocate(X)
END_PROVIDER

{'fraction_non_alphanumeric': 0.10218978102189781, 'fraction_numerical': 0.022652907123080795, 'mean_word_length': 2.189406099518459, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4029107', 'n_tokens_mistral': 1662, 'n_tokens_neox': 1585, 'n_words': 241}