I'm going to be simulating the Ising Model in 4D and above to calculate spin-spin correlations and critical exponents and am wondering how to tackle this algorithmically.
For example, in 1D, use an array to store spins. In 2D, use a matrix. In 3D, use a 2D matrix, or a three-tuple. One way I think about it is that in any dimension N, you can backtrace to the 3rd dimension to help understand nearest neighbor terms.
For example, in 2D, the spins next a particular spin in the center are just 2 1D nearest neighbors. In 3D, the spins next to a particular spin in the center are just 2 2D nearest neighbors (ie the planes perpendicular to each other).
In 4D, can I think of it as the 2 3D nearest neighbors? Similarly, how can I think of the 5D algorithmically?
Or, should I refrain from using the standard container classes and just use tuples everywhere?