amep.order.psi_k#

amep.order.psi_k(coords: ndarray, box_boundary: ndarray, other_coords: ndarray | None = None, rmax: float = 1.122, k: int = 6, pbc: bool = True) ndarray#

Calculates the k-atic bond order parameter for an entire 2D system.

In a first step, the indexes of the first k next neighbors of each atom is calculated with the KDTree algorithm and with periodic boundary conditions appplied with pbc_points.

Notes

The k-atic order parameter is defined by

\[\Psi_k(\vec{r}_j) = \frac{1}{k} \sum_{n=1}^k\exp(ik\theta_{jn}),\]

where the sum goes over the k nearest neighbors of the particle at position $vec{r}_j$. The value of $theta_{jn}$ is equal to the angle between the connection line from $vec{r}_j$ to $vec{r}_n$ and the x axis. See also Refs. [1] [2] [3] for further information.

References:

Parameters:
  • coords (np.ndarray) – Coordinate frame of all particles.

  • box_boundary (np.ndarray of shape (3,2)) – Boundary of the simulation box in the form of np.array([[xmin, xmax], [ymin, ymax], [zmin, zmax]]).

  • other_coords (np.ndarray, optional) – Coords of the particles which are considered as possible neighbors. If None, coords is used. The default is None.

  • rmax (float, optional) – Maximum distance between particles to counted as neighbors. The default is 1.122 (which is the cutoff radius of the WCA potential). This value is ignored in the current version.

  • k (int, optional) – Symmetry of the k-atic bond order parameter. The default is 6.

  • pbc (bool, optional) – If True, periodic boundary conditions are considered. The default is True.

Returns:

k-atic order parameter of each particle (1D array of complex numbers).

Return type:

np.ndarray

Examples

>>> import amep
>>> import numpy as np
>>> traj = amep.load.traj("../examples/data/lammps.h5amep")
>>> frame = traj[-1]
>>> psi_4 = amep.order.psi_k(
...     frame.coords(), frame.box, k=4
... )
>>> fig, axs = amep.plot.new(figsize=(3.6,3))
>>> mp = amep.plot.particles(
...     axs, frame.coords(), frame.box, frame.radius(),
...     values=np.abs(psi_4)
... )
>>> cax = amep.plot.add_colorbar(
...     fig, axs, mp, label=r'$|\psi_4|$'
... )
>>> axs.set_xlabel(r'$x$')
>>> axs.set_ylabel(r'$y$')
>>> fig.savefig('./figures/order/order-psi4.png')
>>>
../_images/order-psi4.png
>>> psi_6 = amep.order.psi_k(
...     frame.coords(), frame.box, k=6
... )
>>> fig, axs = amep.plot.new(figsize=(3.6,3))
>>> mp = amep.plot.particles(
...     axs, frame.coords(), frame.box, frame.radius(),
...     values=np.abs(psi_6)
... )
>>> cax = amep.plot.add_colorbar(
...     fig, axs, mp, label=r'$|\psi_6|$'
... )
>>> axs.set_xlabel(r'$x$')
>>> axs.set_ylabel(r'$y$')
>>> fig.savefig('./figures/order/order-psi6.png')
>>>
../_images/order-psi6.png