Hi, Site families are comparable and even hashable, and are quite efficient at this, so there’s actually nothing wrong with comparing them directly. So instead of Henry’s (that involves formatting a new string each time)
if str(site.family) == "<Monatomic lattice e0>":
...
one could use the clearer, more robust, and more efficient
if site.family == a:
...
The above uses the fact that the sublattices of graphene_e were given
names:
a, b = graphene_e.sublattices
Cheers
Christoph
smime.p7s
Description: S/MIME cryptographic signature
