In mathematics, a Hamiltonian matrix is a 2n-by-2n matrix A such that JA is symmetric, where J is the skew-symmetric matrix and In is the n-by-n identity matrix. In other words, A is Hamiltonian if and only if (JA)T = JA where ( )T denotes the transpose. The collection of all Hamiltonian matrices forms a Lie algebra ; its associated Lie group is the symplectic group, whose elements are the symplectic matrices.