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.

Read and store a file containing a single basis set.

Parameters

filepath (str or filelike) –

_abc_impl = <_abc_data object>
_logger = <Logger aiida_crystal17.data.basis_set.BasisSetData (WARNING)>
_plugin_type_string = 'data.crystal17.basisset.BasisSetData.'
_query_type_string = 'data.crystal17.basisset.'
_validate()[source]

Perform validation of the Data object.

Note

validation of data source checks license and requires attribution to be provided in field ‘description’ of source in the case of any CC-BY* license. If such requirement is too strict, one can remove/comment it out.

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

Return 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_label)[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
get_data()[source]

Return the basis set content, parsed to a JSON format.

classmethod get_or_create(basis_file, 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
  • basis_file – an absolute filename on disk, or a filelike object

  • 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.

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(basis_file)[source]

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

Parameters

basis_file (str or filelike) –

Raises

ValueError – a file has already been set for this BasisSetData instance

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 (str or pathlib.Path) containing all Basis Set files to be added. Only files ending in set extension (case-sensitive) 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.

class aiida_crystal17.data.basis_set.BasisSetFamily(label=None, user=None, description='', type_string=None, backend=None)[source]

Bases: aiida.orm.groups.Group

Group that represents a basis set family containing BasisSetData nodes.

Create a new group. Either pass a dbgroup parameter, to reload a group from the DB (and then, no further parameters are allowed), or pass the parameters for the Group creation.

Deprecated since version 1.2.0: The parameter type_string will be removed in v2.0.0 and is now determined automatically.

Parameters
  • label (str) – The group label, required on creation

  • description (str) – The group description (by default, an empty string)

  • user (aiida.orm.User) – The owner of the group (by default, the automatic user)

  • type_string (str) – a string identifying the type of group (by default, an empty string, indicating an user-defined group.

_abc_impl = <_abc_data object>
_type_string = 'crystal17.basisset'
aiida_crystal17.data.basis_set.md5_from_string(string, encoding='utf-8')[source]

Return md5 hash of a string.

Parameters
  • string – the string to hash

  • encoding – the encoding to use

Returns

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

Get relevant information from the basis file.

Parameters

basis_file – absolute path to a file or open filelike object

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.retrieve_basis_sets(files, stop_if_existing)[source]

Retrieve existing basis sets or create if them, if they do not exist.

Parameters
  • files – list of basis set file paths

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

Returns

aiida_crystal17.data.gcube module

Aiida data type to store a gaussian cube.

class aiida_crystal17.data.gcube.GaussianCube(fileobj, binary=True, **kwargs)[source]

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

Aiida data type to store a gaussian cube.

The file is stored within a compressed zip folder, reducing storage space.

The specification can be found at: http://h5cube-spec.readthedocs.io/en/latest/cubeformat.html

CRYSTAL outputs include DENSCUBE.DAT, SPINCUBE.DAT, POTCUBE.DAT.

Store a gaussian cube file.

Parameters
  • fileobj (str or file-like) – the file or path to the file

  • binary (bool) – whether the file is opened in binary mode

_abc_impl = <_abc_data object>
_compression_method = 8
_cube_filename = 'gaussian.cube'
_logger = <Logger aiida_crystal17.data.gcube.GaussianCube (WARNING)>
_plugin_type_string = 'data.crystal17.gcube.GaussianCube.'
_query_type_string = 'data.crystal17.gcube.'
_zip_filename = 'gcube.zip'
compute_integration_atom(indices, radius, pbc=True, True, True)[source]

Integrate the density over a sphere.

Parameters
  • indices (int or list[int]) –

  • radius (float or list[float]) – radius for all atoms or per cell must be less than the shortest periodic cell vector length

  • pbc (list[bool]) – periodic dimensions

Returns

Return type

float

compute_integration_cell()[source]

Integrate the density over the full cell.

compute_integration_sphere(positions, radius, pbc=True, True, True)[source]

Integrate the density over a sphere.

Parameters
  • positions (list) – (x, y, z) or list of (x, y, z)

  • radius (float) – must be less than the shortest periodic cell vector length

  • pbc (list[bool]) – periodic dimensions

Returns

Return type

float

get_ase(pbc=True, True, True)[source]

Return the ase.Atoms for the structure.

get_cube_data(return_density=False, dist_units='angstrom')[source]

Parse gaussian cube files to a data structure.

Parameters
  • return_density (bool) – whether to read and return the density values

  • dist_units (str) – the distance units to return

Returns

Return type

aiida_crystal17.parsers.raw.gaussian_cube.GcubeResult

open_cube_file(binary=False)[source]

Open a file handle to the gaussian cube file.

set_from_fileobj(fileobj, binary=True)[source]

Store a gaussian cube file, given a handle to the file.

Parameters
  • fileobj (file-like) –

  • binary (bool) – whether the file is opened in binary mode

set_from_filepath(filepath)[source]

Store a gaussian cube file, given a path to the file.

Parameters

filepath (str) –

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}}

_abc_impl = <_abc_data object>
_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': {'ROTCRY': {'description': 'Rotation of the crystal with respect to the reference system cell. Can be null (AUTO), array(3) (ANGROT), or array((3,3)) (MATROT)', 'items': {'items': {'type': 'number'}, 'maxItems': 3, 'minItems': 3, 'type': ['number', 'array']}, 'maxItems': 3, 'minItems': 3, 'type': ['null', 'array']}, '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'}, 'd3': {'additionalProperties': False, 'description': 'C6 based London dispersion correction', 'properties': {'A1': {'type': 'number'}, 'A2': {'type': 'number'}, 'ABC': {'default': False, 'type': 'boolean'}, 'CNRADIUS': {'type': 'number'}, 'RADIUS': {'type': 'number'}, 'RS6': {'type': 'number'}, 'RS8': {'type': 'number'}, 'S6': {'type': 'number'}, 'S8': {'type': 'number'}, 'VERSION': {'default': 4, 'maximum': 4, 'minimum': 2, 'type': 'integer'}}, 'type': 'object'}, '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'}
_logger = <Logger aiida_crystal17.data.input_params.CryInputParamsData (WARNING)>
_plugin_type_string = 'data.crystal17.parameters.CryInputParamsData.'
_query_type_string = 'data.crystal17.parameters.'
_update_attributes(data)[source]

Update the current attribute with the keys provided in the dictionary.

Parameters

data – a dictionary with the keys to substitute. It works like dict.update(), adding new keys and overwriting existing keys.

_validate()[source]

Perform validation of the Data object.

Note

validation of data source checks license and requires attribution to be provided in field ‘description’ of source in the case of any CC-BY* license. If such requirement is too strict, one can remove/comment it out.

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': {'ROTCRY': {'description': 'Rotation of the crystal with respect to the reference system cell. Can be null (AUTO), array(3) (ANGROT), or array((3,3)) (MATROT)', 'items': {'items': {'type': 'number'}, 'maxItems': 3, 'minItems': 3, 'type': ['number', 'array']}, 'maxItems': 3, 'minItems': 3, 'type': ['null', 'array']}, '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'}, 'd3': {'additionalProperties': False, 'description': 'C6 based London dispersion correction', 'properties': {'A1': {'type': 'number'}, 'A2': {'type': 'number'}, 'ABC': {'default': False, 'type': 'boolean'}, 'CNRADIUS': {'type': 'number'}, 'RADIUS': {'type': 'number'}, 'RS6': {'type': 'number'}, 'RS8': {'type': 'number'}, 'S6': {'type': 'number'}, 'S8': {'type': 'number'}, 'VERSION': {'default': 4, 'maximum': 4, 'minimum': 2, 'type': 'integer'}}, 'type': 'object'}, '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]}

