MagneticStructureEnumerator Unable to enumerate

Dear developers,

I encountered the following problem when trying to use the MagneticStructureEnumerator. Maybe you could kindly help me spot what I am doing wrong?

Using NiO as an example structure :

from pymatgen.core import Lattice, Structure
from pymatgen.analysis.magnetism.analyzer import *

latt = Lattice.cubic(4.17)
species = ["Ni", "O"]
coords = [[0.00000, 0.00000, 0.00000], [0.50000, 0.50000, 0.50000]]
NiO = Structure.from_spacegroup(225, latt, species, coords)

enumerator = MagneticStructureEnumerator(NiO)

I get ValueError: Unable to enumerate. Here is the full log

I tried updating pymatgen (version 2020.7.3) and tried supplying default_magmoms.

enumerator = MagneticStructureEnumerator(NiO,default_magmoms={'Ni':5.})

But this gives the same error.

The enum.x executable I am using comes from anaconda matsci.

Thanks in advance,

I am having a similar issue as Natalya,
I am going through the genmatb Jupiter notebooks and are trying to follow along with data_driven first-principles methods for studying and design of alkali superionic conductors part 1 structure generation. It fails to run the apply_transformation command with an error message of Unable to enumerate

Thanks @sheren and @Kai_Duemmler for the report, I’ll take a look. This function should be working, can I ask if either of you have tried compiling your own enumlib directly from its source? The version on conda is quite old, and the compilation is fairly straight forward.

I complied the enumlib through the make command within Cygwin.

Thanks @Kai_Duemmler.

Ok, I just tried the exact code @sheren reported, and it’s working for me. To be specific, this is using a freshly-compiled enum.x and makestr.x from the enumlib repo (v2.04), and works with both pymatgen 2020.4.29 and 2020.7.3.

So, possibilities… we can check that both enum.x and makestr.x are available in your PATH (perhaps you’re using instead, which should be equivalent to makestr.x but perhaps the bug is there). I suspect it might be some issue with your enumlib compilation itself, so perhaps you can try running enum.x on its own to verify it’s working.

Also noting here that @Kai_Duemmler, your issue is with the EnumerateStructureTransformation not the MagneticStructureEnumerator specifically that @sheren is having issues with. Both use enumlib, so it suggests the issue is likely with the underlying enumlib installation rather than pymatgen.

I think I understand my issue now. I cannot run enum.x outside of Cygwin or it fails due to not finding cygwin1.dll and cyggfortran-5.dll but when I run my python script within Cygwin it executes the enumeration. When I originally did the examples in the enumlib I must have done them within Cygwin instead of the cmd on my windows computer.

Great, compiling fresh enumx. and makestr.x from the source link worked. Thank you, @mkhorton, I appreciate your reply!

1 Like