Fortran library for computing density matrices