In mathematics, a Hamiltonian matrix is a 2n-by-2n matrix A such that JA is symmetric, where J is the skew-symmetric matrix
J
=
[
0
I
n
−
I
n
0
]
{\displaystyle J={\begin{bmatrix}0&I_{n}\\-I_{n}&0\\\end{bmatrix}}}
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.