[CP2K-user] help with density matrix of dbcsr_type_no_symmetry and hfx_energy calculation

pavan.... at gmail.com pavan.... at gmail.com
Mon Feb 25 23:45:31 UTC 2019

Hello CP2K Developers,

I am working on calculating electronic coupling element using a 
transformation of MO sets obtained for two different states A and B (in 
GPAW formalism). For this purpose I need to pass a modified density, which 
is non-symmetric, to make one more energy calculation. I am passing the 
force_env to a separate module from a mixed_energy calculation, where I am 
doing the following calls with the modified density:

1. CALL qs_rho_get(rho, rho_ao=rho_ao, rho_ao_kp=rho_ao_kp)
2. rho_ao_kp(1:nspins, 1:1) => density_modified(1:nspins)            ! 
density_modified is a dbcsr_type_no_symmetry matrix
3. rho_ao => density_modified
4. CALL qs_rho_set(rho, rho_ao=rho_ao, rho_ao_kp=rho_ao_kp)
5. CALL qs_rho_update_rho(rho, qs_env=qs_env)
6. CALL qs_ks_did_change(ks_env, rho_changed=.TRUE., 
7. CALL qs_ks_update_qs_env(qs_env, just_energy=.TRUE., 

I could get the first 6 steps right when I am doing a serial version. First 
question is whether my approach is correct in order to do another energy 
calculation with the new modified density?  I am trying to follow the same 
process as an scf loop update here, and using the qs_env for state B since 
only the density changes and rest all parameters remain same.

I had a problem with the core matrix trace calculations, which I solved by 
desymmetrizing *matrixkp_h* and *matrixkp_t *before passing to 
*calculate_ptrace()*, and that worked well. Now I am having a trouble with 
hfx calculation, in particular, in *hfx_energy_potential.F -> 
integrate_four_center() -> get_full_density() *subroutine. In 
*get_full_density()* subroutine, *number_of_p_entries* doesn't seem to 
match the new non-symmetric density matrix which results in the *sendbuffer 
(**hfx_communication.F: line 145) *going out of bounds. The conditional 
statement with *dbcsr_iterator_blocks_left(iter)* is still true and is 
causing an out of bounds error. Can you please suggest a fix for this?  

Another naive question: Other than this are there any parts of build 
kohn-sham matrix routine that are resistant to a non-symmetric density 

On a separate note, there is a harmless bug in the *write_matrix_gen()* 
subroutine where the string formats are interchanged for the omit_header 
cases at output (lines 544 and 587) which gives an unformatted transfer 
error during run-time.  

Thank you very much for your time, and please let me know if the questions 
are ambiguous, I will try to provide more information.

Best Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20190225/10795736/attachment.htm>

More information about the CP2K-user mailing list