Skip to content

materials-science/aiida-shengbte

Repository files navigation

Build Status Coverage Status Docs status PyPI version

aiida-shengbte

aiida plugin for ShengBTE

This plugin is the default output of the AiiDA plugin cutter, intended to help developers get started with their AiiDA plugins.

Repository contents

See also the following video sequences from the 2019-05 AiiDA tutorial:

For more information, see the developer guide of your plugin.

Features

  • Add input files using SinglefileData:

    SinglefileData = DataFactory('singlefile')
    inputs['file1'] = SinglefileData(file='/path/to/file1')
    inputs['file2'] = SinglefileData(file='/path/to/file2')
  • Specify command line options via a python dictionary and DiffParameters:

    d = { 'ignore-case': True }
    DiffParameters = DataFactory('shengbte')
    inputs['parameters'] = DiffParameters(dict=d)
  • DiffParameters dictionaries are validated using voluptuous. Find out about supported options:

    DiffParameters = DataFactory('shengbte')
    print(DiffParameters.schema.schema)
  • ShengBTE Vasp WorkChain

    • Covergence criterion
    • set potential_mapping for vasp automatically
    • set proper parameters of phonopy and vasp
  • ShengBTE QE WorkChain

  • tools

    • transform control dict file to ShengBTE CONTROL file or reversely

Installation

pip install aiida-shengbte
verdi quicksetup  # better to set up a new profile
verdi plugin list aiida.calculations  # should now show your calclulation plugins

ShengBTE

ShengBTE 软件编译方法

Usage

Here goes a complete example of how to submit a test calculation using this plugin.

A quick demo of how to submit a calculation:

verdi daemon start     # make sure the daemon is running
cd examples
./example_01.py        # run test calculation
verdi process list -a  # check record of the calculation

The plugin also includes verdi commands to inspect its data types:

verdi data shengbte list
verdi data shengbte export <PK>

Notes

git clone https://github.com/PorYoung/aiida-shengbte .
cd aiida-shengbte
pip install -e .[pre-commit,testing]  # install extra dependencies
pre-commit install  # install pre-commit hooks
pytest -v  # discover and run all tests

input

dict validator

_CONTROL = {
    'allocations': {
        'nelements': {
            'type': int,
            'mandatory': True
        },
        'natoms': {
            'type': int,
            'mandatory': True
        },
        'ngrid': {
            # <len 3>
            'type': list,
            'mandatory': True
        },
        'norientations': {
            'type': int,
            'default': 0
        }
    },
    'crystal': {
        'lfactor': {
            'type': float,
            'default': 1.0
        },
        'lattvec': {
            # <3*3>
            'type': list,
            'mandatory': True
        },
        'types': {
            # <len natoms>
            'type': list,
            'mandatory': True
        },
        'elements': {
            # <len nelements>
            'type': list,
            'mandatory': True
        },
        'positions': {
            # <3 * natoms>
            'type': list,
            'mandatory': True
        },
        'masses': {
            'type': float
        },
        'gfactors': {
            'type': float
        },
        'epsilon': {
            # <3 * 3>
            'type': list,
        },
        'born': {
            # <3 * 3 * natoms>
            'type': list,
        },
        'scell': {
            # <len 3>
            'type': list,
            'mandatory': True
        },
        'orientations': {
            # <3 * norientations> mandatory unless norientations == 0
            'type': list,
            # 'mandatory': True
        }
    },
    'parameters': {
        'T': {},
        'T_min': {},
        'T_max': {},
        'T_step': {},
        'omega_max': {
            'default': 1.e100
        },
        'scalebroad': {
            'default': 1.0
        },
        'rmin': {
            'default': 5.0
        },
        'rmax': {
            'default': 505.0
        },
        'dr': {
            'default': 100.0
        },
        'maxiter': {
            'default': 1000
        },
        'nticks': {
            'default': 100
        },
        'eps': {
            'default': 1.e-5
        },
    },
    'flags': {
        'nonanalytic': {
            'default': True
        },
        'convergence': {
            'default': True
        },
        'isotopes': {
            'default': True
        },
        'autoisotopes': {
            'default': True
        },
        'nanowires': {
            'default': False
        },
        'onlyharmonic': {
            'default': False
        },
        'espresso': {
            'default': False
        }
    }
}

Retrieve List

About Retrieve List of CalcJob

Exit code conventions
  • 0 - 99: Reserved for internal use by aiida-core

  • 100 - 199: Reserved for errors parsed from scheduler output of calculation jobs (note: this is not yet implemented)

  • 200 - 299: Suggested to be used for process input validation errors

  • 300 - 399: Suggested for critical process errors

  • For any other exit codes, one can use the integers from 400 and up.

See the developer guide for more information.

Phonopy Workflow

Installation
  1. aiida container

  2. vasp container(or other remote container)

    1. clone phono3py repository
    2. create setup_mkl.py file in phono3py repository
    3. pip install -e .
Inputs
Outputs
  1. force_constants

    • type: ArrayData
    • get_array('force_constants') return force constants array
    • get_array(p2s_map)
    • phonopy.fileIO.write_FORCE_CONSTANTS( force_constants, filename='FORCE_CONSTANTS', p2s_map=None,)
  2. nac_params

    • type: ArrayData
    • get_array('epsilon')
    • get_array('born_charges')

ThirdOrder

Inputs
  • VASP
    1. require POSCAR
    2. PhonopyWorkChainNode.outputs.primitive.get_ase() return ase Atom Object
    3. ase.write('POSCAR','vasp')
Outputs

Issues

  1. ShengBTE 真实环境计算流程(如改变温度)

  2. 计算结果的存储

    • 分别就地存储
    • retrieve all results by aiida
  3. Get the real path of nodes in aiida

ref

def get_node_repository_sub_folder(uuid):
    """Return the absolute path to the sub folder `path` within the repository of the node with the given UUID.

    :param uuid: UUID of the node
    :return: absolute path to node repository folder, i.e `/some/path/repository/node/12/ab/c123134-a123/path`
    """
    from aiida.manage.configuration import get_profile

    uuid = str(uuid)

    repo_dirpath = os.path.join(get_profile().repository_path, 'repository')
    node_dirpath = os.path.join(repo_dirpath, 'node', uuid[:2], uuid[2:4], uuid[4:], 'path')

    return node_dirpath

ShengBTE Vasp WorkChain

Bugs

  1. Vasp failed with code 7 when 'tot_num_mpiprocs' set to 30

  2. ShengBTEVaspWorkflow cannot run correctly while using submit rather than run. (some Vasp calculations failed and exited)

    After submitting the workflow, all the calculations will start at the same time using the number of processes defined, so some will crash. So if the hpc has a job management system such as Torque or has sufficient processes, it would be ok.

ThirdOrder Reap Calculation

Error handle

  1. Warning: supercell too small to find n-th neighbors

Schedules

Test

  • Test current Calculations

    • Thirdorder Sow
    • Thirdorder Reap
    • ShengBTE Calculation
  • Test current Workflows

    • Thirdorder WorkChain
    • ShengBTE WorkChain
    • ShengBTE Vasp WorkChain

License

MIT

Contact

[email protected]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages