Periodic boundary conditions

Last updated
Periodic boundary conditions in 2D Limiteperiodicite.svg
Periodic boundary conditions in 2D
Unit cell with water molecules, used to simulate flowing water Unit Cell of Liquid Water.png
Unit cell with water molecules, used to simulate flowing water

Periodic boundary conditions (PBCs) are a set of boundary conditions which are often chosen for approximating a large (infinite) system by using a small part called a unit cell. PBCs are often used in computer simulations and mathematical models. The topology of two-dimensional PBC is equal to that of a world map of some video games; the geometry of the unit cell satisfies perfect two-dimensional tiling, and when an object passes through one side of the unit cell, it re-appears on the opposite side with the same velocity. In topological terms, the space made by two-dimensional PBCs can be thought of as being mapped onto a torus (compactification). The large systems approximated by PBCs consist of an infinite number of unit cells. In computer simulations, one of these is the original simulation box, and others are copies called images. During the simulation, only the properties of the original simulation box need to be recorded and propagated. The minimum-image convention is a common form of PBC particle bookkeeping in which each individual particle in the simulation interacts with the closest image of the remaining particles in the system.

Contents

One example of periodic boundary conditions can be defined according to smooth real functions by

for all m = 0, 1, 2, ... and for constants and .

In molecular dynamics simulations and Monte Carlo molecular modeling, PBCs are usually applied to calculate properties of bulk gasses, liquids, crystals or mixtures. [1] A common application uses PBC to simulate solvated macromolecules in a bath of explicit solvent. Born–von Karman boundary conditions are periodic boundary conditions for a special system.

In electromagnetics, PBC can be applied for different mesh types to analyze the electromagnetic properties of periodical structures. [2]

Requirements and artifacts

Three-dimensional PBCs are useful for approximating the behavior of macro-scale systems of gases, liquids, and solids. Three-dimensional PBCs can also be used to simulate planar surfaces, in which case two-dimensional PBCs are often more suitable. Two-dimensional PBCs for planar surfaces are also called slab boundary conditions; in this case, PBCs are used for two Cartesian coordinates (e.g., x and y), and the third coordinate (z) extends to infinity.

PBCs can be used in conjunction with Ewald summation methods (e.g., the particle mesh Ewald method) to calculate electrostatic forces in the system. However, PBCs also introduce correlational artifacts that do not respect the translational invariance of the system, [3] and requires constraints on the composition and size of the simulation box.

In simulations of solid systems, the strain field arising from any inhomogeneity in the system will be artificially truncated and modified by the periodic boundary. Similarly, the wavelength of sound or shock waves and phonons in the system is limited by the box size.

In simulations containing ionic (Coulomb) interactions, the net electrostatic charge of the system must be zero to avoid summing to an infinite charge when PBCs are applied. In some applications it is appropriate to obtain neutrality by adding ions such as sodium or chloride (as counterions) in appropriate numbers if the molecules of interest are charged. Sometimes ions are even added to a system in which the molecules of interest are neutral, to approximate the ionic strength of the solution in which the molecules naturally appear. Maintenance of the minimum-image convention also generally requires that a spherical cutoff radius for nonbonded forces be at most half the length of one side of a cubic box. Even in electrostatically neutral systems, a net dipole moment of the unit cell can introduce a spurious bulk-surface energy, equivalent to pyroelectricity in polar crystals. Another consequence of applying PBCs to a simulated system such as a liquid or a solid is that this hypothetical system has no contact with its “surroundings”, due to it being infinite in all directions. Therefore, long-range energy contributions such as the electrostatic potential, and by extension the energies of charged particles like electrons, are not automatically aligned to experimental energy scales. Mathematically, this energy level ambiguity corresponds to the sum of the electrostatic energy being dependent on a surface term that needs to be set by the user of the method. [4]

The size of the simulation box must also be large enough to prevent periodic artifacts from occurring due to the unphysical topology of the simulation. In a box that is too small, a macromolecule may interact with its own image in a neighboring box, which is functionally equivalent to a molecule's "head" interacting with its own "tail". This produces highly unphysical dynamics in most macromolecules, although the magnitude of the consequences and thus the appropriate box size relative to the size of the macromolecules depends on the intended length of the simulation, the desired accuracy, and the anticipated dynamics. For example, simulations of protein folding that begin from the native state may undergo smaller fluctuations, and therefore may not require as large a box, as simulations that begin from a random coil conformation. However, the effects of solvation shells on the observed dynamics in simulation or in experiment are not well understood. A common recommendation based on simulations of DNA is to require at least 1 nm of solvent around the molecules of interest in every dimension. [5]