_abc_impl = <_abc_data object>
_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'}
_logger = <Logger aiida_crystal17.data.kinds.KindData (WARNING)>
_plugin_type_string = 'data.crystal17.kinds.KindData.'
_query_type_string = 'data.crystal17.kinds.'
_update_attributes(data)[source]

Update the current attribute with the keys provided in the dictionary.

Parameters

data – a dictionary with the keys to substitute. It works like dict.update(), adding new keys and overwriting existing keys.

_validate()[source]

Perform validation of the Data object.

Note

validation of data source checks license and requires attribution to be provided in field ‘description’ of source in the case of any CC-BY* license. If such requirement is too strict, one can remove/comment it out.

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

_abc_impl = <_abc_data object>
_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_operations()[source]
_logger = <Logger aiida_crystal17.data.symmetry.SymmetryData (WARNING)>
_ops_filename = 'operations.npy'
_plugin_type_string = 'data.crystal17.symmetry.SymmetryData.'
_query_type_string = 'data.crystal17.symmetry.'
_set_operations(ops)[source]
_update_attributes(data)[source]

Update the current attribute with the keys provided in the dictionary.

Parameters

data – a dictionary with the keys to substitute. It works like dict.update(), adding new keys and overwriting existing keys.

_validate()[source]

Perform validation of the Data object.

Note

validation of data source checks license and requires attribution to be provided in field ‘description’ of source in the case of any CC-BY* license. If such requirement is too strict, one can remove/comment it out.

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.