Heisenberg groups and graded Lie algebras