Practical implementation: continuity and the minimum image convention

An object which has passed through one face of the simulation box should re-enter through the opposite face—or its image should do it. Evidently, a strategic decision must be made: Do we (A) “fold back” particles into the simulation box when they leave it, or do we (B) let them go on (but compute interactions with the nearest images)? The decision has no effect on the course of the simulation, but if the user is interested in mean displacements, diffusion lengths, etc., the second option is preferable.

(A) Restrict particle coordinates to the simulation box

To implement a PBC algorithm, at least two steps are needed.

Restricting the coordinates is a simple operation which can be described with the following code, where x_size is the length of the box in one direction (assuming an orthogonal unit cell centered on the origin) and x is the position of the particle in the same direction:

if(periodic_x)then  if(x<-x_size*0.5)x=x+x_sizeif(x>=x_size*0.5)x=x-x_sizeend if

Distance and vector between objects should obey the minimum image criterion. This can be implemented according to the following code (in the case of a one-dimensional system where dx is the distance direction vector from object i to object j):

if(periodic_x)thendx=x(j)-x(i)if(dx>x_size*0.5)dx=dx-x_sizeif(dx<=-x_size*0.5)dx=dx+x_sizeend if

For three-dimensional PBCs, both operations should be repeated in all 3 dimensions.

These operations can be written in a much more compact form for orthorhombic cells if the origin is shifted to a corner of the box. Then we have, in one dimension, for positions and distances respectively:

! After x(i) update without regard to PBC:x(i)=x(i)-floor(x(i)/x_size)*x_size! For a box with the origin at the lower left vertex! Works for x's lying in any image.dx=x(j)-x(i)dx=dx-nint(dx/x_size)*x_size

(B) Do not restrict the particle coordinates

Assuming an orthorhombic simulation box with the origin at the lower left forward corner, the minimum image convention for the calculation of effective particle distances can be calculated with the “nearest integer” function as shown above, here as C/C++ code:

x_rsize=1.0/x_size;// compute only when box size is set or changeddx=x[j]-x[i];dx-=x_size*nearbyint(dx*x_rsize);

The fastest way of carrying out this operation depends on the processor architecture. If the sign of dx is not relevant, the method

dx=fabs(dx);dx-=static_cast<int>(dx*x_rsize+0.5)*x_size;

was found to be fastest on x86-64 processors in 2013. [6]

For non-orthorhombic cells the situation is more complicated. [7]

In simulations of ionic systems more complicated operations may be needed to handle the long-range Coulomb interactions spanning several box images, for instance Ewald summation.

Unit cell geometries

PBC requires the unit cell to be a shape that will tile perfectly into a three-dimensional crystal. Thus, a spherical or elliptical droplet cannot be used. A cube or rectangular prism is the most intuitive and common choice, but can be computationally expensive due to unnecessary amounts of solvent molecules in the corners, distant from the central macromolecules. A common alternative that requires less volume is the truncated octahedron.

General dimension

For simulations in 2D and 3D space, cubic periodic boundary condition is most commonly used since it is simplest in coding. In computer simulation of high dimensional systems, however, the hypercubic periodic boundary condition can be less efficient because corners occupy most part of the space. In general dimension, unit cell can be viewed as the Wigner-Seitz cell of certain lattice packing. [8] For example, the hypercubic periodic boundary condition corresponds to the hypercubic lattice packing. It is then preferred to choose a unit cell which corresponds to the dense packing of that dimension. In 4D this is D4 lattice; and E8 lattice in 8-dimension. The implementation of these high dimensional periodic boundary conditions is equivalent to error correction code approaches in information theory. [9]

Conserved properties

Under periodic boundary conditions, the linear momentum of the system is conserved, but Angular momentum is not. Conventional explanation of this fact is based on Noether's theorem, which states that conservation of angular momentum follows from rotational invariance of Lagrangian. However, this approach was shown to not be consistent: it fails to explain the absence of conservation of angular momentum of a single particle moving in a periodic cell. [10] Lagrangian of the particle is constant and therefore rotationally invariant, while angular momentum of the particle is not conserved. This contradiction is caused by the fact that Noether's theorem is usually formulated for closed systems. The periodic cell exchanges mass momentum, angular momentum, and energy with the neighboring cells.

