aiida_crystal17.parsers.raw package

Submodules

aiida_crystal17.parsers.raw.crystal_fort25 module

aiida_crystal17.parsers.raw.crystal_fort25.parse_crystal_fort25(content)[source]

parse the fort.25 output from CRYSTAL

Notes

File Format:

1ST RECORD : -%-,IHFERM,TYPE,NROW,NCOL,DX,DY,COSXY (format : A3,I1,A4,2I5,1P,(3E12.5))
2ND RECORD : X0,Y0 (format : 1P,6E12.5)
3RD RECORD : I1,I2,I3,I4,I5,I6 (format : 6I3)
4TH RECORD
AND FOLLOWING : ((RDAT(I,J),I=1,NROW),J=1,NCOL) (format : 1P,6E12.5)

Meaning of the variables:
1   NROW            1 (DOSS are written one projection at a time)
    NCOL            number of energy points in which the DOS is calculated
    DX              energy increment (hartree)
    DY              not used
    COSXY           Fermi energy (hartree)
2   X0              energy corresponding to the first point
    Y0              not used
3   I1              number of the projection;
    I2              number of atomic orbitals of the projection;
    I3,I4,I5,I6     not used
4   RO(J),J=1,NCOL  DOS: density of states ro(eps(j)) (atomic units).
aiida_crystal17.parsers.raw.crystal_fort25.parse_crystal_fort25_aiida(fileobj, parser_class)[source]

takes the result from parse_crystal_fort25 and prepares it for AiiDA output

aiida_crystal17.parsers.raw.crystal_stdout module

Basic outline of parsing sections:

<parse_pre_header>
***************************
<parse_calculation_header>
***************************
<parse_geometry_input>
* GEOMETRY EDITING
<parse_calculation_setup>
CRYSTAL - SCF - TYPE OF CALCULATION :
<parse_scf_section>
SCF ENDED
<parse_scf_final_energy>
OPTOPTOPTOPT
<parse_optimisation>
OPT END -
<parse_band_gaps>
FINAL OPTIMIZED GEOMETRY
<parse_final_geometry>
MULLIKEN POPULATION ANALYSIS
<parse_mulliken_analysis>
class aiida_crystal17.parsers.raw.crystal_stdout.ParsedSection(next_lineno, data, parser_error, non_terminating_error)

Bases: tuple

Create new instance of ParsedSection(next_lineno, data, parser_error, non_terminating_error)

__getnewargs__()

Return self as a plain tuple. Used by copy and pickle.

static __new__(_cls, next_lineno=None, data=None, parser_error=None, non_terminating_error=None)

Create new instance of ParsedSection(next_lineno, data, parser_error, non_terminating_error)

__repr__()

Return a nicely formatted representation string

property data

Alias for field number 1

property next_lineno

Alias for field number 0

property non_terminating_error

Alias for field number 3

property parser_error

Alias for field number 2

aiida_crystal17.parsers.raw.crystal_stdout.assign_exit_code(output)[source]
aiida_crystal17.parsers.raw.crystal_stdout.extract_final_info(parsed_data)[source]

extract the final energies and primitive geometry/symmetry from the relevant sections of the parse data (depending if it was an optimisation or not)

aiida_crystal17.parsers.raw.crystal_stdout.initial_parse(lines)[source]

scan the file for errors, and find the final elapsed time value

aiida_crystal17.parsers.raw.crystal_stdout.parse_band_gaps(lines, initial_lineno)[source]

read band gap information

Note: this is new for CRYSTAL17

Parameters
Returns

Return type

ParsedSection

aiida_crystal17.parsers.raw.crystal_stdout.parse_calculation_header(lines, initial_lineno)[source]

parse calculation header

Parameters
Returns

Return type

ParsedSection

aiida_crystal17.parsers.raw.crystal_stdout.parse_calculation_setup(lines, initial_lineno)[source]

parse initial setup data (starting after intital geometry input)

Parameters
Returns

Return type

ParsedSection

aiida_crystal17.parsers.raw.crystal_stdout.parse_final_geometry(lines, initial_lineno)[source]

read final optimized geometry section

Parameters
Returns

Return type

ParsedSection

aiida_crystal17.parsers.raw.crystal_stdout.parse_geometry_input(lines, initial_lineno)[source]

parse geometry input data

Parameters
Returns

Return type

ParsedSection

aiida_crystal17.parsers.raw.crystal_stdout.parse_geometry_section(dct, i, line, lines, startline=0)[source]

update dict get geometry related variables

