Periodic boundary conditions
**Previous:** Details of the simulation program
**Up:** Details of the simulation program
**Next:** The pairing step

## Periodic boundary conditions

The boundary conditions are periodic. This means that the area is in
fact a hyper-torus: a particle going past the boundary on one side of
the box results in the particle being warped back to the corresponding
opposite side.

periodic4Pairing with periodic boundary conditions

The periodicity of the box applies to the pairing as well. In order to
deal with pairings that may pass through the periodic boundary, the
periodic box is replicated once in all six directions, producing 27
boxes. When the distance matrix is computed, all 27 combinations of a
quark in the middle box, and an anti-quark in one of each of the 27
boxes is calculated. Only the one with the smallest distance will be
important.

The nature of the permutation must be recorded for later
use by both the force direction calculation, and by the viewer (for
drawing parings). Three small integers valued take care of
recording which box the partner is found in. Once the pairing is
complete, the anti-quark must also be considered to be in the middle
box, and its quark must be permuted in the opposite direction. Figure
shows a two-dimensional slice of the boxes, and
shows the direction of the force vectors.

*mcr@ccs.carleton.ca*