determine_casimirs - cchandre/HamLorenz GitHub Wiki

determine_casimirs (function)

Purpose

The determine_casimirs method computes the Casimir invariants associated with a Hamiltonian Lorenz model whose Poisson structure is defined by a circulant antisymmetric matrix $J$. These Casimir invariants are preserved under the dynamics.


Inputs (via self)

Attribute Description
self.N Number of degrees of freedom; defines the size of the matrix $J$.
self.K Interaction range in the Poisson bracket (finite difference width).
self.xi List or array of $K$ coupling coefficients (length K).

⚙️ Internal Components

J Matrix

  • A symbolic $N \times N$ antisymmetric Poisson matrix: $J_{n,m} = \sum_{k=1}^{K} \xi_{k} \left[ \delta_{n, m-k}^{\mathrm{per}} - \delta_{n, m+k}^{\mathrm{per}} \right]$

J.nullspace()

  • Computes the nullspace of $J$ symbolically using SymPy.
  • Each element of the nullspace is a Casimir invariant direction.

Output

Returns:

List[np.ndarray]  # each of shape (N,)
  • A list of NumPy arrays, each representing a Casimir vector. More specifically, for each array --element of the list-- $(a_1,\ldots,a_N)$, a Casimir invariant is given by $C(\mathbf{x})=\sum_k a_k \phi(x_k)$.

Notes

  • Casimirs are functionals $C(\mathbf{x})$ such that $ { C, f } = 0$ for any $f$. Here, this means $J \cdot \nabla C = 0$.
  • The method relies on symbolic computation via SymPy, followed by conversion to NumPy for practical use.

Example Usage

model = HamLorenz(N=9, K=2, xi=[1, 2])
casimirs = model.determine_casimirs()

for c in casimirs:
    print("Casimir vector:", c)

Interpretation

  • The number of returned vectors equals the dimension of the nullspace of $J$, i.e., the number of independent Casimirs.
  • These play a crucial role in understanding the integrability and geometric structure of the system.