{ "name": "MinimumImage", "summary": "A displacement brought to its nearest periodic image in a box of length Box: the minimum image convention. Over real numbers the result lies in [-Box / 2, Box / 2); in FLOAT arithmetic it can land a rounding error outside that range.", "tags": [ "molecular dynamics", "periodic boundary conditions" ], "sources": [ { "title": "Allen and Tildesley, Computer Simulation of Liquids, 2nd edition (Oxford, 2017), sections 1.6.2, Periodic boundary conditions, and 1.6.3, Potential truncation: the minimum image convention" } ], "cases": [ { "call": "MinimumImage(0.75, 1.0)" }, { "call": "MinimumImage(-0.75, 1.0)" }, { "call": "MinimumImage(2.3, 1.0)" }, { "call": "MinimumImage(0.5, 1.0)" }, { "call": "MinimumImage(-12.0, 10.0)" }, { "call": "MinimumImage(1.35, 0.1)" } ], "references": [ { "lang": "python", "level": "plain", "file": "ref/python/plain.py", "note": "The same formula with math.floor." }, { "lang": "c", "level": "plain", "file": "ref/c/plain.c", "note": "The same formula with floor from math.h." }, { "lang": "mojo", "level": "plain", "file": "ref/mojo/plain.mojo", "note": "The same formula in Mojo, with floor from std.math." } ], "proof": { "lang": "dafny", "file": "proof/minimum_image.dfy", "note": "Over real numbers the result lies in [-Box / 2, Box / 2) and differs from Dx by a whole number of box lengths." } }