SpiDy.NNlattice
— FunctionNNlattice(N, Jh, Jv; boundary=nothing)
Create the spin-spin coupling matrix of a NxN
2D lattice with nearest-neighbour interactions and specified horizontal and vertical coupling strengths, Jh
and Jv
respectively.
Arguments
N
: The size of the lattice (N x N).Jh
: The horizontal nearest-neighbour coupling strength.Jv
: The vertical nearest-neighbour coupling strength.boundary=nothing
: (Optional) Specifies the boundary condition of the lattice. Default isnothing
which corresponds to open edges. Use:periodic
for periodic boundary condition.
Returns
An N^2×N^2
array representing the coupling matrix of the lattice.
Examples
julia> J = NNlattice(3, 2.0, 1.0)
+ 2.0 0.0 2.0 0.0