# Symplectic integrator

In mathematics, a symplectic integrator (SI) is a numerical integration scheme for Hamiltonian systems. Symplectic integrators form the subclass of geometric integrators which, by definition, are canonical transformations. They are widely used in nonlinear dynamics, molecular dynamics, discrete element methods, accelerator physics, plasma physics, quantum physics, and celestial mechanics.

## Introduction

Symplectic integrators are designed for the numerical solution of Hamilton's equations, which read

${\dot {p}}=-{\frac {\partial H}{\partial q}}\quad {\mbox{and}}\quad {\dot {q}}={\frac {\partial H}{\partial p}},$ where $q$ denotes the position coordinates, $p$ the momentum coordinates, and $H$ is the Hamiltonian. The set of position and momentum coordinates $(q,p)$ are called canonical coordinates. (See Hamiltonian mechanics for more background.)

The time evolution of Hamilton's equations is a symplectomorphism, meaning that it conserves the symplectic 2-form $dp\wedge dq$ . A numerical scheme is a symplectic integrator if it also conserves this 2-form.

Symplectic integrators also might possess, as a conserved quantity, a Hamiltonian which is slightly perturbed from the original one (only true for a small class of simple cases). By virtue of these advantages, the SI scheme has been widely applied to the calculations of long-term evolution of chaotic Hamiltonian systems ranging from the Kepler problem to the classical and semi-classical simulations in molecular dynamics.

Most of the usual numerical methods, like the primitive Euler scheme and the classical Runge–Kutta scheme, are not symplectic integrators.

## Methods for constructing symplectic algorithms

### Splitting methods for separable Hamiltonians

A widely used class of symplectic integrators is formed by the splitting methods.

Assume that the Hamiltonian is separable, meaning that it can be written in the form

$H(p,q)=T(p)+V(q).$ (1)

This happens frequently in Hamiltonian mechanics, with T being the kinetic energy and V the potential energy.

For the notational simplicity, let us introduce the symbol $z=(q,p)$ to denote the canonical coordinates including both the position and momentum coordinates. Then, the set of the Hamilton's equations given in the introduction can be expressed in a single expression as

${\dot {z}}=\{z,H(z)\},$ (2)

where $\{\cdot ,\cdot \}$ is a Poisson bracket. Furthermore, by introducing an operator $D_{H}\cdot =\{\cdot ,H\}$ , which returns a Poisson bracket of the operand with the Hamiltonian, the expression of the Hamilton's equation can be further simplified to

${\dot {z}}=D_{H}z.$ The formal solution of this set of equations is given as a matrix exponential:

$z(\tau )=\exp(\tau D_{H})z(0).$ (3)

Note the positivity of $\tau D_{H}$ in the matrix exponential.

When the Hamiltonian has the form of equation (1), the solution (3) is equivalent to

$z(\tau )=\exp[\tau (D_{T}+D_{V})]z(0).$ (4)

The SI scheme approximates the time-evolution operator $\exp[\tau (D_{T}+D_{V})]$ in the formal solution (4) by a product of operators as

{\begin{aligned}\exp[\tau (D_{T}+D_{V})]&=\prod _{i=1}^{k}\exp(c_{i}\tau D_{T})\exp(d_{i}\tau D_{V})+O(\tau ^{k+1})\\&=\exp(c_{1}\tau D_{T})\exp(d_{1}\tau D_{V})\dots \exp(c_{k}\tau D_{T})\exp(d_{k}\tau D_{V})+O(\tau ^{k+1}),\end{aligned}} (5)

where $c_{i}$ and $d_{i}$ are real numbers, $k$ is an integer, which is called the order of the integrator, and where ${\textstyle \sum _{i=1}^{k}c_{i}=\sum _{i=1}^{k}d_{i}=1}$ . Note that each of the operators $\exp(c_{i}\tau D_{T})$ and $\exp(d_{i}\tau D_{V})$ provides a symplectic map, so their product appearing in the right-hand side of (5) also constitutes a symplectic map.

Since $D_{T}^{2}z=\{\{z,T\},T\}=\{({\dot {q}},0),T\}=(0,0)$ for all $z$ , we can conclude that

$D_{T}^{2}=0.$ (6)

By using a Taylor series, $\exp(aD_{T})$ can be expressed as

$\exp(aD_{T})=\sum _{n=0}^{\infty }{\frac {(aD_{T})^{n}}{n!}},$ (7)

where $a$ is an arbitrary real number. Combining (6) and (7), and by using the same reasoning for $D_{V}$ as we have used for $D_{T}$ , we get

${\begin{cases}\exp(aD_{T})&=1+aD_{T},\\\exp(aD_{V})&=1+aD_{V}.\end{cases}}$ (8)

In concrete terms, $\exp(c_{i}\tau D_{T})$ gives the mapping

${\begin{pmatrix}q\\p\end{pmatrix}}\mapsto {\begin{pmatrix}q+\tau c_{i}{\frac {\partial T}{\partial p}}(p)\\p\end{pmatrix}},$ and $\exp(d_{i}\tau D_{V})$ gives

