We discuss the balancing of Hamiltonian matrices by structure preserving si
milarity transformations. The method is closely related to balancing nonsym
metric matrices for eigenvalue computations as proposed by Osborne [J. ACM,
7 (1960), pp. 338-345] and Parlett and Reinsch [Numer. Math., 13 (1969), p
p. 296-304] and implemented in most linear algebra software packages. It is
shown that isolated eigenvalues can be deflated using similarity transform
ations with symplectic permutation matrices. Balancing is then based on equ
ilibrating row and column norms of the Hamiltonian matrix using symplectic
scaling matrices. Due to the given structure, it is sufficient to deal with
the leading half rows and columns of the matrix. Numerical examples show t
hat the method improves eigenvalue calculations of Hamiltonian matrices as
well as numerical methods for solving continuous-time algebraic Riccati equ
ations.