SunnySuite / Sunny.jl

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

Strange atom coloring #268

Open kbarros opened 2 months ago

kbarros commented 2 months ago

The atom coloring can be confusing in this case:

using Sunny, GLMakie
positions = [[2/3, 1/3, 0],
             [1/3, 2/3, 0],
             [0, 0, 1/3],
             [1/3, 2/3, 1/3],
             [0, 0, 2/3],
             [2/3, 1/3, 2/3]]
lat_vecs = lattice_vectors(1, 1, 2, 90, 90, 120)
cryst = Crystal(lat_vecs, positions; types=["A", "A", "B", "B", "C", "C"])
view_crystal(cryst)

which infers

Crystal
Spacegroup 'P 3 m 1' (156)
Lattice params a=1, b=1, c=2, α=90°, β=90°, γ=120°
Cell volume 1.732
Type 'A', Wyckoff 1c (point group '3m.'):
   1. [2/3, 1/3, 0]
Type 'A', Wyckoff 1b (point group '3m.'):
   2. [1/3, 2/3, 0]
Type 'B', Wyckoff 1a (point group '3m.'):
   3. [0, 0, 1/3]
Type 'B', Wyckoff 1b (point group '3m.'):
   4. [1/3, 2/3, 1/3]
Type 'C', Wyckoff 1a (point group '3m.'):
   5. [0, 0, 2/3]
Type 'C', Wyckoff 1c (point group '3m.'):
   6. [2/3, 1/3, 2/3]

"B" and "C" are actual elements (boron and carbon), so they can get "real" colors. "A" is not an actual element, so then Sunny assigns the two "A" atoms distinct colors because they are symmetry-inequivalent sites.

image

Maybe if a type is specified, then we should always color by type, and not by symmetry equivalence.