aiida_crystal17.data package

Submodules

aiida_crystal17.data.basis_set module

a data type to store CRYSTAL17 basis sets

class aiida_crystal17.data.basis_set.BasisSetData(filepath, **kwargs)[source]

Bases: aiida.orm.nodes.data.data.Data

a data type to store CRYSTAL17 basis sets it is intended to work much like the UpfData type

  • The basis file must contain one basis set in the CRYSTAL17 format

  • lines beginning # will be ignored

  • the file can also start with a fenced, yaml formatted header section (starting/ending ‘—’) (Note keys should not contain ‘.’s)

  • only the actual basis data (not commented lines or the header section) will be stored as a file and hashed

Example file

# an ignored comment
---
author: J Smith
year: 1999
---
8 2
1 0 3  2.  0.
1 1 3  6.  0.
basisfamily_type_string = 'crystal17.basisset'
property content

return the content string for insertion into .d12 file

Returns

content_str

property element

return the element symbol associated with the basis set

property filename

Returns the name of the file stored

classmethod from_md5(md5)[source]

Return a list of all Basis Sets that match a given MD5 hash.

Note that the hash has to be stored in a _md5 attribute, otherwise the basis will not be found.

get_basis_family_names()[source]

Get the list of all basiset family names to which the basis belongs

classmethod get_basis_group(group_name)[source]

Return the BasisFamily group with the given name.

classmethod get_basis_group_map(group_name)[source]

get a mapping of elements to basissets in a basis set family

Parameters

group_name (str) – the group name of the basis set

Returns

a mapping of element to basis set

Return type

dict

Raises

aiida.common.exceptions.MultipleObjectsError – if there is more than one element s

classmethod get_basis_groups(filter_elements=None, user=None)[source]

Return all names of groups of type BasisFamily, possibly with some filters.

Parameters
  • filter_elements – A string or a list of strings. If present, returns only the groups that contains one Basis for every element present in the list. Default=None, meaning that all families are returned.

  • user – if None (default), return the groups for all users. If defined, it should be either a DbUser instance, or a string for the username (that is, the user email).

classmethod get_basissets_by_kind(structure, family_name)[source]

Get a dictionary of {kind: basis} for all the kinds within the given structure using the given basis set family name.

Parameters
  • structure – The structure that will be used.

  • family_name – the name of the group containing the basis sets

classmethod get_basissets_from_structure(structure, family_name, by_kind=False)[source]

Given a family name (a BasisSetFamily group in the DB) and an AiiDA structure, return a dictionary associating each element or kind name (if by_kind=True) with its BasisSetData object.

Raises
classmethod get_or_create(filepath, use_first=False, store_basis=True)[source]

Pass the same parameter of the init; if a file with the same md5 is found, that BasisSetData is returned.

Parameters
  • filepath – an absolute filename on disk

  • use_first – if False (default), raise an exception if more than one basis set is found. If it is True, instead, use the first available basis set.

  • store_basis (bool) – If false, the BasisSetData objects are not stored in the database. default=True.

Return (basis, created)

where basis is the BasisSetData object, and create is either True if the object was created, or False if the object was retrieved from the DB.

property md5sum

return the md5 hash of the basis set

Returns

property metadata

return the attribute data as a nested dictionary

Returns

metadata dict

open(mode='r')[source]

Return an open file handle to the content of this data node.

Parameters

mode – the mode with which to open the file handle

Returns

a file handle in read mode

classmethod prepare_and_validate_inputs(structure, basissets=None, basis_family=None)[source]

validate and prepare a dictionary mapping elements of the structure to a BasisSetData node, for use as input to a calculation

Parameters
  • structure (aiida.StructureData) –

  • basissets (dict) – a dictionary where keys are the symbol names and value are BasisSetData nodes

  • basis_family (str) – basis set family name to use

Raises

ValueError – if neither basissets or basis_family is specified or if no BasisSetData is found for every element in the structure

set_file(filepath)[source]

