All plugins

aiida-castep

AiiDA plugin for CASTEP

status stable AiiDA >=2.0,<3.0

General information

Install pip install aiida-castep
Author(s) Bonan Zhu
Python import import aiida_castep
Latest version 2.0.1
Released 2022-05-26

Registry checks

W006: 'development_status' key is deprecated. Use PyPI Trove classifiers in the plugin repository instead.
W008: Unable to reach documentation URL: https://aiida-castep.readthedocs.io/
Click any code (W001, E001…) to jump to troubleshooting instructions .

Plugins provided

Calculations 2 Parsers 1 Data 2 Workflows 4 Console scripts 1 Other 5

Entry points

CalcJobs and calculation functions aiida.calculations
  • castep.castep

    class: aiida_castep.calculations.castep:CastepCalculation

    Class representing a generic CASTEP calculation - This class should work for all types of calculations.

    InputRequiredValid typesDescription
    parameters true Dict A node that defines the input parameters
    pseudos true Use nodes for the pseudopotentails of one ofthe element in the structure. You should pass aa dictionary specifying the pseudpotential node foreach kind such as {O: <PsudoNode>}
    structure true StructureData The input structure
    bs_kpoints false KpointsData, NoneType Extra kpoints input for task: bandstructure
    code false AbstractCode, NoneType The `Code` to use for this job. This input is required, unless the `remote_folder` input is specified, which means an existing job is being imported and no code will actually be run.
    elnes_kpoints false KpointsData, NoneType Extra kpoints input for task: elnes
    kpoints false KpointsData, NoneType Use a node defining the kpoints for the calculation
    magres_kpoints false KpointsData, NoneType Extra kpoints input for task: magres
    metadata false
    monitors false Dict Add monitoring functions that can inspect output files while the job is running and decide to prematurely terminate the job.
    optics_kpoints false KpointsData, NoneType Extra kpoints input for task: optics
    parent_calc_folder false RemoteData, NoneType Use a remote folder as the parent folder. Useful for restarts.
    phonon_fine_kpoints false KpointsData, NoneType Extra kpoints input for task: phonon, phonon+efield
    phonon_kpoints false KpointsData, NoneType Extra kpoints input for task: phonon, phonon+efield
    remote_folder false RemoteData, NoneType Remote directory containing the results of an already completed calculation job without AiiDA. The inputs should be passed to the `CalcJob` as normal but instead of launching the actual job, the engine will recreate the input files and then proceed straight to the retrieve step where the files of this `RemoteData` will be retrieved as if it had been actually launched through AiiDA. If a parser is defined in the inputs, the results are parsed and attached as output nodes as usual.
    settings false Dict, NoneType A node for additional settings
    spectral_kpoints false KpointsData, NoneType Extra kpoints input for task: spectral
    supercell_kpoints false KpointsData, NoneType Extra kpoints input for task: phonon
    OutputRequiredValid typesDescription
    output_parameters true Dict Parsed results in a dictionary format.
    remote_folder true RemoteData Input files necessary to run the process will be stored in this folder node.
    retrieved true FolderData Files that are retrieved by the daemon will be stored in this node. By default the stdout and stderr of the scheduler will be added, but one can add more by specifying them in `CalcInfo.retrieve_list`.
    remote_stash false RemoteStashData Contents of the `stash.source_list` option are stored in this remote folder after job completion.
    Exit statusMessage
    0 Calculation terminated gracefully, end found
    1 The process has failed with an unspecified error.
    2 The process failed with legacy failure mode.
    10 The process returned an invalid output.
    11 The process did not register a required output.
    100 The process did not have the required `retrieved` output.
    101 SCF Cycles failed to reach convergence
    103 Stopped execuation due to detection of 'stop ' keyword in param file.
    104 CASTEP generate error files. Check them for details
    105 Cannot find the end of calculation
    106 No output .castep files found
    107 Calculation self-terminated due to time limit
    108 No retrieve folder is found
    110 The job ran out of memory.
    120 The job ran out of walltime.
    131 The specified account is invalid.
    140 The node running the job failed.
    150 {message}
    200 UNKOWN ERROR
    501 At least one kpoints/spin has no empty bands - please rerun with increased nextra_bands.
  • castep.ts

    class: aiida_castep.calculations.castep:CastepTSCalculation

    CASTEP calculation for transition state search. Use an extra input product structure.

    InputRequiredValid typesDescription
    parameters true Dict A node that defines the input parameters
    product_structure true StructureData Product structure for transition state search.
    pseudos true Use nodes for the pseudopotentails of one ofthe element in the structure. You should pass aa dictionary specifying the pseudpotential node foreach kind such as {O: <PsudoNode>}
    structure true StructureData The input structure
    bs_kpoints false KpointsData, NoneType Extra kpoints input for task: bandstructure
    code false AbstractCode, NoneType The `Code` to use for this job. This input is required, unless the `remote_folder` input is specified, which means an existing job is being imported and no code will actually be run.
    elnes_kpoints false KpointsData, NoneType Extra kpoints input for task: elnes
    kpoints false KpointsData, NoneType Use a node defining the kpoints for the calculation
    magres_kpoints false KpointsData, NoneType Extra kpoints input for task: magres
    metadata false
    monitors false Dict Add monitoring functions that can inspect output files while the job is running and decide to prematurely terminate the job.
    optics_kpoints false KpointsData, NoneType Extra kpoints input for task: optics
    parent_calc_folder false RemoteData, NoneType Use a remote folder as the parent folder. Useful for restarts.
    phonon_fine_kpoints false KpointsData, NoneType Extra kpoints input for task: phonon, phonon+efield
    phonon_kpoints false KpointsData, NoneType Extra kpoints input for task: phonon, phonon+efield
    remote_folder false RemoteData, NoneType Remote directory containing the results of an already completed calculation job without AiiDA. The inputs should be passed to the `CalcJob` as normal but instead of launching the actual job, the engine will recreate the input files and then proceed straight to the retrieve step where the files of this `RemoteData` will be retrieved as if it had been actually launched through AiiDA. If a parser is defined in the inputs, the results are parsed and attached as output nodes as usual.
    settings false Dict, NoneType A node for additional settings
    spectral_kpoints false KpointsData, NoneType Extra kpoints input for task: spectral
    supercell_kpoints false KpointsData, NoneType Extra kpoints input for task: phonon
    OutputRequiredValid typesDescription
    output_parameters true Dict Parsed results in a dictionary format.
    remote_folder true RemoteData Input files necessary to run the process will be stored in this folder node.
    retrieved true FolderData Files that are retrieved by the daemon will be stored in this node. By default the stdout and stderr of the scheduler will be added, but one can add more by specifying them in `CalcInfo.retrieve_list`.
    remote_stash false RemoteStashData Contents of the `stash.source_list` option are stored in this remote folder after job completion.
    Exit statusMessage
    0 Calculation terminated gracefully, end found
    1 The process has failed with an unspecified error.
    2 The process failed with legacy failure mode.
    10 The process returned an invalid output.
    11 The process did not register a required output.
    100 The process did not have the required `retrieved` output.
    101 SCF Cycles failed to reach convergence
    103 Stopped execuation due to detection of 'stop ' keyword in param file.
    104 CASTEP generate error files. Check them for details
    105 Cannot find the end of calculation
    106 No output .castep files found
    107 Calculation self-terminated due to time limit
    108 No retrieve folder is found
    110 The job ran out of memory.
    120 The job ran out of walltime.
    131 The specified account is invalid.
    140 The node running the job failed.
    150 {message}
    200 UNKOWN ERROR
    501 At least one kpoints/spin has no empty bands - please rerun with increased nextra_bands.
