Save wavefunction/Density matrix as binary?

I would like to save the density matrix from a DFT calculation. Is it possible to save it as a binary file that can easily be read in later?

I would like to be able to import density matrices with Psi4Numpy, but using density matrices that I’ve saved previously.

If you want to save the wavefunction, try Wavefunction.from_file(filenamehere) and wfn_object.to_file(filenamehere).