pre-parse the file to store the attributes and content separately.

store(with_transaction=True, use_cache=None)[source]

Store a new node in the DB, also saving its repository directory and attributes, and reparsing the file so that the md5 and the element are correctly reset.

After being called attributes cannot be changed anymore! Instead, extras can be changed only AFTER calling this store() function.

Note

After successful storage, those links that are in the cache, and for which also the parent node is already stored, will be automatically stored. The others will remain unstored.

Parameters

with_transaction – if False, no transaction is used. This is meant to be used ONLY if the outer calling function has already a transaction open!

classmethod upload_basisset_family(folder, group_name, group_description, stop_if_existing=True, extension='.basis', dry_run=False)[source]

Upload a set of Basis Set files in a given group.

Parameters
  • folder – a path containing all Basis Set files to be added. Only files ending in set extension (case-insensitive) considered

  • group_name – the name of the group to create. If it exists and is non-empty, a UniquenessError is raised.

  • group_description – a string to be set as the group description. Overwrites previous descriptions, if the group was existing.

  • stop_if_existing – if True, check for the md5 of the files and, if file already exists in the DB, raises a MultipleObjectsError. If False, simply adds the existing BasisSetData node to the group.

  • extension – the filename extension to look for

  • dry_run – If True, do not change the database.

aiida_crystal17.data.basis_set.md5_from_string(string, encoding='utf-8')[source]

return md5 hash of string

Parameters
  • string – the string to hash

  • encoding – the encoding to use

Returns

aiida_crystal17.data.basis_set.parse_basis(fname)[source]

get relevant information from the basis file

Parameters

fname – the file path

Returns

(metadata_dict, content_str)

  • The basis file must contain one basis set in the CRYSTAL17 format

  • blank lines and lines beginning ‘#’ will be ignored

  • the file can also start with a fenced (with —), yaml formatted header section (Note keys should not contain ‘.’s)

Example

# an ignored comment
---
author: J Smith
year: 1999
---
8 2
1 0 3  2.  0.
1 1 3  6.  0.
aiida_crystal17.data.basis_set.validate_basis_string(instr)[source]

validate that only one basis set is present, in a recognised format

Parameters

instr – content of basis set

Returns

passed

aiida_crystal17.data.input_params module

class aiida_crystal17.data.input_params.CryInputParamsData(data=None, unflatten=False, **kwargs)[source]

Bases: aiida.orm.nodes.data.data.Data

stores a validated dictionary of input parameters for CryMainCalculations

stores a validated dictionary of input parameters for CryMainCalculations

Parameters
  • data (dict) – the data to set

  • unflatten (bool) – whether to unflatten the dictionary, e.g. from {“a.b”: 1} to {“a”: {“b”: 1}}

property data

Return an instance of AttributeManager that transforms the dictionary into an attribute dict.

Note

this will allow one to do node.dict.key as well as node.dict[key].

Returns

an instance of the AttributeResultManager.