When applied to the microcanonical ensemble (constant particle number, volume, and energy, abbreviated NVE), using PBC rather than reflecting walls slightly alters the sampling of the simulation due to the conservation of total linear momentum and the position of the center of mass; this ensemble has been termed the "molecular dynamics ensemble" [11] or the NVEPG ensemble. [12] These additional conserved quantities introduce minor artifacts related to the statistical mechanical definition of temperature, the departure of the velocity distributions from a Boltzmann distribution, and violations of equipartition for systems containing particles with heterogeneous masses. The simplest of these effects is that a system of N particles will behave, in the molecular dynamics ensemble, as a system of N-1 particles. These artifacts have quantifiable consequences for small toy systems containing only perfectly hard particles; they have not been studied in depth for standard biomolecular simulations, but given the size of such systems, the effects will be largely negligible. [12]

See also

Notes

  1. Frenkel, Daan; Smit, Berend (2002). Understanding molecular simulation : from algorithms to applications (2nd ed.). San Diego. ISBN   978-0-08-051998-2. OCLC   173686073.{{cite book}}: CS1 maint: location missing publisher (link)
  2. Mai, W.; Li, P.; Bao, H.; Li, X.; Jiang, L.; Hu, J.; Werner, D. H. (April 2019). "Prism-Based DGTD With a Simplified Periodic Boundary Condition to Analyze FSS With D2n Symmetry in a Rectangular Array Under Normal Incidence". IEEE Antennas and Wireless Propagation Letters. 18 (4): 771–775. Bibcode:2019IAWPL..18..771M. doi:10.1109/LAWP.2019.2902340. ISSN   1536-1225. S2CID   106411612.
  3. Cheatham, T. E.; Miller, J. H.; Fox, T.; Darden, P. A.; Kollman, P. A. (1995). "Molecular Dynamics Simulations on Solvated Biomolecular Systems: The Particle Mesh Ewald Method Leads to Stable Trajectories of DNA, RNA, and Proteins". Journal of the American Chemical Society . 117 (14): 4193–4194. doi:10.1021/ja00119a045.
  4. Kleinman, Leonard (1981). "Comment on the average potential of a Wigner solid". Physical Review B. 24 (12): 7412–7414. Bibcode:1981PhRvB..24.7412K. doi:10.1103/PhysRevB.24.7412. ISSN   0163-1829.
  5. de Souza, O. N.; Ornstein, R. L. (1997). "Effect of periodic box size on aqueous molecular dynamics simulation of a DNA dodecamer with particle-mesh Ewald method". Biophys J. 72 (6): 2395–2397. Bibcode:1997BpJ....72.2395D. doi:10.1016/s0006-3495(97)78884-2. PMC   1184438 . PMID   9168016.
  6. Deiters, Ulrich K. (2013). "Efficient coding of the minimum image convention". Z. Phys. Chem. 227 (2–3): 345–352. doi:10.1524/zpch.2013.0311. S2CID   100761423.
  7. Minimum image convention in non-cubic simulation cells
  8. Berthier, Ludovic; Charbonneau, Patrick; Kundu, Joyjit (31 August 2020). "Finite Dimensional Vestige of Spinodal Criticality above the Dynamical Glass Transition". Physical Review Letters. 125 (10): 108001. arXiv: 1912.11510 . Bibcode:2020PhRvL.125j8001B. doi:10.1103/PhysRevLett.125.108001. PMID   32955295. S2CID   221562320.
  9. Conway, J.; Sloane, N. (March 1982). "Fast quantizing and decoding and algorithms for lattice quantizers and codes". IEEE Transactions on Information Theory. 28 (2): 227–232. CiteSeerX   10.1.1.392.249 . doi:10.1109/TIT.1982.1056484.
  10. Kuzkin, V. A. (2015). "On angular momentum balance in particle systems with periodic boundary conditions". ZAMM. 95 (11): 1290–1295. arXiv: 1312.7008 . Bibcode:2015ZaMM...95.1290K. doi:10.1002/zamm.201400045. S2CID   54880840.
  11. Erpenbeck, J. J.; Wood, W. W. (1977). Berne, B. J. (ed.). Statistical Mechanics, Part B: Time-dependent Processes. Modern Theoretical Chemistry. Vol. 6. New York: Plenum. pp. 1–40. ISBN   0-306-33506-9.
  12. 1 2 Shirts, R. B.; Burt, S. R.; Johnson, A. M. (2006). "Periodic boundary condition induced breakdown of the equipartition principle and other kinetic effects of finite sample size in classical hard-sphere molecular dynamics simulation". J Chem Phys. 125 (16): 164102. Bibcode:2006JChPh.125p4102S. doi:10.1063/1.2359432. PMID   17092058.

Related Research Articles

<span class="mw-page-title-main">Angular momentum</span> Conserved physical quantity; rotational analogue of linear momentum

