<div dir="ltr"><div dir="ltr"><div dir="ltr">Binary writing a matrix can be done with the function cp_dbcsr_binary_write (you will have to call this function in the code at the point at which you want to get the KS matrix). However the KS/FOCK matrix is a dbcsr matrix in CP2K. I think it will be very hard to use the matrices outside CP2K. What do you want to do with the matrix?<br>With the function copy_dbcsr_to_fm you can make a dbcsr matrix to a full matrix, I am not sure if you can binary write a full matrix in CP2K in case you can the corresponding subroutine is probably in the folder src/fm.<br><br>Best<br><br>Samuel<br></div></div></div>