Adjacency matrix with Periodic boundary condition - Torus

43 Views Asked by At

I have a 2-dimensional square lattice of nodes .

I need to find the distance between the nodes (adjacency matrix), but I should account for periodic boundary conditions. This means that the 2d sheet of nodes must first be wrapped into a torus, and then I should assess the distances between the nodes. I can find the adjacency matrix for a few number of nodes. But I wonder if there is a more general method that I could use to code a function that given the number of nodes in the 2D lattice would return the adjacency matrix.

I read that the adjacency matrix could be computed by using a sum of kronecker products. But I did not understand it.

Any help?