data_schema = {'$schema': 'http://json-schema.org/draft-04/schema#', 'additionalProperties': False, 'description': 'Allowed Inputs For CRYSTAL17 .d12 file', 'properties': {'basis_set': {'additionalProperties': False, 'description': 'Basis sets input and control', 'properties': {'CHARGED': {'description': 'forces the overall system to be neutral even when the number of electrons in the reference cell is different from the sum of nuclear charges, by adding a uniform background charge density to neutralize the charge in the reference cell.', 'type': 'boolean'}}, 'title': 'Block 2', 'type': 'object'}, 'geometry': {'additionalProperties': False, 'description': 'Geometry input, manipulation and optimisation control', 'properties': {'info_external': {'description': 'keywords for external output', 'items': {'enum': ['COORPRT', 'EXTPRT', 'FINDSYM', 'STRUCPRT', 'SYMMOPS'], 'type': 'string', 'uniqueItems': True}, 'type': 'array'}, 'info_print': {'description': 'keywords for printing', 'items': {'enum': ['ATOMSYMM', 'MAKESAED', 'PRSYMDIR', 'SYMMDIR', 'SYMMOPS', 'PRINTCHG'], 'type': 'string', 'uniqueItems': True}, 'type': 'array'}, 'optimise': {'additionalProperties': False, 'description': 'optimisation block inputs', 'properties': {'convergence': {'additionalProperties': False, 'description': 'optimisation convergence criteria', 'properties': {'FINALRUN': {'description': 'run final Wf single point scf with optimized geometry', 'maximum': 4, 'minimum': 1, 'type': 'integer'}, 'MAXCYCLE': {'description': 'max number of optimization steps', 'minimum': 1, 'type': 'integer'}, 'TOLDEE': {'description': 'total energy difference between two steps', 'minimum': 1, 'type': 'integer'}, 'TOLDEG': {'description': 'RMS of the gradient', 'exclusiveMinimum': True, 'minimum': 0, 'type': 'number'}, 'TOLDEX': {'description': 'RMS of the displacement', 'exclusiveMinimum': True, 'minimum': 0, 'type': 'number'}}, 'type': 'object'}, 'gradient': {'description': 'the minimisation gradient to use', 'enum': ['NUMGRATO', 'NUMGRCEL', 'NUMGRALL'], 'type': 'string'}, 'hessian': {'description': 'the initial hessian matrix to use', 'enum': ['HESSIDEN', 'HESSMOD1', 'HESSMOD2', 'HESSNUM', 'HESSOPT'], 'type': 'string'}, 'info_print': {'description': 'keywords for printing', 'items': {'enum': ['PRINTFORCES', 'PRINTHESS', 'PRINTOPT', 'PRINT'], 'type': 'string', 'uniqueItems': True}, 'type': 'array'}, 'restart': {'default': False, 'description': 'whether to insert the RESTART command (requires an OPTINFO.DAT file to be present)', 'type': 'boolean'}, 'type': {'description': 'the optimisation type', 'enum': ['FULLOPTG', 'CELLONLY', 'INTREDUN', 'ITATOCEL', 'CVOLOPT'], 'type': 'string'}}, 'type': ['object', 'boolean']}}, 'title': 'Block 1', 'type': 'object'}, 'scf': {'additionalProperties': False, 'dependencies': {'dft': {'not': {'required': ['single']}}, 'single': {'not': {'required': ['dft']}}}, 'description': 'Single particle Hamiltonian and SCF control', 'properties': {'GUESSP': {'default': False, 'description': 'whether to insert the GUESSP command (requires a fort.20 file to be present)', 'type': 'boolean'}, 'dft': {'additionalProperties': False, 'description': 'the exchange-correlation functional to use', 'properties': {'SPIN': {'description': 'whether to use spin polarisation', 'type': 'boolean'}, 'grid': {'description': 'the (pruned) integration grid', 'enum': ['OLDGRID', 'LGRID', 'XLGRID', 'XXLGRID'], 'type': 'string'}, 'grid_weights': {'description': 'the grid point weights of the integration grid', 'enum': ['BECKE', 'SAVIN'], 'type': 'string'}, 'numerical': {'additionalProperties': False, 'definition': 'Numerical accuracy and computational parameters control', 'properties': {'LIMBEK': {'description': 'size of local arrays for integration weights', 'exclusiveMinimum': True, 'minimum': 0, 'type': 'integer'}, 'TOLLDENS': {'description': 'density tolerance', 'exclusiveMinimum': True, 'minimum': 0, 'type': 'integer'}, 'TOLLGRID': {'description': 'grid weight tolerance', 'exclusiveMinimum': True, 'minimum': 0, 'type': 'integer'}}, 'type': 'object'}, 'xc': {'description': 'the exchange-correlation functional', 'oneOf': [{'type': 'array', 'additionalItems': False, 'items': [{'type': 'string', 'enum': ['LDA', 'VBH', 'BECKE', 'PBE', 'PBESOL', 'PWGGA', 'mPW91', 'SOGGA', 'WCGGA']}, {'type': 'string', 'enum': ['PZ', 'VBH', 'VWN', 'LYP', 'PBE', 'PBESOL', 'PWGGA', 'PWLSD', 'WL']}]}, {'type': 'string', 'enum': ['SVWN', 'BLYP', 'PBEXC', 'PBESOLXC', 'SOGGAXC', 'B3PW', 'B3LYP', 'PBE0', 'PBESOL0', 'B1WC', 'WC1LYP', 'B97H', 'PBE0-13', 'HSE06', 'HSESOL', 'SC-BLYP', 'HISS', 'RSHXLDA', 'wB97', 'wB97X', 'LC-wPBE', 'LC-wPBESOL', 'LC-wBLYP', 'LC-BLYP', 'CAM-B3LYP', 'M06L', 'B2PLYP', 'B2GPPLYP', 'mPW2PLYP', 'DHYBRID']}, {'type': 'object', 'additionalProperties': False, 'minProperties': 1, 'maxProperties': 1, 'properties': {'LSRSH-PBE': {'type': 'array', 'additionalItems': False, 'minItems': 3, 'items': [{'description': 'value of the length scale separation, w', 'type': 'number', 'minimum': 0, 'exclusiveMinimum': True}, {'description': 'value of the coefficient for the SR-HF exchange term', 'type': 'number', 'minimum': 0, 'exclusiveMinimum': True}, {'description': 'value of the coefficient for the LR-HF exchange term', 'type': 'number', 'minimum': 0, 'exclusiveMinimum': True}]}}}]}}, 'required': ['xc'], 'type': 'object'}, 'fock_mixing': {'description': 'convergence acceleration tool', 'oneOf': [{'type': 'string', 'enum': ['DIIS', 'DIISALLK', 'SLOSHING', 'NODIIS', 'ANDERSON']}, {'type': 'object', 'additionalProperties': False, 'minProperties': 1, 'maxProperties': 1, 'properties': {'BROYDEN': {'type': 'array', 'minItems': 3, 'maxitems': 3, 'items': [{'description': 'W0 parameter in Anderson’s paper', 'type': 'number', 'minimum': 0, 'exclusiveMinimum': True}, {'description': 'percent of Fock/KS matrices mixing when Broyden method is switched on', 'type': 'integer', 'minimum': 0, 'exclusiveMinimum': True}, {'description': 'SCf iteration after which Broyden method is active', 'type': 'integer', 'minimum': 2}]}}}]}, 'k_points': {'description': 'The IS and ISP value to use for SHRINK, IS can be a single value or a value for each direction', 'items': [{'type': ['integer', 'array'], 'minimum': 1, 'minItems': 3, 'maxItems': 3, 'items': {'type': 'integer', 'minimum': 1}}, {'type': 'integer', 'minimum': 1}], 'maxItems': 2, 'minItems': 2, 'type': 'array'}, 'numerical': {'additionalProperties': False, 'definition': 'Numerical accuracy and computational parameters control', 'properties': {'BIPOLAR': {'additionalItems': False, 'description': 'Bipolar expansion approximation control', 'items': [{'description': 'overlap threshold for Coulomb', 'type': 'integer', 'minimum': 0, 'exclusiveMinimum': True}, {'description': 'overlap threshold for Exchange', 'type': 'integer', 'minimum': 0, 'exclusiveMinimum': True}], 'minItems': 2, 'type': 'array'}, 'BIPOSIZE': {'description': 'Size of buffer for Coulomb integrals bipolar expansion', 'exclusiveMinimum': True, 'minimum': 0, 'type': 'integer'}, 'EXCHPERM': {'description': 'use permutation of centers in exchange integrals', 'type': 'boolean'}, 'EXCHSIZE': {'description': 'Size of buffer for Exchange integrals bipolar expansion', 'exclusiveMinimum': True, 'minimum': 0, 'type': 'integer'}, 'FMIXING': {'description': 'Fock/KS matrix (cycle i and i-1) mixing', 'minimum': 0, 'type': 'integer'}, 'ILASIZE': {'description': 'Maximum size of array ILA for 2-electron integral calculation', 'exclusiveMinimum': True, 'minimum': 0, 'type': 'integer'}, 'INTGPACK': {'description': 'Choice of integrals package', 'maximum': 3, 'minimum': 0, 'type': 'integer'}, 'LEVSHIFT': {'additionalItems': False, 'description': 'Eigenvalue level shifting', 'items': [{'description': 'The level shifter is set to ISHIFT*0.1 hartree', 'type': 'integer', 'minimum': 0, 'exclusiveMinimum': True}, {'description': 'locking on/off', 'type': 'integer', 'minimum': 0, 'maximum': 1}], 'minItems': 2, 'type': 'array'}, 'MADELIND': {'description': 'reciprocal lattice vector indices for Madelung sums', 'exclusiveMinimum': True, 'minimum': 0, 'type': 'integer'}, 'MAXCYCLE': {'description': 'maximum number of cycles', 'exclusiveMinimum': True, 'minimum': 0, 'type': 'integer'}, 'NOBIPCOU': {'description': 'Coulomb bielectronic integrals computed exactly', 'type': 'boolean'}, 'NOBIPEXCH': {'description': 'Exchange bielectronic integrals computed exactly', 'type': 'boolean'}, 'NOBIPOLA': {'description': 'All bielectronic integrals computed exactly', 'type': 'boolean'}, 'POLEORDR': {'description': 'Maximum order of multipolar expansion', 'exclusiveMinimum': True, 'minimum': 0, 'type': 'integer'}, 'SMEAR': {'description': 'temperature smearing of Fermi surface', 'minimum': 0, 'type': 'number'}, 'TOLDEE': {'description': 'convergence on total energy', 'exclusiveMinimum': True, 'minimum': 0, 'type': 'integer'}, 'TOLINTEG': {'description': 'Bipolar expansion approximation control', 'items': {'exclusiveMinimum': True, 'minimum': 0, 'type': 'integer'}, 'maxItems': 5, 'minItems': 5, 'type': 'array'}, 'TOLPSEUD': {'description': 'Pseudopotential tolerance', 'exclusiveMinimum': True, 'minimum': 0, 'type': 'integer'}}, 'type': 'object'}, 'post_scf': {'description': 'keywords for post SCF calculations', 'items': {'enum': ['FULLTIME', 'POSTSCF', 'EXCHGENE', 'GRADCAL', 'PPAN'], 'type': 'string', 'uniqueItems': True}, 'type': 'array'}, 'single': {'enum': ['RHF', 'UHF', 'MP2'], 'type': 'string'}, 'spinlock': {'additionalProperties': False, 'description': 'the difference between alpha and beta electrons is fixed for initial scf cycles', 'maxProperties': 1, 'minProperties': 1, 'properties': {'BETALOCK': {'description': 'lock the number of beta electrons [nbeta, ncycles]', 'items': {'type': 'integer'}, 'maxItems': 2, 'minItems': 2, 'type': 'array'}, 'SPINLOC2': {'description': 'fills separately the alpha and beta bands with the appropriate # of electrons [nalpha-nbeta, ncycles]', 'items': [{'type': 'number'}, {'type': 'integer'}], 'maxItems': 2, 'minItems': 2, 'type': 'array'}, 'SPINLOCK': {'description': 'shift the eigenvalues in order to lock the system in a specific spin state [nalpha-nbeta, ncycles]', 'items': {'type': 'integer'}, 'maxItems': 2, 'minItems': 2, 'type': 'array'}}, 'type': 'object'}}, 'required': ['k_points'], 'title': 'Block 3', 'type': 'object'}, 'title': {'description': 'the title of the run', 'type': 'string'}}, 'required': ['scf'], 'title': 'CRYSTAL17 Input', 'type': 'object'}
get_dict()[source]

