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">Molecular diffusion</span> Thermal motion of liquid or gas particles at temperatures above absolute zero

Molecular diffusion, often simply called diffusion, is the thermal motion of all particles at temperatures above absolute zero. The rate of this movement is a function of temperature, viscosity of the fluid and the size (mass) of the particles. Diffusion explains the net flux of molecules from a region of higher concentration to one of lower concentration. Once the concentrations are equal the molecules continue to move, but since there is no concentration gradient the process of molecular diffusion has ceased and is instead governed by the process of self-diffusion, originating from the random motion of the molecules. The result of diffusion is a gradual mixing of material such that the distribution of molecules is uniform. Since the molecules are still in motion, but an equilibrium has been established, the result of molecular diffusion is called a "dynamic equilibrium". In a phase with uniform temperature, absent external net forces acting on the particles, the diffusion process will eventually result in complete mixing.

<span class="mw-page-title-main">Dynamical system</span> Mathematical model of the time dependence of a point in space

In mathematics, a dynamical system is a system in which a function describes the time dependence of a point in an ambient space, such as in a parametric curve. Examples include the mathematical models that describe the swinging of a clock pendulum, the flow of water in a pipe, the random motion of particles in the air, and the number of fish each springtime in a lake. The most general definition unifies several concepts in mathematics such as ordinary differential equations and ergodic theory by allowing different choices of the space and how time is measured. Time can be measured by integers, by real or complex numbers or can be a more general algebraic object, losing the memory of its physical origin, and the space may be a manifold or simply a set, without the need of a smooth space-time structure defined on it.

<span class="mw-page-title-main">Feynman diagram</span> Pictorial representation of the behavior of subatomic particles

In theoretical physics, a Feynman diagram is a pictorial representation of the mathematical expressions describing the behavior and interaction of subatomic particles. The scheme is named after American physicist Richard Feynman, who introduced the diagrams in 1948. The interaction of subatomic particles can be complex and difficult to understand; Feynman diagrams give a simple visualization of what would otherwise be an arcane and abstract formula. According to David Kaiser, "Since the middle of the 20th century, theoretical physicists have increasingly turned to this tool to help them undertake critical calculations. Feynman diagrams have revolutionized nearly every aspect of theoretical physics." While the diagrams are applied primarily to quantum field theory, they can also be used in other areas of physics, such as solid-state theory. Frank Wilczek wrote that the calculations that won him the 2004 Nobel Prize in Physics "would have been literally unthinkable without Feynman diagrams, as would [Wilczek's] calculations that established a route to production and observation of the Higgs particle."

<span class="mw-page-title-main">Fick's laws of diffusion</span> Mathematical descriptions of molecular diffusion

Fick's laws of diffusion describe diffusion and were first posited by Adolf Fick in 1855 on the basis of largely experimental results. They can be used to solve for the diffusion coefficient, D. Fick's first law can be used to derive his second law which in turn is identical to the diffusion equation.

<span class="mw-page-title-main">Kaluza–Klein theory</span> Unified field theory

In physics, Kaluza–Klein theory is a classical unified field theory of gravitation and electromagnetism built around the idea of a fifth dimension beyond the common 4D of space and time and considered an important precursor to string theory. In their setup, the vacuum has the usual 3 dimensions of space and one dimension of time but with another microscopic extra spatial dimension in the shape of a tiny circle. Gunnar Nordström had an earlier, similar idea. But in that case, a fifth component was added to the electromagnetic vector potential, representing the Newtonian gravitational potential, and writing the Maxwell equations in five dimensions.

<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 the movement of a free particle 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">Wave function</span> Mathematical description of the quantum state of a system

In quantum physics, a wave function is a mathematical description of the quantum state of an isolated quantum system. The most common symbols for a wave function are the Greek letters ψ and Ψ. Wave functions are complex-valued. For example, a wave function might assign a complex number to each point in a region of space. The Born rule provides the means to turn these complex probability amplitudes into actual probabilities. In one common form, it says that the squared modulus of a wave function that depends upon position is the probability density of measuring a particle as being at a given place. The integral of a wavefunction's squared modulus over all the system's degrees of freedom must be equal to 1, a condition called normalization. Since the wave function is complex-valued, only its relative phase and relative magnitude can be measured; its value does not, in isolation, tell anything about the magnitudes or directions of measurable observables. One has to apply quantum operators, whose eigenvalues correspond to sets of possible results of measurements, to the wave function ψ and calculate the statistical distributions for measurable quantities.

In mathematics, a self-adjoint operator on a complex vector space V with inner product is a linear map A that is its own adjoint. If V is finite-dimensional with a given orthonormal basis, this is equivalent to the condition that the matrix of A is a Hermitian matrix, i.e., equal to its conjugate transpose A. By the finite-dimensional spectral theorem, V has an orthonormal basis such that the matrix of A relative to this basis is a diagonal matrix with entries in the real numbers. This article deals with applying generalizations of this concept to operators on Hilbert spaces of arbitrary dimension.

<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.

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

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.

Dimensional reduction is the limit of a compactified theory where the size of the compact dimension goes to zero. In physics, a theory in D spacetime dimensions can be redefined in a lower number of dimensions d, by taking all the fields to be independent of the location in the extra D − d dimensions.

In plasma physics, the Hasegawa–Mima equation, named after Akira Hasegawa and Kunioki Mima, is an equation that describes a certain regime of plasma, where the time scales are very fast, and the distance scale in the direction of the magnetic field is long. In particular the equation is useful for describing turbulence in some tokamaks. The equation was introduced in Hasegawa and Mima's paper submitted in 1977 to Physics of Fluids, where they compared it to the results of the ATC tokamak.

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.

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

<span class="mw-page-title-main">Finite element method</span> Numerical method for solving physical or engineering problems

The finite element method (FEM) is a popular method for numerically solving differential equations arising in engineering and mathematical modeling. Typical problem areas of interest include the traditional fields of structural analysis, heat transfer, fluid flow, mass transport, and electromagnetic potential.

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.

Finite volume method (FVM) is a numerical method. FVM in computational fluid dynamics is used to solve the partial differential equation which arises from the physical conservation law by using discretisation. Convection is always followed by diffusion and hence where convection is considered we have to consider combine effect of convection and diffusion. But in places where fluid flow plays a non-considerable role we can neglect the convective effect of the flow. In this case we have to consider more simplistic case of only diffusion. The general equation for steady convection-diffusion can be easily derived from the general transport equation for property by deleting transient.

In theoretical physics, Hamiltonian field theory is the field-theoretic analogue to classical Hamiltonian mechanics. It is a formalism in classical field theory alongside Lagrangian field theory. It also has applications in quantum field theory.

References