Parameters
  • dct

  • i

  • line

  • lines

  • startline (int) –

aiida_crystal17.parsers.raw.crystal_stdout.parse_mulliken_analysis(lines, mulliken_indices)[source]
Parameters
Returns

Return type

ParsedSection

aiida_crystal17.parsers.raw.crystal_stdout.parse_optimisation(lines, initial_lineno)[source]

read geometric optimisation

Parameters
Returns

Return type

ParsedSection

aiida_crystal17.parsers.raw.crystal_stdout.parse_pre_header(lines, initial_lineno=0)[source]

parse any data before the program header

note this is only for runs using runcry (not straight from the binary)

Parameters
Returns

Return type

ParsedSection

aiida_crystal17.parsers.raw.crystal_stdout.parse_scf_final_energy(lines, initial_lineno, final_lineno=None)[source]

read post initial scf data

Parameters
aiida_crystal17.parsers.raw.crystal_stdout.parse_scf_section(lines, initial_lineno, final_lineno=None)[source]

read scf data

Parameters
Returns

Return type

ParsedSection

aiida_crystal17.parsers.raw.crystal_stdout.parse_section(func, lines, initial_lineno, output, key_name)[source]

parse a section of the stdout file

Parameters
  • func (callable) – a function that returns a ParsedSection object

  • lines (list[str]) –

  • initial_lineno (int) –

  • output (dict) – current output from the parser

  • key_name (str or list[str] or None) – the key_name of output to assign the data to (if None directly update)

Returns

Return type

ParsedSection or None

aiida_crystal17.parsers.raw.crystal_stdout.parse_symmetry_section(dct, i, line, lines, startline=0)[source]

update dict with symmetry related variables

Parameters
  • dct

  • i

  • line

  • lines

  • startline (int) –

aiida_crystal17.parsers.raw.crystal_stdout.read_crystal_stdout(content)[source]

aiida_crystal17.parsers.raw.doss_input module

aiida_crystal17.parsers.raw.doss_input.create_doss_content(params)[source]

create the contents of a doss.d3 input file

Parameters

params (dict) –

Returns

Return type

list[str]

Notes

NPRO; number of additional (to total) projected densities to calculate (<= 15) NPT; number of uniformly spaced energy values (from bottom of band INZB to top of band IFNB) INZB; band considered in DOS calculation IFNB; last band considered in DOS calculation IPLO; output type (1 = to .d25 file) NPOL; number of Legendre polynomials used to expand DOSS (<= 25) NPR; number of printing options to switch on

Unit of measurement: energy: hartree; DOSS: state/hartree/cell.

aiida_crystal17.parsers.raw.doss_input.read_doss_contents(content)[source]

read the contents of a doss.d3 input file

aiida_crystal17.parsers.raw.gui_parse module

This module deals with reading/creating .gui files for use with the EXTERNAL keyword

File Format

dimesionality origin_setting crystal_type energy(optional)
    a_x a_y a_z
    b_x b_y b_z
    c_x c_y c_z
num_symm_ops (in cartesian coordinates)
    op1_rot_00 op1_rot_01 op1_rot_02
    op1_rot_10 op1_rot_11 op1_rot_12
    op1_rot_20 op1_rot_21 op1_rot_22
    op1_trans_0 op1_trans_1 op1_trans_2
    ...
num_atoms (if cryversion<17 irreducible atoms only)
    atomic_number x y z (in cartesian coordinates)
    ...
space_group_int_num num_symm_ops
aiida_crystal17.parsers.raw.gui_parse.get_centering_code(hall_number)[source]

get crystal centering codes, to convert from primitive to conventional

Parameters

hall_number (int) –

Returns

centering_code

Return type

int

aiida_crystal17.parsers.raw.gui_parse.get_crystal_type_code(hall_number)[source]

get crystal type code, denoting the crystal system

Parameters

hall_number (int) –

Returns

crystal_type_code

Return type

int

aiida_crystal17.parsers.raw.gui_parse.get_crystal_type_name(hall_number)[source]

get crystal type code, denoting the crystal system

Parameters

hall_number (int) –

Returns

crystal_type_name

Return type

str

aiida_crystal17.parsers.raw.gui_parse.gui_file_read(lines)[source]

read CRYSTAL geometry (.gui) file

Parameters

lines (list[str]) – list of lines in the file

Returns

  • dict (structure_data)

  • dict (symmetry_data)

Notes

OLDER versions of CRYSTAL are not compatible, because they only specify symmetrically inequivalent atomic positions (rather than all)