In physics, angular momentum is the rotational analog of linear momentum. It is an important physical quantity because it is a conserved quantity – the total angular momentum of a closed system remains constant. Angular momentum has both a direction and a magnitude, and both are conserved. Bicycles and motorcycles, flying discs, rifled bullets, and gyroscopes owe their useful properties to conservation of angular momentum. Conservation of angular momentum is also why hurricanes form spirals and neutron stars have high rotational rates. In general, conservation limits the possible motion of a system, but it does not uniquely determine it.

In physics, a conservation law states that a particular measurable property of an isolated physical system does not change as the system evolves over time. Exact conservation laws include conservation of mass-energy, conservation of linear momentum, conservation of angular momentum, and conservation of electric charge. There are also many approximate conservation laws, which apply to such quantities as mass, parity, lepton number, baryon number, strangeness, hypercharge, etc. These quantities are conserved in certain classes of physics processes, but not in all.

In quantum mechanics, the Hamiltonian of a system is an operator corresponding to the total energy of that system, including both kinetic energy and potential energy. Its spectrum, the system's energy spectrum or its set of energy eigenvalues, is the set of possible outcomes obtainable from a measurement of the system's total energy. Due to its close relation to the energy spectrum and time-evolution of a system, it is of fundamental importance in most formulations of quantum theory.

<span class="mw-page-title-main">Particle in a box</span> Mathematical model in quantum mechanics

In quantum mechanics, the particle in a box model describes a particle free to move in a small space surrounded by impenetrable barriers. The model is mainly used as a hypothetical example to illustrate the differences between classical and quantum systems. In classical systems, for example, a particle trapped inside a large box can move at any speed within the box and it is no more likely to be found at one position than another. However, when the well becomes very narrow, quantum effects become important. The particle may only occupy certain positive energy levels. Likewise, it can never have zero energy, meaning that the particle can never "sit still". Additionally, it is more likely to be found at certain positions than at others, depending on its energy level. The particle may never be detected at certain positions, known as spatial nodes.

<span class="mw-page-title-main">Equations of motion</span> Equations that describe the behavior of a physical system

In physics, equations of motion are equations that describe the behavior of a physical system in terms of its motion as a function of time. More specifically, the equations of motion describe the behavior of a physical system as a set of mathematical functions in terms of dynamic variables. These variables are usually spatial coordinates and time, but may include momentum components. The most general choice are generalized coordinates which can be any convenient variables characteristic of the physical system. The functions are defined in a Euclidean space in classical mechanics, but are replaced by curved spaces in relativity. If the dynamics of a system is known, the equations are the solutions for the differential equations describing the motion of the dynamics.

<span class="mw-page-title-main">Molecular dynamics</span> Computer simulations to discover and understand chemical properties

Molecular dynamics (MD) is a computer simulation method for analyzing the physical movements of atoms and molecules. The atoms and molecules are allowed to interact for a fixed period of time, giving a view of the dynamic "evolution" of the system. In the most common version, the trajectories of atoms and molecules are determined by numerically solving Newton's equations of motion for a system of interacting particles, where forces between the particles and their potential energies are often calculated using interatomic potentials or molecular mechanical force fields. The method is applied mostly in chemical physics, materials science, and biophysics.

In quantum mechanics, the case of a particle in a one-dimensional ring is similar to the particle in a box. The Schrödinger equation for a free particle which is restricted to a ring is

In plasma physics, the particle-in-cell (PIC) method refers to a technique used to solve a certain class of partial differential equations. In this method, individual particles in a Lagrangian frame are tracked in continuous phase space, whereas moments of the distribution such as densities and currents are computed simultaneously on Eulerian (stationary) mesh points.

The old quantum theory is a collection of results from the years 1900–1925 which predate modern quantum mechanics. The theory was never complete or self-consistent, but was instead a set of heuristic corrections to classical mechanics. The theory has come to be understood as the semi-classical approximation to modern quantum mechanics. The main and final accomplishments of the old quantum theory were the determination of the modern form of the periodic table by Edmund Stoner and the Pauli exclusion principle which were both premised on the Arnold Sommerfeld enhancements to the Bohr model of the atom.

Direct simulation Monte Carlo (DSMC) method uses probabilistic Monte Carlo simulation to solve the Boltzmann equation for finite Knudsen number fluid flows.

In quantum mechanics, the angular momentum operator is one of several related operators analogous to classical angular momentum. The angular momentum operator plays a central role in the theory of atomic and molecular physics and other quantum problems involving rotational symmetry. Such an operator is applied to a mathematical representation of the physical state of a system and yields an angular momentum value if the state has a definite value for it. In both classical and quantum mechanical systems, angular momentum is one of the three fundamental properties of motion.

