siesta-project / aiida_siesta_plugin

Source code for the AiiDA-Siesta package (plugin and workflows). See wiki
Other
6 stars 11 forks source link

Support for sisl types #51

Open pfebrer opened 4 years ago

pfebrer commented 4 years ago

Hi! Do you think it makes sense to have support for sisl types in the SiestaBaseWorkchain?

Using a very simple serializer for the inputs:

def sisl_serializer(sisl_obj):
    '''
    Function that converts sisl objects to aiida types.
    '''
    try:
        import sisl
    except ModuleNotFoundError:
        return

    if isinstance(sisl_obj, sisl.Geometry):
        return StructureData(ase=sisl_obj.toASE())
    elif isinstance(sisl_obj, sisl.MonkhorstPack):
        kpoints = KpointsData()
        kpoints.set_kpoints_mesh(sisl_obj._diag, sisl_obj._displ)
        return kpoints

then you could directly pass geometries from sisl as inputs for an aiida workflow, which I believe it's interesting because sisl can read structures from fdf, XV, etc... and this would probably reduce the friction between siesta users and aiida.

Or maybe it's not worth it because the user may be creating multiple nodes with the same structure without knowing it?

zerothi commented 2 years ago

This should be much easier with a coming change. Sisl will enable one to parse buffers as files. See https://github.com/zerothi/sisl/issues/484