Symmetry operations and atomic positions are assumed to be cartesian (rather than fractional)

aiida_crystal17.parsers.raw.gui_parse.gui_file_write(structure_data, symmetry_data=None)[source]

create string of gui file content (for CRYSTAL17)

Parameters
  • structure_data (aiida.StructureData or dict or ase.Atoms) – dict with keys: ‘pbc’, ‘atomic_numbers’, ‘ccoords’, ‘lattice’, or ase.Atoms, or any object that has method structure_data.get_ase()

  • symmetry_data (dict or None) – keys; ‘crystal_type_code’, ‘centring_code’, ‘space_group’, ‘operations’, ‘basis’

Returns

lines – list of lines in the file

Return type

list[str]

Notes

Older versions of CRYSTAL are not compatible, because they only specify symmetrically inequivalent atomic positions (rather than all)

Symmetry operations and atomic positions are assumed to be cartesian (rather than fractional)

aiida_crystal17.parsers.raw.gui_parse.structure_to_symmetry(structure, symprec=1e-05, angle_tolerance=None, as_cartesian=False)[source]

convert a structure data object to a symmetry data dict,

Parameters
  • structure (aiida.StructureData or dict or ase.Atoms) –

  • symprec=1e-5 (float) – Symmetry search tolerance in the unit of length.

  • angle_tolerance=None (float or None) – Symmetry search tolerance in the unit of angle degrees. If the value is negative or None, an internally optimized routine is used to judge symmetry.

  • as_cartesian=False (bool) – if True, convert the (fractional) symmetry operations to cartesian

Returns

keys; ‘crystal_type_code’, ‘centring_code’, ‘space_group’, ‘operations’, ‘basis’

Return type

dict

aiida_crystal17.parsers.raw.inputd12_read module

module for reading main.d12 (for immigration)

aiida_crystal17.parsers.raw.inputd12_read.extract_data(input_string)[source]

extract data from a main.d12 CRYSTAL17 file

  • Any geometry creation commands are ignored

  • Basis sets must be included explicitly (no keywords) and are read into the basis_sets list

  • FRAGMENT, GHOSTS and ATOMSPIN commands are read into the atom_props dict

  • Otherwise, only commands contained in the inputd12.schema.json are allowed

Parameters

input_string – a string if the content of the file

Returns param_dict

the parameter dict for use in crystal17.main calculation

Returns basis_sets

a list of the basis sets

Returns atom_props

a dictionary of atom specific values (spin_alpha, spin_beta, ghosts, fragment)

aiida_crystal17.parsers.raw.inputd12_write module

module to write CRYSTAL17 .d12 files

aiida_crystal17.parsers.raw.inputd12_write.create_atom_properties(structure, kinds_data=None)[source]

create dict of properties for each atom

Parameters
  • structureStructureData

  • kinds_dataKindData atom kind data for each atom

Returns

dict of atom properties

Return type

dict

aiida_crystal17.parsers.raw.inputd12_write.format_value(dct, keys)[source]

return the value + a new line, or empty string if keys not found

aiida_crystal17.parsers.raw.inputd12_write.write_input(indict, basis_sets, atom_props=None)[source]

write input of a validated input dictionary

Parameters
  • indict (dict) – dictionary of inputs

  • basis_sets (list) – list of basis set strings or objects with content property

  • atom_props (dict or None) – atom ids with specific properties; “spin_alpha”, “spin_beta”, “unfixed”, “ghosts”

Returns

Return type

str

aiida_crystal17.parsers.raw.main_out module

parse the main output file and create the required output nodes

class aiida_crystal17.parsers.raw.main_out.OutputNodes[source]

Bases: collections.abc.Mapping

a mapping of output nodes, with attribute access

property results
property structure
property symmetry
class aiida_crystal17.parsers.raw.main_out.ParserResult[source]

Bases: object

aiida_crystal17.parsers.raw.main_out.parse_main_out(fileobj, parser_class, init_struct=None, init_settings=None)[source]

parse the main output file and create the required output nodes

Parameters
  • fileobj – handle to main output file

  • parser_class – a string denoting the parser class

  • init_struct – input structure

  • init_settings – input structure settings

:return parse_result

aiida_crystal17.parsers.raw.newk_output module

aiida_crystal17.parsers.raw.newk_output.read_newk_content(fileobj, parser_class)[source]

aiida_crystal17.parsers.raw.pbs module

aiida_crystal17.parsers.raw.pbs.parse_pbs_stderr(file_handle)[source]

look for errors originating from PBS pro std error messages

Module contents