A polymer brush is the name given to a surface coating consisting of polymers tethered to a surface. The brush may be either in a solvated state, where the tethered polymer layer consists of polymer and solvent, or in a melt state, where the tethered chains completely fill up the space available. These polymer layers can be tethered to flat substrates such as silicon wafers, or highly curved substrates such as nanoparticles. Also, polymers can be tethered in high density to another single polymer chain, although this arrangement is normally named a bottle brush. Additionally, there is a separate class of polyelectrolyte brushes, when the polymer chains themselves carry an electrostatic charge.

Ewald summation, named after Paul Peter Ewald, is a method for computing long-range interactions in periodic systems. It was first developed as the method for calculating the electrostatic energies of ionic crystals, and is now commonly used for calculating long-range interactions in computational chemistry. Ewald summation is a special case of the Poisson summation formula, replacing the summation of interaction energies in real space with an equivalent summation in Fourier space. In this method, the long-range interaction is divided into two parts: a short-range contribution, and a long-range contribution which does not have a singularity. The short-range contribution is calculated in real space, whereas the long-range contribution is calculated using a Fourier transform. The advantage of this method is the rapid convergence of the energy compared with that of a direct summation. This means that the method has high accuracy and reasonable speed when computing long-range interactions, and it is thus the de facto standard method for calculating long-range interactions in periodic systems. The method requires charge neutrality of the molecular system to accurately calculate the total Coulombic interaction. A study of the truncation errors introduced in the energy and force calculations of disordered point-charge systems is provided by Kolafa and Perram.

The theoretical and experimental justification for the Schrödinger equation motivates the discovery of the Schrödinger equation, the equation that describes the dynamics of nonrelativistic particles. The motivation uses photons, which are relativistic particles with dynamics described by Maxwell's equations, as an analogue for all types of particles.

In computer simulations of mechanical systems, energy drift is the gradual change in the total energy of a closed system over time. According to the laws of mechanics, the energy should be a constant of motion and should not change. However, in simulations the energy might fluctuate on a short time scale and increase or decrease on a very long time scale due to numerical integration artifacts that arise with the use of a finite time step Δt. This is somewhat similar to the flying ice cube problem, whereby numerical errors in handling equipartition of energy can change vibrational energy into translational energy.

Cell lists is a data structure in molecular dynamics simulations to find all atom pairs within a given cut-off distance of each other. These pairs are needed to compute the short-range non-bonded interactions in a system, such as Van der Waals forces or the short-range part of the electrostatic interaction when using Ewald summation.

The hybrid QM/MM approach is a molecular simulation method that combines the strengths of ab initio QM calculations (accuracy) and MM (speed) approaches, thus allowing for the study of chemical processes in solution and in proteins. The QM/MM approach was introduced in the 1976 paper of Warshel and Levitt. They, along with Martin Karplus, won the 2013 Nobel Prize in Chemistry for "the development of multiscale models for complex chemical systems".

In quantum mechanics, the case of a particle in a one-dimensional ring is similar to the particle in a box. The particle follows the path of a semicircle from to where it cannot escape, because the potential from to is infinite. Instead there is total reflection, meaning the particle bounces back and forth between to . The Schrödinger equation for a free particle which is restricted to a semicircle is

Biology Monte Carlo methods (BioMOCA) have been developed at the University of Illinois at Urbana-Champaign to simulate ion transport in an electrolyte environment through ion channels or nano-pores embedded in membranes. It is a 3-D particle-based Monte Carlo simulator for analyzing and studying the ion transport problem in ion channel systems or similar nanopores in wet/biological environments. The system simulated consists of a protein forming an ion channel (or an artificial nanopores like a Carbon Nano Tube, CNT), with a membrane (i.e. lipid bilayer) that separates two ion baths on either side. BioMOCA is based on two methodologies, namely the Boltzmann transport Monte Carlo (BTMC) and particle-particle-particle-mesh (P3M). The first one uses Monte Carlo method to solve the Boltzmann equation, while the later splits the electrostatic forces into short-range and long-range components.

The multiphase particle-in-cell method (MP-PIC) is a numerical method for modeling particle-fluid and particle-particle interactions in a computational fluid dynamics (CFD) calculation. The MP-PIC method achieves greater stability than its particle-in-cell predecessor by simultaneously treating the solid particles as computational particles and as a continuum. In the MP-PIC approach, the particle properties are mapped from the Lagrangian coordinates to an Eulerian grid through the use of interpolation functions. After evaluation of the continuum derivative terms, the particle properties are mapped back to the individual particles. This method has proven to be stable in dense particle flows, computationally efficient, and physically accurate. This has allowed the MP-PIC method to be used as particle-flow solver for the simulation of industrial-scale chemical processes involving particle-fluid flows.

References