code: def dmat(c,nocc):
      "Form the density matrix from the first nocc orbitals of c"
      return np.dot(c[:,:nocc],c[:,:nocc].Tf dmat(c,nocc):
      "Form the density matrix from the first nocc orbitals of c"
      return np.dot(c[:,:nocc],c[:,:nocc].T)
docs: Form the density matrix from the first nocc orbitals of c