Return a dictionary with the parameters currently set.

Return type

dict

set_data(data)[source]

Replace the current data with another one.

Parameters

data – The dictionary to set.

classmethod validate_parameters(dct)[source]

validate an input dictionary

Parameters

dct (dict) –

aiida_crystal17.data.kinds module

class aiida_crystal17.data.kinds.KindData(data=None, **kwargs)[source]

Bases: aiida.orm.nodes.data.data.Data

stores additional data for StructureData Kinds

Stores the kind data for a structure

Parameters

data – the data to set, e.g. {‘kind_names’: [‘Fe’], ‘spin_alpha’: [True], ‘spin_beta’: [False]}

property data

Return an instance of AttributeManager that transforms the dictionary into an attribute dict.

Note

this will allow one to do node.dict.key as well as node.dict[key].

Returns

an instance of the AttributeResultManager.

data_schema = {'$schema': 'http://json-schema.org/draft-07/schema', 'additionalProperties': False, 'patternProperties': {'.+': {'type': 'array'}}, 'properties': {'kind_names': {'items': {'type': 'string'}, 'minimum': 1, 'type': 'array', 'uniqueItems': True}}, 'required': ['kind_names'], 'title': 'additional kind data', 'type': 'object'}
property field_dict

Return an AttributeDict with nested keys <field>.<kind_name> = value

