Hamiltonian matrices
Manifolds.Hamiltonian โ Type
Hamiltonian{T,S<:AbstractMatrix{<:T}} <: AbstractMatrix{T}A type to store a Hamiltonian matrix, that is a square matrix for which $A^+ = -A$ where
\[A^+ = J_{2n}^{\mathrm{T}}A^{\mathrm{T}}J_{2n}, \qquad J_{2n} = \begin{pmatrix} 0 & I_n\\-I_n & 0 \end{pmatrix},\]
and $I_n$ denotes the $nรn$ identity matrix.
Manifolds.HamiltonianMatrices โ Type
HamiltonianMatrices{๐ฝ, T} <: AbstractDecoratorManifold{๐ฝ}The AbstractManifold consisting of Hamiltonian matrices of size $2nร2n$, i.e. the set
\[\mathfrak{sp}(2n,๐ฝ) = \bigl\{p โ ๐ฝ^{2nร2n}\ \big|\ p^+ = -p \bigr\},\]
where $โ
^{+}$ denotes the symplectic_inverse, and $๐ฝ โ \{ โ, โ\}$.
Though it is slightly redundant, usually the matrices are stored as $2nร2n$ arrays.
The symbol $\mathfrak{sp}$ refers to the main usage within Manifolds.jl that is the Lie algebra to the SymplecticMatrices interpreted as a Lie group with the matrix multiplication as group operation.
Constructor
HamiltonianMatrices(2n::Int, field::AbstractNumbers=โ; parameter::Symbol=:type)Generate the manifold of $2nร2n$ Hamiltonian matrices.
Base.:^ โ Method
^(A::Hamiltonian, ::typeof(+))Compute the symplectic_inverse of a Hamiltonian (A)
Base.rand โ Method
pX = rand(M::HamiltonianMatrices; ฯ::Real=1.0, vector_at=nothing)
rand!(rng::AbstractRNG, M::HamiltonianMatrices, pX; ฯ::Real=1.0, vector_at=nothing)Generate a random Hamiltonian matrix. Since these are a submanifold of $โ^{2nร2n}$, the same method applies for points and tangent vectors. This can also be done in-place of pX.
The construction is based on generating one normally-distributed $nรn$ matrix $A$ and two symmetric $nรn$ matrices $B, C$ which are then stacked:
\[p = \begin{pmatrix} A & B\\ C & -A^{\mathrm{T}} \end{pmatrix}\]
Manifolds.is_hamiltonian โ Method
is_hamiltonian(A::AbstractMatrix; kwargs...)Test whether a matrix A is hamiltonian. The test consists of verifying whether
\[A^+ = -A\]
where $A^+$ denotes the symplectic_inverse of A.
The passed keyword arguments are passed on to isapprox check within
ManifoldsBase.check_point โ Method
check_point(M::HamiltonianMatrices, p; kwargs...)Check whether p is a valid manifold point on the HamiltonianMatrices M, i.e. whether p is_hamiltonian.
The tolerance for the test of p can be set using kwargs....
ManifoldsBase.check_vector โ Method
check_vector(M::HamiltonianMatrices, p, X; kwargs... )Check whether X is a tangent vector to manifold point p on the HamiltonianMatrices M, i.e. X has to be a Hamiltonian matrix The tolerance for is_hamiltonian X can be set using kwargs....
ManifoldsBase.is_flat โ Method
is_flat(::HamiltonianMatrices)Return true. HamiltonianMatrices is a flat manifold.
ManifoldsBase.manifold_dimension โ Method
manifold_dimension(M::HamiltonianMatrices)Return the dimension of the HamiltonianMatrices M over the number system ๐ฝ, that is
\[\dim \mathfrak{sp}(2n,๐ฝ) = (2n+1)n \dim_โ ๐ฝ,\]
where $\dim_โ ๐ฝ$ is the real_dimension of $๐ฝ$. For $๐ฝ = โ$ this is the dimension of the SymplecticMatrices $\mathrm{Sp}(2n,โ)$, whose Lie algebra this is.
ManifoldsBase.project โ Method
project(::HamiltonianMatrices, p, X)
project!(::HamiltonianMatrices, Y, p, X)Project a matrix $X โ ๐ฝ^{2nร2n}$ onto the tangent space $T_p\mathfrak{sp}(2n,๐ฝ)$ of the HamiltonianMatrices at $p$, which is $\mathfrak{sp}(2n,๐ฝ)$ itself, so that $\operatorname{proj}_p(X) = \frac{1}{2}\bigl( X - X^{+} \bigr)$ as for points.
ManifoldsBase.project โ Method
project(::HamiltonianMatrices, p)
project!(::HamiltonianMatrices, q, p)Project a matrix $p โ ๐ฝ^{2nร2n}$ onto the HamiltonianMatrices $\mathfrak{sp}(2n,๐ฝ)$ relative to the Euclidean metric of the embedding $๐ฝ^{2nร2n}$, that is
\[ \operatorname{proj}_{\mathfrak{sp}(2n,๐ฝ)}(p) = \frac{1}{2}\bigl( p - p^{+} \bigr),\]
where $p^+$ denotes the symplectic_inverse of $p$. For $๐ฝ = โ$ this is Proposition 2 in [GSAS21a] at the identity, whose tangent space is $\mathfrak{sp}(2n,โ)$ by Corollary 3.46 in [Hal15]. For $๐ฝ = โ$ the real and the imaginary part are projected separately, see Proposition 3.38 in [Hal15].
ManifoldsBase.riemann_tensor โ Method
riemann_tensor(M::HamiltonianMatrices, p, X, Y, Z)Compute the Riemann tensor $R(X,Y)Z$ at point p on HamiltonianMatrices M. Its value is always the zero tangent vector, since M is flat.
ManifoldsBase.sectional_curvature โ Method
sectional_curvature(M::HamiltonianMatrices, p, X, Y)Return the sectional curvature 0 of HamiltonianMatrices M, which is flat.
ManifoldsBase.sectional_curvature_max โ Method
sectional_curvature_max(M::HamiltonianMatrices)Return the upper bound 0 of the sectional curvature of HamiltonianMatrices M, which is flat.
ManifoldsBase.sectional_curvature_min โ Method
sectional_curvature_min(M::HamiltonianMatrices)Return the lower bound 0 of the sectional curvature of HamiltonianMatrices M, which is flat.
Random.rand! โ Method
pX = rand(M::HamiltonianMatrices; ฯ::Real=1.0, vector_at=nothing)
rand!(rng::AbstractRNG, M::HamiltonianMatrices, pX; ฯ::Real=1.0, vector_at=nothing)Generate a random Hamiltonian matrix. Since these are a submanifold of $โ^{2nร2n}$, the same method applies for points and tangent vectors. This can also be done in-place of pX.
The construction is based on generating one normally-distributed $nรn$ matrix $A$ and two symmetric $nรn$ matrices $B, C$ which are then stacked:
\[p = \begin{pmatrix} A & B\\ C & -A^{\mathrm{T}} \end{pmatrix}\]