Linear hamiltonian systems: The Riccati group and its invariants