-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable interaction ranges that coincide with lattice periodicity #8
Comments
Good catch, thanks! It shouldn't have been possible to instantiate a lattice with spin self-interactions in the first place. The problem with self-interactions is that they result in quadratic contributions to the energy change upon updating the spin configuration -- however, the |
Thanks for the quick reply. However, the modification to Line 25 of Lattice.jl prevents one from constructing certain clusters. For example, consider a cluster consisting of one basis site per unit cell, with linear dimensions I think it would be beneficial to allow for spin self-interactions via periodic boundary conditions so that one has the freedom to construct lattices that are "short" in one direction without modifying the form of the interactions. For example, one may wish to study an incommensurate magnetic order by considering a long cluster in one linear dimension with |
While currently not possible in the naive way, there is a workaround for your use case: For a small cluster, you could manually replace any two-spin interaction whose interaction range coincides with the periodicity of the lattice with explicitly local interactions, using the It would, of course, be nice to make this replacement automatically upon lattice instantiation. |
While using SpinMC.jl to study a ferromagnetic system, I found a bug in the trivial case of a one-site cluster, that is, one basis site in one primitive unit cell. Let there be zero onsite or field interactions, but allow for a finite two-spin interaction. The function
getEnergy()
in Spin.jl initializes an energy of value0.0
on Line 16 but never updates this value on Line 26; this is becausesite > interactionSites[i]
can never evaluate totrue
for a one-site cluster, as both sides have the value1
.I believe this restriction is to avoid double-counting each bond's energy contribution. One fix could be to remove this restriction, sum over all sites, and divide by two.
The text was updated successfully, but these errors were encountered: