diff --git a/src/dav_general_mat/README.rst b/src/dav_general_mat/README.rst index 5407a206..e528109f 100644 --- a/src/dav_general_mat/README.rst +++ b/src/dav_general_mat/README.rst @@ -1,4 +1,13 @@ -======== -test_dav -======== +=============== +dav_general_mat +=============== + +This modules allows to use the Davidson Algorithm for general squared symmetric matrices +You have two options : + a) the routine "davidson_general" to whom you pass the matrix you want to diagonalize + b) the routine "davidson_general_ext_rout" to whom you pass the subroutine that realizes v = H u + +See the routines in "test_dav.irp.f" for a clear example. + + diff --git a/src/dav_general_mat/test_dav.irp.f b/src/dav_general_mat/test_dav.irp.f index 7c2b8b9d..0a7faaf0 100644 --- a/src/dav_general_mat/test_dav.irp.f +++ b/src/dav_general_mat/test_dav.irp.f @@ -22,11 +22,14 @@ subroutine routine sze = N_det dim_in = sze dressing_state = 0 + !!!! MARK THAT u_in mut dimensioned with "N_st_diag_in" as a second dimension allocate(u_in(dim_in,N_st_diag_in),H_jj(sze),h_mat(sze,sze),energies(N_st)) u_in = 0.d0 do i = 1, N_st u_in(1,i) = 1.d0 enddo + !!! Matrix "h_mat" is the matrix we want to diagonalize with the first routine + !!! "davidson_general" do i = 1, sze do j = 1, sze h_mat(j,i) = H_matrix_all_dets(j,i) @@ -37,6 +40,8 @@ subroutine routine provide nthreads_davidson call davidson_general(u_in,H_jj,energies,dim_in,sze,N_st,N_st_diag_in,converged,h_mat) print*,'energies = ',energies + !!! hcalc_template is the routine that computes v = H u + !!! and you can use the routine "davidson_general_ext_rout" call davidson_general_ext_rout(u_in,H_jj,energies,dim_in,sze,N_st,N_st_diag_in,converged,hcalc_template) print*,'energies = ',energies end