${\begin{pmatrix}q\\p\end{pmatrix}}\mapsto {\begin{pmatrix}q\\p-\tau d_{i}{\frac {\partial V}{\partial q}}(q)\\\end{pmatrix}}.$ Note that both of these maps are practically computable.

#### Examples

The simplified form of the equations (in executed order) are:

$q_{i+1}=q_{i}+c_{i}{\frac {p_{i+1}}{m}}t$ $p_{i+1}=p_{i}+d_{i}F(q_{i})t$ After converting into Lagrangian coordinates:

$x_{i+1}=x_{i}+c_{i}v_{i+1}t$ $v_{i+1}=v_{i}+d_{i}a(x_{i})t$ Where $F(x)$ is the force vector at $x$ , $a(x)$ is the acceleration vector at $x$ , and $m$ is the scalar quantity of mass.

Several symplectic integrators are given below. An illustrative way to use them is to consider a particle with position $q$ and velocity $p$ .

To apply a timestep with values $c_{1,2,3},d_{1,2,3}$ to the particle, carry out the following steps:

Iteratively:

• Update the position $i$ of the particle by adding to it its (previously updated) velocity $i$ multiplied by $c_{i}$ • Update the velocity $i$ of the particle by adding to it its acceleration (at updated position) multiplied by $d_{i}$ #### A first-order example

The symplectic Euler method is the first-order integrator with $k=1$ and coefficients

$c_{1}=d_{1}=1.$ Note that the algorithm above does not work if time-reversibility is needed. The algorithm has to be implemented in two parts, one for positive time steps, one for negative time steps.

#### A second-order example

The Verlet method is the second-order integrator with $k=2$ and coefficients

$c_{1}=0,\qquad c_{2}=1,\qquad d_{1}=d_{2}={\tfrac {1}{2}}.$ Since $c_{1}=0$ , the algorithm above is symmetric in time. There are 3 steps to the algorithm, and step 1 and 3 are exactly the same, so the positive time version can be used for negative time.

#### A third-order example

A third-order symplectic integrator (with $k=3$ ) was discovered by Ronald Ruth in 1983. One of the many solutions is given by

{\begin{aligned}c_{1}&=1,&c_{2}&=-{\tfrac {2}{3}},&c_{3}&={\tfrac {2}{3}},\\d_{1}&=-{\tfrac {1}{24}},&d_{2}&={\tfrac {3}{4}},&d_{3}&={\tfrac {7}{24}}.\end{aligned}} #### A fourth-order example

A fourth-order integrator (with $k=4$ ) was also discovered by Ruth in 1983 and distributed privately to the particle-accelerator community at that time. This was described in a lively review article by Forest. This fourth-order integrator was published in 1990 by Forest and Ruth and also independently discovered by two other groups around that same time.

{\begin{aligned}c_{1}&=c_{4}={\frac {1}{2(2-2^{1/3})}},&c_{2}&=c_{3}={\frac {1-2^{1/3}}{2(2-2^{1/3})}},\\d_{1}&=d_{3}={\frac {1}{2-2^{1/3}}},&d_{2}&=-{\frac {2^{1/3}}{2-2^{1/3}}},\quad d_{4}=0.\end{aligned}} To determine these coefficients, the Baker–Campbell–Hausdorff formula can be used. Yoshida, in particular, gives an elegant derivation of coefficients for higher-order integrators. Later on, Blanes and Moan further developed partitioned Runge–Kutta methods for the integration of systems with separable Hamiltonians with very small error constants.

### Splitting methods for general nonseparable Hamiltonians

General nonseparable Hamiltonians can also be explicitly and symplectically integrated.

To do so, Tao introduced a restraint that binds two copies of phase space together to enable an explicit splitting of such systems. The idea is, instead of $H(Q,P)$ , one simulates ${\bar {H}}(q,p,x,y)=H(q,y)+H(x,p)+\omega \left(\left\|q-x\right\|_{2}^{2}/2+\left\|p-y\right\|_{2}^{2}/2\right)$ , whose solution agrees with that of $H(Q,P)$ in the sense that $q(t)=x(t)=Q(t),p(t)=y(t)=P(t)$ .

The new Hamiltonian is advantageous for explicit symplectic integration, because it can be split into the sum of three sub-Hamiltonians, $H_{A}=H(q,y)$ , $H_{B}=H(x,p)$ , and $H_{C}=\omega \left(\left\|q-x\right\|_{2}^{2}/2+\left\|p-y\right\|_{2}^{2}/2\right)$ . Exact solutions of all three sub-Hamiltonians can be explicitly obtained: both $H_{A},H_{B}$ solutions correspond to shifts of mismatched position and momentum, and $H_{C}$ corresponds to a linear transformation. To symplectically simulate the system, one simply composes these solution maps.

## Applications

### In plasma physics

In recent decades symplectic integrator in plasma physics has become an active research topic, because straightforward applications of the standard symplectic methods do not suit the need of large-scale plasma simulations enabled by the peta- to exa-scale computing hardware. Special symplectic algorithms need to be customarily designed, tapping into the special structures of physics problem under investigation. One such example is the charged particle dynamics in an electromagnetic field. With the canonical symplectic structure, the Hamiltonian of the dynamics is