verdi data commands aiida.cmdline.data
  • castep-helper

    aiida_castep.cmdline.helper_cmd:helper_cmd
  • castep-pseudos

    aiida_castep.cmdline.otfg_cmd:pseudos_cmd
Data node types aiida.data
  • castep.otfgdata

    aiida_castep.data.otfg:OTFGData
  • castep.uspdata

    aiida_castep.data.usp:UspData
Group types aiida.groups
  • castep.otfg

    aiida_castep.data.otfg:OTFGGroup
CalcJob parsers aiida.parsers
  • castep.castep

    aiida_castep.parsers.castep:CastepParser
Development test modules aiida.tests
  • castep.calculation

    aiida_castep.tests.dbtests.dbtestcalculation
aiida.tools.calculations aiida.tools.calculations
  • castep.castep

    aiida_castep.calculations.tools:CastepCalcTools
WorkChains and work functions aiida.workflows
  • castep.altrelax

    class: aiida_castep.workflows.relax:CastepAlterRelaxWorkChain

    A relaxation workflow that alternates between fixed cell and unfixed cell This is meidate the problem in CASTEP where if the cell is partially constraints the convergence would be very slow. To overcome this problem, the structure should be relaxed with cell constraints then restart with fixed cell and repeat. Following fields can be used in ``relax_options`` :var_cell_iter_max: Maximum iterations in variable cell relaxation, default to 10 :fix_cell_iter_max: Maximum iterations in fixed cell relaxation, default to 20

    InputRequiredValid typesDescription
    base true Data
    calc true Data
    structure true StructureData Structure to be used for relaxation.
    clean_workdir false Bool, NoneType Wether to clean the workdir of the calculations at the end of the workchain. The default is not performing any cleaning.
    metadata false
    relax_options false Dict, NoneType Options for relaxation.
    OutputRequiredValid typesDescription
    output_bands true BandsData
    output_parameters true Dict
    remote_folder true RemoteData
    output_array false ArrayData
    output_structure false StructureData The relaxed structure.
    output_trajectory false ArrayData
    Exit statusMessage
    1 The process has failed with an unspecified error.
    2 The process failed with legacy failure mode.
    10 The process returned an invalid output.
    11 The process did not register a required output.
    101 Subprocess lauched has failed in the relax stage
    102 Geometry optimisation is not converged but the maximum iteration is exceeded.
    201 NO cell_constraints find in the input
  • castep.bands

    class: aiida_castep.workflows.bands:CastepBandsWorkChain

    Workchain for running bands calculation. This workchain does the following: 1. Relax the structure if requested (eg. inputs passed to the relax namespace). 2. Optionally: Do a SCF singlepoint calculation 3. Do combined SCF + non-SCF calculation for bands and dos. Inputs must be passed for the SCF calculation (dispatched to bands and DOS), others are optional. Input for bands and dos calculations are optional. However, if they are needed, the full list of inputs must be passed. For the `parameters` node, one may choose to only specify those fields that need to be updated.

    InputRequiredValid typesDescription
    scf true Data Inputs for SCF workchain, mandatory. Used as template for bands/dos if not supplied separately
    structure true StructureData The input structure
    bands false Data Inputs for bands calculation, if needed
    bands_kpoints false KpointsData, NoneType Explicit kpoints for the bands
    bands_kpoints_distance false Float, NoneType Spacing for band distances, used by seekpath
    clean_children_workdir false Str, NoneType What part of the called children to clean
    dos false Data Inputs for DOS calculation, if needed
    dos_kpoints false KpointsData, NoneType Kpoints for running DOS calculations
    metadata false
    only_dos false Flag for running only DOS calculations
    options false Options for this workchain. Supported keywords: dos_smearing, dos_npoints.
    relax false Data Inputs for Relaxation workchain, if needed
    run_separate_scf false Flag for running a separate SCF calculation, default to False
    OutputRequiredValid typesDescription
    band_structure true Computed band structure with labels
    dos_bands false Bands from the DOS calculation
    primitive_structure false Primitive structure used for band structure calculations
    seekpath_parameters false Parameters used by seekpath
    Exit statusMessage
    1 The process has failed with an unspecified error.
    2 The process failed with legacy failure mode.
    10 The process returned an invalid output.
    11 The process did not register a required output.
    501 Relaxation workchain failed
    502 SCF workchain failed
    503 Band structure workchain failed
    504 DOS workchain failed
  • castep.base

    class: aiida_castep.workflows.base:CastepBaseWorkChain

    A basic workchain for generic CASTEP calculations. We try to handle erros such as walltime exceeded or SCF not converged

    InputRequiredValid typesDescription
    calc true Data
    calc_options false Dict, NoneType Options to be passed to calculations's metadata.options
    clean_workdir false Bool, NoneType Wether to clean the workdir of the calculations or not, the default is not clean.
    continuation_folder false RemoteData, NoneType Use a remote folder as the parent folder. Useful for restarts.
    ensure_gamma_centering false Bool, NoneType Ensure the kpoint grid is gamma centred.
    kpoints_spacing false Float, NoneType Kpoint spacing
    max_iterations false Int Maximum number of restarts
    metadata false
    options false Dict, NoneType Options specific to the workchain.Avaliable options: queue_wallclock_limit, use_castep_bin
    pseudos_family false Str, NoneType Pseudopotential family to be used
    reuse_folder false RemoteData, NoneType Use a remote folder as the parent folder. Useful for restarts.
    OutputRequiredValid typesDescription
    output_bands true BandsData
    output_parameters true Dict
    remote_folder true RemoteData
    output_array false ArrayData
    output_structure false StructureData
    output_trajectory false ArrayData
    Exit statusMessage
    1 The process has failed with an unspecified error.
    2 The process failed with legacy failure mode.
    10 The process returned an invalid output.
    11 The process did not register a required output.
    200 The maximum number of iterations has been exceeded
    201 The maximum length of the wallclocks has been exceeded
    301 CASTEP generated error files and is not recoverable
    302 Cannot reach SCF convergence despite restart efforts
    400 The stop flag has been put in the .param file to request termination of the calculation.
    900 Input validate is failed
    901 Completed one iteration but found not calculation returned
    1000 Error is not known
  • castep.relax

    class: aiida_castep.workflows.relax:CastepRelaxWorkChain

    WorkChain to relax structures. Restart the relaxation calculation until the structure is fully relaxed. Each CASTEP relaxation may finish without error with not fully relaxed structure if the number of iteration is exceeded (*geom_max_iter*). This workchain try to restart such calculations (wrapped in CastepBaseWorkChain) until the structure is fully relaxed ``relax_options`` is a Dict of the options avaliable fields are: - restart_mode: mode of restart, choose from ``reuse`` (default), ``structure``, ``continuation``. - bypass: Bypass relaxation control - e.g. no checking of the convergence. Can be used for doing singlepoint calculation.

    InputRequiredValid typesDescription
    base true Data
    calc true Data
    structure true StructureData Structure to be used for relaxation.
    clean_workdir false Bool, NoneType Wether to clean the workdir of the calculations at the end of the workchain. The default is not performing any cleaning.
    metadata false
    relax_options false Dict, NoneType Options for relaxation.
    OutputRequiredValid typesDescription
    output_bands true BandsData
    output_parameters true Dict
    remote_folder true RemoteData
    output_array false ArrayData
    output_structure false StructureData The relaxed structure.
    output_trajectory false ArrayData
    Exit statusMessage
    1 The process has failed with an unspecified error.
    2 The process failed with legacy failure mode.
    10 The process returned an invalid output.
    11 The process did not register a required output.
    101 Subprocess lauched has failed in the relax stage
    102 Geometry optimisation is not converged but the maximum iteration is exceeded.
Console scripts console_scripts
  • castep.mock

    aiida_castep.cmdline.mock_castep:mock_castep