get_dict()[source]

Return a dictionary with the parameters currently set.

Return type

dict

property kind_dict

Return an AttributeDict with nested keys <kind_name>.<field> = value

set_data(data)[source]

Replace the current data with another one.

Parameters

data – The dictionary to set.

aiida_crystal17.data.symmetry module

class aiida_crystal17.data.symmetry.SymmetryData(**kwargs)[source]

Bases: aiida.orm.nodes.data.data.Data

Stores data regarding the symmetry of a structure

  • symmetry operations are stored on file (in the style of ArrayData)

  • the rest of the values (and the number of symmetry operators) are stored as attributes in the database

Stores the symmetry data for a structure

  • symmetry operations are stored on file (in the style of ArrayData)

  • the rest of the values are stored as attributes in the database

Parameters

data – the data to set

add_path(src_abs, dst_path)[source]
compare_operations(ops, decimal=5)[source]

compare operations against stored ones

Parameters
  • ops – list of (flattened) symmetry operations

  • decimal – number of decimal points to round values to

Returns

dict of differences

property data

Return the data as an AttributeDict

data_schema = {'$schema': 'http://json-schema.org/draft-07/schema', 'additionalProperties': True, 'properties': {'basis': {'description': 'whether the symmetry operations are fractional or cartesian', 'enum': ['fractional', 'cartesian'], 'type': 'string'}, 'computation': {'description': 'details of the computation', 'type': 'object'}, 'equivalent_sites': {'description': 'mapping table to equivalent atomic sites', 'items': {'type': 'integer'}, 'type': 'array'}, 'hall_number': {'description': 'Hall number defining the symmetry group', 'maximum': 530, 'minimum': 1, 'type': ['null', 'integer']}, 'operations': {'description': 'symmetry operations, should at least include the unity operation', 'items': {'description': 'each item should be a list of [r00,r10,r20,r01,r11,r21,r02,r12,r22,t0,t1,t2]', 'items': {'type': 'number'}, 'maxItems': 12, 'minItems': 12, 'type': 'array'}, 'minItems': 1, 'type': 'array', 'uniqueItems': True}}, 'required': ['hall_number', 'operations', 'basis'], 'title': 'structure symmetry settings', 'type': 'object'}
get_description()[source]

return a short string description of the data

get_dict()[source]

get dictionary of data

property hall_number
property num_symops
set_data(data)[source]

Replace the current data with another one.

Parameters

data – The dictionary to set.

property spacegroup_info

Translate Hall number to space group type information. Returned as an attribute dict

Module contents

Data types provided by plugin

Register data types via the “aiida.data” entry point in setup.json.