SINGROUP / dscribe

DScribe is a python package for creating machine learning descriptors for atomistic systems.
https://singroup.github.io/dscribe/
Apache License 2.0
405 stars 90 forks source link

SOAP computation hangs when `calc` is not `None` in ASE trajectory #83

Open tsitsvero opened 2 years ago

tsitsvero commented 2 years ago

Seems like there's a bug that hangs computations of SOAP descriptors when the input ASE trajectory snapshots have calculators assigned. Tried with dscribe 1.2.1.

for mol in mol_traj:
        mol.calc=XTB(method="GFN2-xTB")     
        ... # some calculations
        mol.calc=None # without this line SOAP calculation hangs...

soap = SOAP(
            species=["H", "C", "O"],
            periodic=False,
            rcut=5.0,
            sigma=0.5,
            nmax=5,
            lmax=5,
            average="outer",
            crossover=True,
            dtype='float64
            )

pos = [0,1,4,5]

derivatives, descriptors = soap.derivatives(
            mol_traj,
            positions=[pos] * len(mol_traj),
            n_jobs=10,
            # method="analytical"
            )
lauri-codes commented 2 years ago

That is quite interesting... DScribe is not directly using the calculator objects for anything, so I'm not sure where this is coming from. DScribe could always unassign the calc-property from the systems, but that does not seem right either if the user is not expecting this. Making a copy is an option but it may be quite expensive to do. Needs some thinking, but the workaround of unassigning the calc-property should do before there is a better fix.

tsitsvero commented 2 years ago

Thanks! I'll also let know if this problem will persist in the future.