SunnySuite / Sunny.jl

Spin dynamics and generalization to SU(N) coherent states
Other
86 stars 19 forks source link

Coefficients in print_bond() are not used consistently within a bond equivalence class #53

Closed kbarros closed 1 year ago

kbarros commented 1 year ago

Consider two symmetry equivalent, nearest neighbor bonds on a square lattice:

using Sunny

latvecs = lattice_vectors(1, 1, 4, 90, 90, 90)
cryst = Crystal(latvecs, [[0,0,0]])

b1 = Bond(1, 1, [-1, 0, 0])
b2 = Bond(1, 1, [0, -1, 0])

If we ask about their allowed exchange matrices individually, the meanings of A and B will depend on context. That is,

print_bond(cryst, b1)
print_bond(cryst, b2)

will in both cases print

Allowed exchange matrix: | A  0  0 |
                         | 0  B  0 |
                         | 0  0  C |

It would be better to uses a consistent "reference bond" and report something along the lines of this internal function:

Sunny.print_mutually_allowed_couplings(cryst, [b1, b2])

which prints

Bond(1, 1, [-1, 0, 0])
  | A  0  0 |
  | 0  B  0 |
  | 0  0  C |

Bond(1, 1, [0, -1, 0])
  | B  0  0 |
  | 0  A  0 |
  | 0  0  C |