$H({\boldsymbol {p}},{\boldsymbol {x}})={\frac {1}{2}}\left({\boldsymbol {p}}-{\boldsymbol {A}}\right)^{2}+\phi ,$ whose ${\textstyle {\boldsymbol {p}}}$ -dependence and ${\textstyle {\boldsymbol {x}}}$ -dependence are not separable, and standard explicit symplectic methods do not apply. For large-scale simulations on massively parallel clusters, however, explicit methods are preferred. To overcome this difficulty, we can explore the specific way that the ${\textstyle {\boldsymbol {p}}}$ -dependence and ${\textstyle {\boldsymbol {x}}}$ -dependence are entangled in this Hamiltonian, and try to design a symplectic algorithm just for this or this type of problem. First, we note that the ${\textstyle {\boldsymbol {p}}}$ -dependence is quadratic, therefore the first order symplectic Euler method implicit in ${\textstyle {\boldsymbol {p}}}$ is actually explicit. This is what is used in the canonical symplectic particle-in-cell (PIC) algorithm. To build high order explicit methods, we further note that the ${\textstyle {\boldsymbol {p}}}$ -dependence and ${\textstyle {\boldsymbol {x}}}$ -dependence in this ${\textstyle H({\boldsymbol {p}},{\boldsymbol {x}})}$ are product-separable, 2nd and 3rd order explicit symplectic algorithms can be constructed using generating functions, and arbitrarily high-order explicit symplectic integrators for time-dependent electromagnetic fields can also be constructed using Runge-Kutta techniques.

A more elegant and versatile alternative is to look at the following non-canonical symplectic structure of the problem,

$i_{({\dot {\boldsymbol {x}}},{\dot {\boldsymbol {v}}})}\Omega =-dH,\ \ \ \Omega =d({\boldsymbol {v}}+{\boldsymbol {A}})\wedge d{\boldsymbol {x}},\ \ \ H={\frac {1}{2}}{\boldsymbol {v}}^{2}+\phi .$ Here ${\textstyle \Omega }$ is a non-constant non-canonical symplectic form. General symplectic integrator for non-constant non-canonical symplectic structure, explicit or implicit, is not known to exist. However, for this specific problem, a family of high-order explicit non-canonical symplectic integrators can be constructed using the He splitting method. Splitting ${\textstyle H}$ into 4 parts,
{\begin{aligned}H&=H_{x}+H_{y}+H_{z}+H_{\phi },\\H_{x}&={\frac {1}{2}}v_{x}^{2},\ \ H_{y}={\frac {1}{2}}v_{y}^{2},\ \ H_{z}={\frac {1}{2}}v_{z}^{2},\ \ H_{\phi }=\phi ,\end{aligned}} we find serendipitously that for each subsystem, e.g.,
$i_{({\dot {\boldsymbol {x}}},{\dot {\boldsymbol {v}}})}\Omega =-dH_{x}$ and
$i_{({\dot {\boldsymbol {x}}},{\dot {\boldsymbol {v}}})}\Omega =-dH_{\phi },$ the solution map can be written down explicitly and calculated exactly. Then explicit high-order non-canonical symplectic algorithms can be constructed using different compositions. Let ${\textstyle \Theta _{x},\Theta _{y},\Theta _{z}}$ and ${\textstyle \Theta _{\phi }}$ denote the exact solution maps for the 4 subsystems. A 1st-order symplectic scheme is
{\begin{aligned}\Theta _{1}\left(\Delta \tau \right)=\Theta _{x}\left(\Delta \tau \right)\Theta _{y}\left(\Delta \tau \right)\Theta _{z}\left(\Delta \tau \right)\Theta _{\phi }\left(\Delta \tau \right)~.\end{aligned}} A symmetric 2nd-order symplectic scheme is,
{\begin{aligned}\Theta _{2}\left(\Delta \tau \right)&=\Theta _{x}\left(\Delta \tau /2\right)\Theta _{y}\left(\Delta \tau /2\right)\Theta _{z}\left(\Delta \tau /2\right)\Theta _{\phi }\left(\Delta \tau \right)\\&\Theta _{z}\left(\Delta t/2\right)\Theta _{y}\left(\Delta t/2\right)\Theta _{x}\left(\Delta t/2\right)\!,\end{aligned}} which is a customarily modified Strang splitting. A ${\textstyle 2(l+1)}$ -th order scheme can be constructed from a ${\textstyle 2l}$ -th order scheme using the method of triple jump,
{\begin{aligned}\Theta _{2(l+1)}(\Delta \tau )&=\Theta _{2l}(\alpha _{l}\Delta \tau )\Theta _{2l}(\beta _{l}\Delta \tau )\Theta _{2l}(\alpha _{l}\Delta \tau )~,\\\alpha _{l}&=1/(2-2^{1/(2l+1)})~,\\\beta _{l}&=1-2\alpha _{l}~.\end{aligned}} The He splitting method is one of key techniques used in the structure-preserving geometric particle-in-cell (PIC) algorithms.