bastonero / aiida-vibroscopy

Automated all-functionals infrared and Raman spectra, and phonons.
https://aiida-vibroscopy.readthedocs.io/en/latest/
Other
5 stars 2 forks source link

Generation of k-point meshes crashes for non-periodic systems #45

Open bastonero opened 1 year ago

bastonero commented 1 year ago

The create_directional_kpoints method crashes when calling pymathen for molecules. The relevant traceback:

    pymat = structure.get_pymatgen_structure()
  File "/home/bastonero/.conda/envs/aiida/lib/python3.8/site-packages/aiida/orm/nodes/data/structure.py", line 1292, in get_pymatgen_structure
    return self._get_object_pymatgen_structure(**kwargs)
  File "/home/bastonero/.conda/envs/aiida/lib/python3.8/site-packages/aiida/orm/nodes/data/structure.py", line 1838, in _get_object_pymatgen_structure
    raise ValueError('Periodic boundary conditions must apply in all three dimensions of real space')
ValueError: Periodic boundary conditions must apply in all three dimensions of real space

Per se this is not an issue as with molecules one is supposed to use only 1 kpoints. A possibility is to simply block the use of the kpoints_parallel_distance from the inputs for non periodic structures.

An other question is how to treat 1D and 2D materials. From the error, it seems pymatgen will complain. Since the projection onto crystal lattice is a very cheap operation, the call to pymatgen structure can be dropped and a custom solution implemented.

bastonero commented 9 months ago

This is actually a problem related to this PR https://github.com/aiidateam/aiida-core/pull/6281#issue-2125449409 The solution will then simply to update the dependencies of aiida-core to the future version where this PR is merged.