turbomoleio.output package

Subpackages

Submodules

turbomoleio.output.data module

Module with basic objects extracted from the stdout of Turbomole executables.

Rely on the Parser object to extract the data.

class turbomoleio.output.data.AoforceNumericalIntegrationData(core_memory_dft=None, memory_per_atom=None, atoms_per_loop=None, construction_timings=None)[source]

Bases: BaseData

Information about the numerical integration in aoforce.

Will be present only if a proper aoforce is run. Absent if running after numforce.

Construct AoforceNumericalIntegrationData object.

Parameters:
  • core_memory_dft (int) – remaining core memory for DFT in MB.

  • memory_per_atom (int) – memory needed per atom in KB.

  • atoms_per_loop (int) – atoms per loop corresponding to the memory.

  • construction_timings (list) – a list of lists with construction timings. For each element: [timing_description, cpu_time, wall_time] with timing_description being the description of the timing, cpu_time being the CPU time in seconds and wall_time, the wall time in seconds.

classmethod from_parser(parser)[source]

Generate an instance of AoforceNumericalIntegrationData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

AoforceNumericalIntegrationData.

class turbomoleio.output.data.AoforceRotationalData(b=None, intensities=None, m=None, dipole_moment=None)[source]

Bases: BaseData

Analysis of rotational states in aoforce.

Construct AoforceRotationalData object.

Parameters:
  • b (float) – 3D vector with rotational constants b in cm^-1.

  • intensities (list) – 3D vector with optical intensities in a.u.

  • m (list) – 3x3 matrix.

  • dipole_moment (list) – 3D vector with dipole moment in principle axis system in a.u.

classmethod from_parser(parser)[source]

Generate an instance of AoforceRotationalData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

AoforceRotationalData.

class turbomoleio.output.data.AoforceVibrationalData(frequencies=None, symmetries=None, ir=None, dDIP_dQ=None, intensities=None, intensities_perc=None, raman=None, eigenvectors=None, reduced_masses=None, energies=None)[source]

Bases: BaseData

Analysis of vibrational states in aoforce.

Results are stored as lists, each value corresponds to the frequency in the “frequencies” list with the same index.

Construct AoforceVibrationalData object.

Parameters:
  • frequencies (list) – vibrational frequencies in cm^-1.

  • symmetries (list) – string with the name of the symmetry of the modes. None if not specified, like for the first 6 modes.

  • ir (list) – booleans stating whether if the mode is ir or not. None if “-” in the output file.

  • dDIP_dQ (list) – normal mode derivatives of the dipole moment in a.u.

  • intensities (list) – intensity in km/mol.

  • intensities_perc (list) – intensity percentage.

  • raman (list) – booleans stating whether if the mode is raman or not. None if “-” in the output file.

  • eigenvectors (list) – matrix with shape (num frequencies, number of atoms, 3) with the eigenvectors for each atom.

  • reduced_masses (list) – reduced masses in g/mol.

  • energies (dict) – the values of the vibrational energies. A dictionary with “zpve”, “scf” and “total” as keys.

classmethod from_parser(parser)[source]

Generate an instance of AoforceVibrationalData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

AoforceVibrationalData.

get_freqs_df()[source]

Generate a pandas DataFrame with the frequencies and their properties.

Returns:

DataFrame

n_negative_freqs(tol=0.1)[source]

Get the number of negative frequencies.

Frequencies are considered negative if they satisfy the condition f < -abs(tol).

Parameters:

tol (float) – tolerance for considering a frequency as negative.

Returns:

the number of negative frequencies.

Return type:

int

n_positive_freqs(tol=0.1)[source]

Get the number of positive frequencies.

Frequencies are considered positive if they satisfy the condition f > abs(tol).

Parameters:

tol (float) – tolerance for considering a frequency as positive.

Returns:

the number of positive frequencies.

Return type:

int

n_zero_freqs(tol=0.1)[source]

Get the number of frequencies close to zero.

Frequencies are considered close to zero if they satisfy the condition -abs(tol) > f > abs(tol).

Parameters:

tol (float) – tolerance for considering a frequency as zero.

Returns:

the number of zero frequencies.

Return type:

int

class turbomoleio.output.data.BaseData[source]

Bases: MSONable, ABC

Base class for the data extracted from the parser of the output files.

classmethod from_file(filepath)[source]

Generate an instance of the class from a file.

The file should contain the stdout of a Turbomole executable.

Parameters:

filepath (str) – path to the file.

Returns:

An instance of the class.

abstract classmethod from_parser(parser)[source]

Generate an instance of the class from a parser.

The parser is based on the stdout of a Turbomole executable. Should return None if no data could be parsed.

Subclasses should use the parser to extract the relevant information.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

An instance of the class.

classmethod from_string(string)[source]

Generate an instance of the class from a string.

The string should contain the stdout of a Turbomole executable.

Parameters:

string (str) – the string with output.

Returns:

An instance of the class.

class turbomoleio.output.data.BasisData(basis_per_specie=None, aux_basis_per_specie=None, number_scf_basis_func=None, number_scf_aux_basis_func=None)[source]

Bases: BaseData

Information about the basis used for the calculation.

Can be used for most of the Turbomole executables (including the scf, escf, grad).

Construct BasisData object.

Parameters:
  • basis_per_specie (dict) – dict with species as keys and name of the basis as values.

  • aux_basis_per_specie (dict) – dict with species as keys and name of the auxiliary basis as values.

  • number_scf_basis_func (int) – number of scf basis functions.

  • number_scf_aux_basis_func (int) – number of auxialiary scf basis functions.

classmethod from_parser(parser)[source]

Generate an instance of BasisData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

BasisData.

class turbomoleio.output.data.CosmoData(info=None, parameters=None, screening_charge=None, energies=None, element_radius=None)[source]

Bases: BaseData

Information about the cosmo run. Inputs and outputs.

Construct CosmoData object.

Parameters:
  • info (dict) – initial info provided in the output by COSMO. Contains the keys area and volume.

  • parameters (dict) – COSMO parameters. Contains the keys nppa, nspa, nsph, npspher, disex, disex2, rsolv, routf, phsran, ampran, cavity, epsilon, refind, fepsi.

  • screening_charge (dict) – values of the screening charge. Contains the keys cosmo, correction, total.

  • energies (dict) – total and dielectric energies. Contains the keys total_energy, total_energy_oc_corr, dielectric_energy and dielectric_energy_oc_corr.

  • element_radius (dict) – to an Element object correspond values of the radius and a list of sites of the corresponding element in the molecule.

classmethod from_parser(parser)[source]

Generate an instance of CosmoData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed. Can be used for scf and escf/egrad.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

CosmoData.

class turbomoleio.output.data.DFTData(functional=None, ri=None, spherical_gridsize=None, gridpoints=None, dispersion_correction=None)[source]

Bases: BaseData

The information about a dft calculation.

Can be used for scf, gradients and escf executables.

Construct a DFTData object.

Parameters:
  • functional (FunctionalData) – information about the exchange-correlation functional.

  • ri (RiData) – information RI calculations.

  • spherical_gridsize (int) – size of the grid for spherical integration.

  • gridpoints (int) – number of points for spherical integration.

  • dispersion_correction (DispersionCorrectionData) – information about dispersion correction.

classmethod from_parser(parser)[source]

Generate an instance of DFTData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

DFTData.

class turbomoleio.output.data.DispersionCorrectionData(correction=None, en_corr=None)[source]

Bases: BaseData

Information about the dispersion correction used in the calculation.

Can be used for scf executables.

Construct DispersionCorrectionData object.

Parameters:
  • correction (str) – the name of the correction (e.g. D1, D2, …).

  • en_corr (float) – correction on the total energy.

classmethod from_parser(parser)[source]

Generate an instance of DispersionCorrectionData from a parser.

The paser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

DispersionCorrectionData.

class turbomoleio.output.data.ElectrostaticMomentsData(charge=None, unrestricted_electrons=None, dipole_vector=None, dipole_norm=None, quadrupole_tensor=None, quadrupole_trace=None, quadrupole_anisotropy=None)[source]

Bases: BaseData

The data of the electrostatic moments (charge, dipole and quadrupole).

Can be used for scf executables.

Construct ElectrostaticMomentsData object.

Parameters:
  • charge (float) – total charge.

  • unrestricted_electrons (float) – number of unrestricted electrons.

  • dipole_vector (list) – the 3 components of the dipole moment.

  • dipole_norm (float) – norm of the dipole moment.

  • quadrupole_tensor (list) – 3x3 matrix with the quadrupole tensor.

  • quadrupole_trace (float) – trace of the quadrupole tensor.

  • quadrupole_anisotropy (float) – anisotropy of the quadrupole tensor.

classmethod from_parser(parser)[source]

Generate an instance of ElectrostaticMomentsData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

ElectrostaticMomentsData.

class turbomoleio.output.data.EscfData(calc_type=None, iterations=None, residuum_convergence_criterium=None, n_occupied_orbitals=None, orbital_characterization=None, max_davidson_iter=None, machine_precision=None, max_core_mem=None, max_cao_basis_vectors=None, max_treated_vectors=None, irrep_data=None, gs_tot_en=None, excitations=None)[source]

Bases: BaseData

Output data of an escf calculation.

Can be used for escf and egrad.

Construct EscfData object.

Parameters:
  • calc_type (str) – string describing the calculation type (e.g. ‘RPA SINGLET-EXCITATION’).

  • iterations (EscfIterationData) – the data about the escf iterations.

  • residuum_convergence_criterium (float) – residuum convergence criterium.

  • n_occupied_orbitals (int) – number of occupied orbitals.

  • orbital_characterization (str) – description of how the orbital were converged in scf.

  • max_davidson_iter (int) – maximum number of Davidson iterations.

  • machine_precision (float) – machine precision.

  • max_core_mem (int) – maximum core memory in MB.

  • max_cao_basis_vectors (int) – number of maximum CAO vectors in memory.

  • max_treated_vectors (int) – maximum number of simultaneously treated vectors, including degeneracy.

  • irrep_data (dict) – keys are strings with the name of the irrep, values are tuples with [tensor space dimension, number of roots].

  • gs_tot_en (float) – total energy of the ground state. Turbomole extracts it from the output of the scf calculation. If that is missing Turbomole sets this value to 0 in the output of escf.

  • excitations (dict) – keys are the name of the irreps and values are lists of SingleExcitation.

classmethod from_parser(parser)[source]

Generate an instance of EscfData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

EscfData.

class turbomoleio.output.data.EscfIterationData(steps=None, converged=None)[source]

Bases: BaseData

Details about the iteration in an escf calculation.

It contains the data for a list of steps. For each one a sublist of the convergence information converning each of the irreps treated as excited states.

Construct EscfIterationData object.

Parameters:
  • steps (list) – list of lists of lists (3 dimensions). One element of the list for each escf step. One element of the sublist for each irrep dealt with. The inner list contains the convergence information: [name of the irrep, number of converged roots, euclidean residual norm]

  • converged (bool) – True if converged.

classmethod from_parser(parser)[source]

Generate an instance of EscfIterationData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

EscfIterationData.

class turbomoleio.output.data.FunctionalData(msg=None, name=None, func_type=None, xcfun=None)[source]

Bases: BaseData

Information about the exchange-correlation functional.

Can be used for for scf, gradient and relax executables.

Construct FunctionalData object.

Parameters:
  • msg (str) – the full message in the output concerning the XC functional. In case the parsing failed to identify the correct name it will provide a way to figure out the information.

  • name (str) – name of the XC functional.

  • func_type (str) – type of the XC functional (e.g. GGA, LDA, …).

  • xcfun (str) – version of xcfun used, if present.

classmethod from_parser(parser)[source]

Generate an instance of FunctionalData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

FunctionalData.

class turbomoleio.output.data.GeometryData(center_of_mass=None, center_of_charge=None, molecule=None)[source]

Bases: BaseData

Data of the geometry of the system: molecule and centers.

Can be used for most of the Turbomole executables (including the scf, escf, grad).

Construct GeometryData object.

Parameters:
  • center_of_mass (list) – 3D vector with the position of the center of mass.

  • center_of_charge – 3D vector with the position of the center of charge.

  • molecule (Molecule) – the molecule in the system.

classmethod from_parser(parser)[source]

Generate an instance of GeometryData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

GeometryData.

class turbomoleio.output.data.IntegralData(integral_neglect_threshold=None, thize=None, thime=None)[source]

Bases: BaseData

Data about the thresholds for integrals.

Can be used for for scf, gradien and escf executables.

Construct IntegralData object.

Parameters:
  • integral_neglect_threshold (float) – integral neglect threshold.

  • thize (float) – integral storage threshold THIZE.

  • thime (float) – integral storage threshold THIME.

classmethod from_parser(parser)[source]

Generate an instance of IntegralData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

IntegralData.

class turbomoleio.output.data.MP2Data(energy_only=None)[source]

Bases: BaseData

Data object containing parameters used to run the MP2 calculation.

Construct MP2Data object.

Parameters:

energy_only (bool) – whether this is an energy-only MP2 calculation.

classmethod from_parser(parser)[source]

Generate an instance of MP2Data from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

MP2Data.

class turbomoleio.output.data.MP2Results(energy=None)[source]

Bases: BaseData

Results from an MP2 calculation.

Construct MP2Results object.

Parameters:

energy (float) – MP2 energy.

classmethod from_parser(parser)[source]

Generate an instance of MP2Results from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

MP2Results.

class turbomoleio.output.data.PeriodicityData(periodicity=None, lattice_params=None, shortest_interatomic_distance=None, direct_space_vectors=None, reciprocal_space_vectors=None)[source]

Bases: BaseData

Information about periodicity.

Construct PeriodicityData object.

Parameters:
  • periodicity (int) – Periodicity of the system (1, 2 or 3).

  • lattice_params – Lattice parameters of the system (in Angstroms). For 1D systems, a single number: [a]. For 2D systems, three numbers: [a, b, gamma], i.e. the two lattice parameters and the angle between them. For 3D systems, three numbers: [a, b, c, alpha, beta, gamma], i.e. three two lattice parameters and the angles between them.

  • shortest_interatomic_distance – Shortest interatomic distance in the system (in Angstroms).

  • direct_space_vectors – Lattice vectors of the system (in Angstroms). The first vector will always be aligned with the x cartesian direction. For 2D and 3D, the second vector is always in the xy cartesian plane.

  • reciprocal_space_vectors

    Reciprocal lattice vectors of the system (in Angstroms^-1). The physics definition of the reciprocal lattice vectors is used here:

    b1 = 2*pi/V * (a2 x a3)
    b2 = 2*pi/V * (a3 x a1)
    b3 = 2*pi/V * (a1 x a2)
    

    The crystallographer’s definition is easily recovered as:

    b'1 = b1 / (2*pi)
    b'2 = b2 / (2*pi)
    b'3 = b3 / (2*pi)
    

Returns:

PeriodicityData.

classmethod from_parser(parser)[source]

Generate an instance of PeriodicityData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

PeriodicityData.

class turbomoleio.output.data.RelaxConvergenceData(energy_change=None, rms_displ=None, max_displ=None, rms_grad=None, max_grad=None)[source]

Bases: BaseData

Final information about relaxation convergence.

This is obtained according to what is defined in the control file. Can be used for relax and statpt.

Construct RelaxConvergenceData object.

Parameters:
  • energy_change (dict) – information about the convergence of the energy change. Contains “value” with the actual value, “thr” with the specified threshold, and “conv” a bool specifying whether the convergence for this threshold has been achieved or not.

  • rms_displ (dict) – information about the convergence of the rms of the displacements. Same structure as “energy_change”.

  • max_displ (dict) – information about the convergence of the maximum of the displacements. Same structure as “energy_change”.

  • rms_grad (dict) – information about the convergence of the rms of the gradient. Same structure as “energy_change”.

  • max_grad (dict) – information about the convergence of the maximum of the gradient. Same structure as “energy_change”.

classmethod from_parser(parser)[source]

Generate an instance of RelaxConvergenceData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

RelaxConvergenceData.

class turbomoleio.output.data.RelaxData(optimizations=None, thr_int_coord=None)[source]

Bases: BaseData

Initial information provided in relax.

Can be used only for relax.

Construct RelaxData object.

Parameters:
  • optimizations (list) – list of strings describing with respect to what the optimization has been performed.

  • thr_int_coord (float) – convergence criterion for internal coordinates.

classmethod from_parser(parser)[source]

Generate an instance of RelaxData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

RelaxData.

class turbomoleio.output.data.RelaxGradientsData(norm_cartesian=None, norm_internal=None, max_internal=None)[source]

Bases: BaseData

Data about gradients in a relaxation calculation.

Gradient values are extracted from the relax/stapt output that take into account the frozen coordinates. Can be used for relax and statpt.

Construct RelaxGradientsData object.

Parameters:
  • norm_cartesian (float) – norm of the cartesian gradient.

  • norm_internal (float) – norm of the internal gradient.

  • max_internal (float) – maximum norm of the internal gradient (available only in relax).

classmethod from_parser(parser)[source]

Generate an instance of RelaxGradientsData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

RelaxGradientsData.

class turbomoleio.output.data.RiData(ricore=None, marij=None, rij_memory=None, rik=None)[source]

Bases: BaseData

Information about RI calculations.

Can be used for ridft and escf/egrad.

Construct RiData object.

Parameters:
  • ricore (int) – memory used in ricore.

  • marij (bool) – True if marij approximation used.

  • rij_memory (int) – memory for rij.

  • rik (bool) – True if rik approximation used.

classmethod from_parser(parser)[source]

Generate an instance of RiData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

RiData.

class turbomoleio.output.data.RunData(host=None, start_time=None, end_time=None, cpu_time=None, wall_time=None)[source]

Bases: BaseData

Information about where the calculation was executed and the timings.

Can be used for all Turbomole executables.

Construct RunData object.

Parameters:
  • host (str) – name of the host.

  • start_time (datetime) – initial time of the run.

  • end_time (datetime) – end time of the run.

  • cpu_time (float) – cpu time in seconds.

  • wall_time (float) – wall time in seconds.

classmethod from_parser(parser)[source]

Generate an instance of RunData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

RunData.

class turbomoleio.output.data.ScfData(iterations=None, diis=None, diis_error_vect=None, conv_tot_en=None, conv_one_e_en=None, virtual_orbital_shift_on=None, virtual_orbital_shift_limit=None, orbital_characterization=None, restart_file=None, n_occupied_orbitals=None)[source]

Bases: BaseData

Information about options and operations in an scf calculation.

Can be used for scf calculations.

Construct an ScfData object.

Parameters:
  • iterations (ScfIterationData) – details about the iteration in the scf loop.

  • diis (bool) – True if DIIS is switched on.

  • diis_error_vect (str) – type of DIIS error vector.

  • conv_tot_en (float) – criterion for scf convergence on increment of total energy.

  • conv_one_e_en (float) – criterion for scf convergence on increment of one-electron energy.

  • virtual_orbital_shift_on (bool) – True if automatic virtual orbital shift is switched on.

  • virtual_orbital_shift_limit (float) – automatic virtual orbital shift switched when e(lumo)-e(homo) lower than this value.

  • orbital_characterization (str) – type of orbital characterization.

  • restart_file (str) – file to which restart information will be dumped.

  • n_occupied_orbitals (int) – number of occupied orbitals.

classmethod from_parser(parser)[source]

Generate an instance of ScfData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

ScfData.

class turbomoleio.output.data.ScfEnergiesData(total_energy=None, kinetic_energy=None, potential_energy=None, virial_theorem=None, wavefunction_norm=None, coulomb_energy=None, xc_energy=None, ts_energy=None, free_energy=None, sigma0_energy=None)[source]

Bases: BaseData

Final energies and different contributions obtained from an scf calculation.

Can be used for scf calculations.

Construct ScfEnergiesData object.

Parameters:
  • total_energy (float) – Total energy of the system.

  • kinetic_energy (float) – Kinetic energy of the system.

  • potential_energy (float) – Potential energy of the system.

  • virial_theorem (float) – Value of the virial theorem.

  • wavefunction_norm (float) – Norm of the wavefunction.

  • coulomb_energy (float) – Coulomb energy of the system.

  • xc_energy (float) – Exchange-correlation energy of the system.

  • ts_energy (float) – Entropic energy of the system.

  • free_energy (float) – Free energy of the system.

  • sigma0_energy (float) – “Sigma0” energy of the system.

classmethod from_parser(parser)[source]

Generate an instance of ScfEnergiesData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

ScfEnergiesData.

class turbomoleio.output.data.ScfIterationData(energies=None, first_index=None, n_steps=None, dampings=None, converged=None)[source]

Bases: BaseData

Details about the iteration in a scf calculation.

It contains the value for each step as lists, but only keeps the initial and final indices to avoid wasting space. The index may start from values higher than 1 if it is a restart of a previous scf calculation.

Construct ScfIterationData object.

Parameters:
  • energies (list) – values of the energies for each step of the scf loop.

  • first_index (int) – first index of the loop.

  • n_steps (int) – number of scf steps.

  • dampings (list) – values of the dampings for each step of the scf loop.

  • converged (bool) – True if the calculation converged.

classmethod from_parser(parser)[source]

Generate an instance of ScfIterationData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

ScfIterationData.

plot_energies(ax=None, **kwargs)[source]

Plot the evolution of the energies in the scf loop.

Parameters:
  • ax (Axes) – a matplotlib Axes or None if a new figure should be created.

  • kwargs – arguments passed to matplotlib plot function.

Returns:

A matplotlib Figure.

Keyword arguments controlling the display of the figure:

kwargs

Meaning

title

Title of the plot (Default: None).

show

True to show the figure (default: True).

savefig

“abc.png” or “abc.eps” to save the figure to a file.

size_kwargs

Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)

tight_layout

True to call fig.tight_layout (default: False)

ax_grid

True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.

ax_annotate

Add labels to subplots e.g. (a), (b). Default: False

fig_close

Close figure. Default: False.

class turbomoleio.output.data.SingleExcitation(tot_en=None, osc_stre=None, rot_stre=None, dominant_contributions=None, moments_columns=None)[source]

Bases: MSONable

Auxiliary object to store the information about an escf/egrad calculation.

It cannot be extracted directly from the string, being present several times in the output of an escf/egrad calculation.

Construct SingleExcitation object.

Parameters:
  • tot_en (float) – total energy.

  • osc_stre (float) – oscillator strength, length representation.

  • rot_stre (float) – rotatory strength, length representation.

  • dominant_contributions (list) – list of all the dominant contributions. Each element is a dictionary with “occ_orb” (a dictionary with index of the occupied orbital, irrep, energy and spin), “virt_orb” (same as “occ_orb”) and “coeff” (the coefficient of the contribution).

  • moments_columns (list) – a list of dictionaries containing the electric and magnetic moments for each column. Each dictionary should contain the following keys: “electric_dipole” (3D vector with the electronic dipole as a list), “magnetic_dipole” (3D vector with the magnetic dipole as a list) and “electric_quadrupole” (description of the electronic quadrupole with keys “moment”, i.e. the 3x3 matrix of the quadrupole moment, “trace” and “anisotropy”).

class turbomoleio.output.data.SmearingData(initial_elec_temp=None, final_elec_temp=None, annealing_factor=None, annealing_homo_lumo_gap_limit=None, smearing_de_limit=None)[source]

Bases: BaseData

Information about the smearing ($fermi datagroup).

Can be used for scf executables.

Construct SmearingData object.

Parameters:
  • initial_elec_temp (float) – initial electron temperature.

  • final_elec_temp (float) – final electron temperature.

  • annealing_factor (float) – annealing factor

  • annealing_homo_lumo_gap_limit (float) – annealing if HOMO-LUMO gap lower than this value.

  • smearing_de_limit (float) – smearing switched off if DE lower than this value.

classmethod from_parser(parser)[source]

Generate an instance of SmearingData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

SmearingData.

class turbomoleio.output.data.SpinData(unrestricted=None, s2=None)[source]

Bases: BaseData

Information about the spin in the calculation.

Can be used for scf, gradient and escf executables.

Construct SpinData object.

Parameters:
  • unrestricted (bool) – True if is an uhf calculation.

  • s2 (float) – S^2 value of the spin.

classmethod from_parser(parser)[source]

Generate an instance of SpinData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

SpinData.

class turbomoleio.output.data.StatptData(max_trust_radius=None, min_trust_radius=None, init_trust_radius=None, min_grad_norm_for_gdiis=None, prev_steps_for_gdiis=None, hessian_update_method=None, thr_energy_change=None, thr_max_displ=None, thr_max_grad=None, thr_rms_displ=None, thr_rms_grad=None, use_defaults=None, final_step_radius=None)[source]

Bases: BaseData

Initial information provided in statpt.

Can be used only for statpt.

Construct StatptData object.

Parameters:
  • max_trust_radius (float) – maximum allowed trust radius.

  • min_trust_radius (float) – minimum allowed trust radius

  • init_trust_radius (float) – initial trust radius.

  • min_grad_norm_for_gdiis (float) – GDIIS used if gradient norm is lower than this value.

  • prev_steps_for_gdiis (int) – number of previous steps for GDIIS.

  • hessian_update_method (str) – hessian update method.

  • thr_energy_change (float) – threshold for energy change.

  • thr_max_displ (float) – threshold for max displacement element.

  • thr_max_grad (float) – threshold for max gradient element.

  • thr_rms_displ (float) – threshold for RMS of displacement.

  • thr_rms_grad (float) – threshold for RMS of gradient.

  • use_defaults (bool) – True if $statpt was not defined and using default options.

  • final_step_radius (float) – final step radius.

classmethod from_parser(parser)[source]

Generate an instance of StatptData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

StatptData.

class turbomoleio.output.data.SymmetryData(symbol=None, n_reps=None, reps=None)[source]

Bases: BaseData

Information on the symmetry of the molecule.

Can be used for all the TM executables (in some case only a part of the information might be available).

Construct SymmetryData object.

Parameters:
  • symbol (str) – symbol of the symmetry of the molecule.

  • n_reps (int) – number of representations

  • reps (list) – the symbols of the representations.

classmethod from_parser(parser)[source]

Generate an instance of SymmetryData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

SymmetryData.

class turbomoleio.output.data.TurbomoleData(version=None, build=None, executable=None)[source]

Bases: BaseData

Information about the Turbomole version and executable used.

Can be used for all Turbomole executables.

Construct TurbomoleData object.

Parameters:
  • version (str) – number of the Turbomole version.

  • build (str) – Turbomole build.

  • executable (str) – name of the executable in the header of the output

classmethod from_parser(parser)[source]

Generate an instance of TurbomoleData from a parser.

The parser is based on the stdout of a Turbomole executable. Returns None if no data could be parsed.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

TurbomoleData.

turbomoleio.output.files module

Module with parsed output objects.

class turbomoleio.output.files.AoforceOutput(numerical_integration, rotational, vibrational, run, tm)[source]

Bases: BaseData

Object containing the data of the output of an aforce calculation.

Works with native aoforce calculations and after a numforce.

Construct AoforceOutput object.

Parameters:
  • numerical_integration (AoforceNumericalIntegrationData) – information about the numerical integration in aoforce. Missing if from a numforce calculation.

  • rotational (AoforceRotationalData) – analysis of rotational states in aoforce.

  • vibrational (AoforceVibrationalData) – analysis of vibrational states in aoforce.

  • run (RunData) – information about calculation running (e.g. timings, …).

  • tm (TurbomoleData) – information about the turbomole used for the calculation.

classmethod from_parser(parser)[source]

Generate an instance of AoforceOutput from a parser.

The parser is based on the stdout of a Turbomole executable.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

AoforceOutput.

class turbomoleio.output.files.EgradOutput(gradients, dielectric, dft, escf, geometry, basis, run, tm, cosmo, integral, ex_state)[source]

Bases: BaseData

Object containing the data of the output of an egrad calculation.

It combines the outputs of standard gradients calculations with the output of escf.

Construct EGradOutput object.

Parameters:
  • gradients (list) – matrix of shape (natoms, 3) containing the values of the cartesian gradients.

  • dielectric (list) – 3x3 matrix containing the values of the dielectric tensor.

  • dft (DFTData) – information about dft calculation.

  • escf (EscfData) – information about the excited state calculation.

  • geometry (GeometryData) – the geometry of the system.

  • basis (BasisData) – the basis used for the calculation.

  • run (RunData) – information about calculation running (e.g. timings, …).

  • tm (TurbomoleData) – information about the turbomole used for the calculation.

  • cosmo (CosmoData) – cosmo approximations and results.

  • integral (IntegralData) – information about the thresholds for integrals.

  • ex_state (int) – the (1-based) index of the excited state used for the gradients.

classmethod from_parser(parser)[source]

Generate an instance of EgradOutput from a parser.

The parser is based on the stdout of a Turbomole executable.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

EgradOutput.

class turbomoleio.output.files.EscfOnlyOutput(escf, run, tm)[source]

Bases: BaseData

Data containing the minimal information about the output of an escf calculation.

Parses only the information relative to escf calculation, ignoring the part that is common to the output of the scf calculation that precedes the escf.

Construct EscfOnlyOutput object.

Parameters:
  • escf (EscfData) – information about the excited state calculation.

  • run (RunData) – information about calculation running (e.g. timings, …)

  • tm (TurbomoleData) – information about the turbomole used for the calculation.

classmethod from_parser(parser)[source]

Generate an instance of EscfOnlyOutput from a parser.

The parser is based on the stdout of a Turbomole executable.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

EscfOnlyOutput.

class turbomoleio.output.files.EscfOutput(dft, escf, geometry, basis, run, tm, cosmo, integral, symmetry)[source]

Bases: BaseData

Object containing the data of the output of an escf calculation.

Parses also the information relative to the dft part, which is common to the output of the scf calculation that preceeds the escf.

Construct EscfOutput object.

Parameters:
  • dft (DFTData) – information about dft calculation.

  • escf (EscfData) – information about the excited state calculation.

  • geometry (GeometryData) – the geometry of the system.

  • basis (BasisData) – the basis used for the calculation.

  • run (RunData) – information about calculation running (e.g. timings, …)

  • tm (TurbomoleData) – information about the turbomole used for the calculation.

  • cosmo (CosmoData) – cosmo approximations and results.

  • integral (IntegralData) – information about the thresholds for integrals.

  • symmetry (SymmetryData) – information about the symmetry of the molecule

classmethod from_parser(parser)[source]

Generate an instance of EscfOutput from a parser.

The parser is based on the stdout of a Turbomole executable.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

EscfOutput.

class turbomoleio.output.files.GradOutput(gradients, dielectric, run, tm, memory)[source]

Bases: BaseData

Object containing the data of the output of a simple gradient calculation.

This can be used for e.g. grad and rdgrad.

Construct GradOutput object.

Parameters:
  • gradients (list) – matrix of shape (natoms, 3) containing the values of the cartesian gradients.

  • dielectric (list) – 3x3 matrix containing the values of the dielectric tensor.

  • run (RunData) – information about calculation running (e.g. timings, …)

  • tm (TurbomoleData) – information about the turbomole used for the calculation.

  • memory (int) – memory in MB used. Available only for rdgrad.

classmethod from_parser(parser)[source]

Generate an instance of GradOutput from a parser.

The parser is based on the stdout of a Turbomole executable.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

GradOutput.

class turbomoleio.output.files.JobexOutput(energy, gradient, relax)[source]

Bases: BaseData

Object containing the data of the output of the last step of a jobex calculation.

Namely the outputs of the last energy, gradient and relax calculations stored in the “job.last” file.

Construct JobexOutput object.

Parameters:
  • energy (ScfOutput) – the output data of the energy calculation.

  • gradient – the output data of the energy calculation. The type depends on the type of calculation. Can be GradOutput, EgradOutput or coming from other executables (e.g. Ricc2Output or MP2Output).

  • relax (RelaxOutput or StatptOutput) – the output data of the relax calculation.

classmethod from_parser(parser)[source]

Generate an instance of JobexOutput from a parser.

The parser is based on the output contained in the “job.last” file generated by jobex. Splits the output in the different types of executables and generates suitable objects for them.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

JobexOutput.

class turbomoleio.output.files.MP2Output(info, results, geometry, basis, symmetry, cosmo, run, tm)[source]

Bases: BaseData

Object containing the data of the output of an MP2 calculation.

Can be used for different MP2 calculation types, i.e. mpgrad, ricc2 (with proper MP2 options), or pnoccsd (with proper MP2 options).

Note: Parsing of PNO-based MP2 calculations (i.e. performed with the pnoccsd program) is not (yet) supported.

Construct MP2Output object.

Parameters:
  • info (MP2Data) – Information about MP2 calculation.

  • results (MP2Results) – Results of an MP2 calculation.

  • geometry (GeometryData) – the geometry of the system.

  • basis (BasisData) – the basis used for the calculation.

  • symmetry (SymmetryData) – information about the symmetry of the molecule.

  • cosmo (CosmoData) – cosmo approximations and results.

  • run (RunData) – information about calculation running (e.g. timings, …).

  • tm (TurbomoleData) – information about the turbomole used for the calculation.

classmethod from_parser(parser)[source]

Generate an instance of MP2Output from a parser.

The parser is based on the stdout of a Turbomole executable.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

MP2Output.

class turbomoleio.output.files.RelaxOutput(info, gradients, convergence, run, tm)[source]

Bases: BaseData

Object containing the data of the output of a relax calculation (not statpt).

Construct RelaxOutput object.

Parameters:
  • info (RelaxData) – initial information provided in relax.

  • gradients (RelaxGradientsData) – gradient values extracted from the relax output that take into account the frozen coordinates.

  • convergence (RelaxConvergenceData) – final information about convergence according to what is defined in the control file.

  • run (RunData) – information about calculation running (e.g. timings, …)

  • tm (TurbomoleData) – information about the turbomole used for the calculation.

classmethod from_parser(parser)[source]

Generate an instance of RelaxOutput from a parser.

The parser is based on the stdout of a Turbomole executable.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

RelaxOutput.

class turbomoleio.output.files.Ricc2Output(mp2, run, tm)[source]

Bases: BaseData

Object containing the data of the output of a ricc2 calculation.

Construct Ricc2Output object.

Parameters:
  • mp2 (MP2Results) – MP2 results.

  • run (RunData) – information about calculation running (e.g. timings, …)

  • tm (TurbomoleData) – information about the turbomole used for the calculation.

classmethod from_parser(parser)[source]

Generate an instance of Ricc2Output from a parser.

The parser is based on the stdout of a Turbomole executable.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

Ricc2Output.

class turbomoleio.output.files.ScfOutput(dft, scf, energies, electrostatic, geometry, basis, run, tm, cosmo, spin, integral, smearing, symmetry, periodicity=None)[source]

Bases: BaseData

Object containing the data of the output of an scf calculation, i.e. dscf or ridft.

Note: for riper calculations, not all data is currently parsed. The final

energies are extracted but e.g. information about scf loops is currently not parsed.

Construct ScfOutput object.

Parameters:
  • dft (DFTData) – information about dft calculation.

  • scf (ScfData) – information about scf loop.

  • energies (ScfEnergiesData) – final energy of scf calculation.

  • electrostatic (ElectrostaticMomentsData) – information about electrostatic moments.

  • geometry (GeometryData) – the geometry of the system.

  • basis (BasisData) – the basis used for the calculation.

  • run (RunData) – information about calculation running (e.g. timings, …)

  • tm (TurbomoleData) – information about the turbomole used for the calculation.

  • cosmo (CosmoData) – cosmo approximations and results.

  • spin (SpinData) – information about the spin of the system.

  • integral (IntegralData) – information about the thresholds for integrals.

  • smearing (SmearingData) – information about the smearing ($fermi datagroup).

  • symmetry (SymmetryData) – information about the symmetry of the molecule.

  • periodicity (PeriodicityData) – information about the periodicity of the system.

classmethod from_parser(parser)[source]

Generate an instance of ScfOutput from a parser.

The parser is based on the stdout of a Turbomole executable.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

ScfOutput.

class turbomoleio.output.files.StatptOutput(info, gradients, convergence, run, tm)[source]

Bases: BaseData

Object containing the data of the output of a statpt calculation (not relax).

Construct StatptOutput object.

Parameters:
  • info (StatptData) – initial information provided in statpt.

  • gradients (RelaxGradientsData) – gradient values extracted from the statpt output that take into account the frozen coordinates.

  • convergence (RelaxConvergenceData) – final information about convergence according to what is defined in the control file.

  • run (RunData) – information about calculation running (e.g. timings, …)

  • tm (TurbomoleData) – information about the turbomole used for the calculation.

classmethod from_parser(parser)[source]

Generate an instance of StatptOutput from a parser.

The parser is based on the stdout of a Turbomole executable.

Parameters:

parser (Parser) – the parser to be used to extract the data.

Returns:

StatptOutput.

turbomoleio.output.parser module

Module with the main parsing utilities for the stdout of Turbomole executables.

class turbomoleio.output.parser.Parser(string)[source]

Bases: object

Main Parser object for Turbomole output files.

This object allows to parse the different outputs (the stdout) produced by the Turbomole executables. Each method parses a specific portion of the output aiming at being as reusable as possible across the different types of outputs. The quantities are accessible as lazy properties, to avoid parsing the same sections multiple times. The parser expects the output of a completed calculation. Parsing of crashed calculations may lead to wrong output. The methods rely heavily on regex to select portions of the output and extract the quantities.

Construct Parser object.

Parameters:

string (str) – the string of the output from Turbomole.

all_done()[source]

Check if “all done” is present in the string.

aoforce_analysis()[source]

Output of rotational and vibrational analysis in aoforce.

Returns:

dict with “rotational” (a dict with “dipole_moment”, “b”, “intensities”, “m”) and “vibrational”. Vibrational, contains dict with keys “frequencies”, “symmetries”, “ir”, “dDIP_dQ”, “intensities”, “intensities_perc”, “raman”, “eigenvectors”, “reduced_masses”. One value for each frequency.

aoforce_numerical_integration()[source]

Extract the information about the numerical integration in aoforce.

Will be present only if a proper aoforce is run. Absent if running after numforce.

Returns:

dict with “memory” (a dict with “core_memory_dft”, “memory_per_atom”, “atoms_per_loop”) and “construction_timings” (a list of lists with construction timings. For each element: [timing_description, cpu_time, wall_time] with timing_description being the description of the timing, cpu_time being the CPU time in seconds and wall_time, the wall time in seconds.

basis()[source]

Extract the data of the basis used for the calculation.

It also contains the auxiliary basis in case of RI. Valid for most of the TM executables (including the scf, escf, grad).

Returns:

dict with “basis_per_specie” a dict with species as keys and name of the basis as values, “aux_basis_per_specie” the same for auxiliary basis, “number_scf_basis_func” and “number_scf_aux_basis_func”.

centers()[source]

Extract the center of mass and center of charge values.

Valid for most of the TM executables (including the scf, escf, grad).

Returns:

dict with “center_of_mass” and “center_of_charge”.

coordinates()[source]

Extract the coordinates, species and charges of the atoms.

Valid for most of the TM executables (including the scf, escf, grad).

Returns:

dict with “coord”, “species”, “charges”, and “isotopes” as lists.

cosmo_header()[source]

Extract the information from the header of the cosmo section (area and volume).

Should return None if cosmo is not activated. Valid for scf and escf/egrad.

Returns:

dict with “area” and “volume”.

cosmo_results()[source]

Extract the results of cosmo.

Valid only for scf executables.

Returns:

“parameters” (“nppa”, “nspa”, “nsph”, “npspher”, “disex”, “disex2”, “rsolv”, “routf”, “phsran”, “ampran”, “cavity”, “epsilon”, “refind”, “fepsi”), “screening_charge” (“cosmo”, “correction”, “total”), “energies” (“total_energy”, “total_energy_oc_corr”, “dielectric_energy”, “dielectric_energy_oc_corr”), “element_radius” (“radius, “sites”).

Return type:

dict with several subdictionaries

density_functional_data()[source]

Extract the information relative to DFT calculations (xf functional and grids).

Valid for scf, gradient and relax executables.

Returns:

dict with the full string describing the functional “functional_msg”, “functional_name”, “functional_type”, the version of “xcfun”, “spherical_gridsize, number of “gridpoints” for spherical integration.

dftd()[source]

Extract information about dispersion correction in dft.

Valid for scf executables.

Returns:

dict with the type of “correction” (string) and the value of correction “en_corr”.

egrad_excited_state()[source]

Extract the information about the excited state chosen for optimization.

Valid only for egrad.

Returns:

dict with “index” indicating the (1-based) index of the state used for optimization and “default” to True if the default values used for $exopt.

electrostatic_moments()[source]

Extract the information about the electrostatic moment (dipole and quadrupole).

Valid only for scf executables.

Returns:

dict with single “dipole” and “quadrupole” moments.

escf_excitations()[source]

Extract all the values for each calculated excitation.

Valid for escf and egrad executables.

Returns:

dict with name of irreps as keywords and list of excitations as values. For each excitation, a dict with: “tot_en”, “osc_stre”, “rot_stre”, “dominant_contributions” (list of contributions), “moments_columns” (list of dicts value of electric and magnetic moment for each column).

escf_gs_total_en()[source]

Extract the value of the final total energy of escf.

Valid for escf and egrad executables.

Returns:

float.

escf_iterations()[source]

Extract the data for each iteration of the escf loop.

Valid for escf and egrad executables.

Returns:

dict “converged” to True if the calculation is converged and a list

of “steps”. One element of the list for each escf step. One element of the sublist for each irrep. The inner list contains the convergence information: [name of the irrep, number of converged roots, euclidean residual norm].

fermi()[source]

Extract the information about smearing of occupations.

Valid only for scf executables.

Returns:

dict with “initial_elec_temp”, “final_elec_temp”, “annealing_homo_lumo_gap_limit”, “smearing_de_limit”.

classmethod from_file(filepath, check_all_done=True)[source]

Generate an instance from a file path.

Parameters:
  • filepath (str) – path to the output file to read.

  • check_all_done (bool) – if True it will be checked that the job was “all done”. If not an exception is raised.

Returns:

an instance of Parser.

get_split_jobex_parsers()[source]

Get parser for each step of a jobex calculation.

Given the string of the “job.last” output file of jobex, this generates the parsers for each of the step: energy, gradient and relax.

Returns:

exec_en: executable of the energy step. parser_en: parser with the output of the energy step. exec_grad: executable of the gradient step. parser_grad: parser with the output of the gradient step. exec_relax: executable of the energy step. parser_relax: parser with the output of the relax step.

Return type:

namedtuple

get_value(text, chunk, occurrence=0, converter=None)[source]

Get value from the string.

This finds the i-th occurrence of a line containing the specified text, splits the line and takes the specified chunk obtained from the split. Optionally converts it to a specific format.

Parameters:
  • text (str) – text to search

  • chunk (int) – the chunk to take after the split of the line. Can be negative as it identifies the index in the list.

  • occurrence (int) – the 0-based index of the occurrence of the “text” in the string. Can be negative (e.g. -1 is the last occurrence).

  • converter (callable) – called to convert the selected chunk to some other type. It can be simply int, but for a float it would be better to use the convert_float function instead.

Returns:

the converted selected chunk.

gradient()[source]

Extract the values of the gradients and dielectric data.

Valid for gradient executables.

Returns:

dict with “gradients”, a matrix of shape (natoms, 3) containing the values of the cartesian gradients, and “dielectric”.

grep_line(text, nlines=0)[source]

Search the text in the string similarly to the grep command.

The specified text is searched in a single line and the full line plus the “nlines” following the matching one is returned. Returns the first match.

Parameters:
  • text (str) – the text to be searched.

  • nlines (int) – the number of lines

Returns:

the text found

Return type:

str

header()[source]

Extract the information contained in the header of the output.

The header contains information such as the TM version and timings. Valid for all the TM executables.

Returns:

dict with “executable” name, “host” of execution, “tm_version”,

”tm_build”, “start_time”.

integral()[source]

Extract the thresholds for integrals.

Valid for scf, gradient and escf executables.

Returns:

dict with “integral_neglect_threshold”, “thize”, “thime”.

is_uhf()[source]

Determine if the calculation is a UHF one.

Valid for scf, gradient and escf executables.

Returns:

bool.

mp2_data()[source]

Extract information of MP2 calculation.

Returns:

dict with “energy_only”.

mp2_results()[source]

Extract MP2 results.

Returns:

dict with “energy”.

periodicity_data()[source]

Information about periodicity.

Returns:

dict with “periodicity”, “tm_lattice_params”, “shortest_interatomic_distance”, “direct_space_vectors”, “reciprocal_space_vectors”.

pre_escf_run()[source]

Extract the “pre-escf iterations” information about the escf calculation.

This information is printed before running the escf iterations. Valid for escf and egrad executables.

Returns:

dict with “calc_type”, “residuum_convergence_criterium”, “n_occupied_orbitals”, “orbital_characterization”, “max_davidson_iter”, “machine_precision”, “max_core_mem”, “max_cao_basis_vectors”, “max_treated_vectors”, “irrep_data”.

pre_scf_run()[source]

Extract “pre-scf loop” information extracted about the scf calculation.

The information extracted is printed before running the scf loop.

Valid only for scf executables.

Returns:

dict with “diis” True if activated, diis_error_vect”, “conv_tot_en”, “conv_one_e_en”, “virtual_orbital_shift_on”, “virtual_orbital_shift_limit”, “orbital_characterization”, “restart_file”, “n_occupied_orbitals”.

rdgrad_memory()[source]

Extract the memory allocated for rdgrad.

Valid for rdgrad.

Returns:

int.

relax_conv_info()[source]

Extract the final information about convergence.

This is performed according to what is defined in the control file. Valid for relax and statpt.

Returns:

dict with “energy_change”, “rms_displ”, “rms_grad”, “max_displ”, “max_grad”. For each one a dict with “value”, “thr” and “conv”.

relax_gradient_values()[source]

Extract the gradient values from the relax/stapt output.

This takes frozen coordinates into account. Valid for relax and statpt.

Returns:

dict with “norm_cartesian”, “norm_internal”, “max_internal”

relax_info()[source]

Extract the initial information provided in relax.

Valid only for relax.

Returns:

dict with “optimizations” list of optimized quantities and “thr_int_coord”.

rij_info()[source]

Extract information about RI.

Valid for ridft and escf/egrad.

Returns:

dict with “marij” to True if marij calculation, “rij_memory”, “rik” to True if $rik and “ricore” memory in MB.

riper_scf_energies()[source]

Extract the final energies for scf calculation with riper executable.

Returns:

“total_energy”, “kinetic_energy”, “coulomb_energy”, “xc_energy”, “ts_energy”, “free_energy” and “sigma0_energy”.

Return type:

dict with the energy and its contributions

s2()[source]

Extract the value S^2 of the spin.

Valid only for scf executables.

Returns:

dict containing “s2”.

scf_energies()[source]

Extract the final energies for scf calculation.

Valid only for scf executables.

Returns:

“total_energy”, “kinetic_energy”, “potential_energy”, “virial_theorem”, “wavefunction_norm”.

Return type:

dict with the energy and its contributions

scf_iterations()[source]

Extract the data for each iteration of the scf loop.

Valid only for scf executables.

Returns:

dict with the list of values extracted for each scf step “energies”, “dampings”. The value of the “first_index” and “n_steps”. “converged” True if the calculation is converged.

statpt_info()[source]

Extract the initial information provided in statpt.

Valid only for statpt.

Returns:

dict with “max_trust_radius”, “min_trust_radius”, “init_trust_radius”, “min_grad_norm_for_gdiis”, “prev_steps_for_gdiis”, “hessian_update_method”, “thr_energy_change”, “thr_max_displ”, “thr_max_grad”, “thr_rms_displ”, “thr_rms_grad”, “use_defaults”, “final_step_radius”.

property string

Get the string given as an input.

symmetry()[source]

Extract the symmetry of the molecule and the irreducible representations.

Valid for all the TM executables (in some case only a part of the information might be available).

Returns:

dict with symmetry “symbol”, “n_reps” and list of representation symbols “reps”.

timings()[source]

Extract the cpu and wall time for the calculation.

Valid for all the Turbomole executables.

Returns:

dict with “cpu_time” and “wall_time” in seconds.

turbomoleio.output.parser.convert_float(f)[source]

Convert a float from the output.

Handles simple float and exponential notation with D and E (e.g 11.23 1.123E+01 1.123D+01). Returns None if the string is composed of only asterisks, as it might be in case of formatting problems in fortran.

Parameters:

f (str) – the string to be converted to a float.

Returns:

float.

turbomoleio.output.parser.convert_int(i)[source]

Convert an int from the output.

Returns None if the string is composed of only asterisks, as it might be in case of formatting problems in fortran.

Parameters:

i (str) – the string to be converted to an int.

Returns:

int.

turbomoleio.output.parser.convert_time_string(line)[source]

Convert the cpu and wall time string given in the Turbomole outputs to seconds.

Example: 2 days 1 hours 12 minutes and 55 seconds.

Parameters:

line (str) – the line with the timings.

Returns:

the value of the time in seconds.

Return type:

float

turbomoleio.output.states module

Module for extracting and modifying electronic states.

class turbomoleio.output.states.EigerOutput(eigenvalues, irreps, irrep_indices, occupations, spin, gap, nelec)[source]

Bases: MSONable

Class to read and store the output from the eiger command.

Construct the EigerOutput object.

The lists should match among them and be sorted in ascending values with respect to the eigenvalues.

Parameters:
  • eigenvalues (list) – the eigenvalues.

  • irreps (list) – the irreducible representations.

  • irrep_indices (list) – the inddices for each irreducible representation.

  • occupations (list) – the occupations.

  • spin (list) – the spins.

  • gap (float) – the value of the gap.

  • nelec (float) – the total number of electrons.

compare_states(states, tol=1e-06)[source]

Compare the current values with anoter States object.

This checks that the two are equivalent. Numbers are checked within the specified tolerance.

Parameters:
  • states (States) – States object to be compared.

  • tol (float) – tolerance on the floating numbers.

Returns:

None if the data are equivalent, otherwise a string describing the difference between this instance and the States object.

classmethod from_file(filename)[source]

Generate the object from a file with the output from eiger.

Parameters:

filename (str) – the name of the file containing the output of eiger.

Returns:

An instance of EigerOutput

classmethod from_string(string)[source]

Generate the object from the string of the output from eiger.

Parameters:

string (str) – the string of the output of eiger.

Returns:

An instance of EigerOutput

class turbomoleio.output.states.EigerRunner(executable='eiger', data_path='.')[source]

Bases: object

Class that runs the eiger executable.

Construct EigerRunner object.

Parameters:
  • executable (str) – the eiger executable.

  • data_path (str) – path to where the TM data are stored.

get_eiger_output()[source]

Generate an EigerOutput instance from the output of eiger.

Returns:

EigerOutput

Raises:

ValueError – if eiger has not run

run()[source]

Run eiger in the data_path directory.

Returns:

None

to_file(filepath)[source]

Write the output of eiger to a file.

Parameters:

filepath (str) – path to the file.

Returns:

None

Raises:

ValueError – if eiger has not run

class turbomoleio.output.states.State(eigenvalue, irrep, irrep_index, occupation, spin=None)[source]

Bases: MSONable

Object a single state of a calculation.

Each state is identified by its irreducible representation, the index in the irrep, its spin, its occupation and the calculated eigenvalue. Uses Fraction for occupation for compatibility with the Shells object.

Construct State object.

Parameters:
  • eigenvalue (float) – the eigenvalue of the state

  • irrep (str) – the irreducible representation

  • irrep_index (int) – the index in the irreducible representation

  • occupation (Fraction) – occupation of the state

  • spin (str) – “a” or “b” if a uhf calculation, representing the spin, None otherwise.

as_dict()[source]

Get a JSON serializable dict representation of State.

classmethod from_dict(d)[source]

Generate object from JSON representation.

property has_fractional_occ

Check if the state is only fractionally occupied.

property max_occupation

Get the maximum possible occupation for this state.

This depends on the irrep and spin of the system.

Returns:

the maximum occupation.

Return type:

int

class turbomoleio.output.states.States(states)[source]

Bases: MSONable, MutableSequence

A sequence of State, sorted in increasing order of energy.

Describes the eigenstates of a molecule.

Construct the States object.

The states are sorted here.

Parameters:

states (list) – a list of State.

as_dict()[source]

Get a JSON serializable dict representation of States.

property eigenvalues

Get the list of all the eigenvalues.

filter_states(spin=None, irrep=None)[source]

Generate a States instance with a subset of the State objects.

The State objects are filtered by spin and irrep. Notice that the same instances of State as in the current object will be used.

Parameters:
  • spin (str) – string describing the spin. Values allowed: “alpha”, “beta” and the shortcuts “a” and “b”.

  • irrep (str) – the symbol of the irreducible representations.

Returns:

the filtered list of states.

Return type:

States

Raises:

ValueError – if spin is requested for a non uhf calculation.

classmethod from_file(filename='control')[source]

Generate the instance from a file (usually control).

Parameters:

filename (str) – name of the file

Returns:

An instance of States

property gap

Get the gap between the HOMO and the LUMO.

Can be negative if a hole is present. None if no empty state is available.

generate_lowest_filled_states(allow_fractional=None, only_occupied=False, reorder_irrep_index=False)[source]

Create a new States object with lowest states filled.

Using the current number of electrons, this fills the states starting from the lowest ones in energy. This procedure can lead to fractional occupations even if initially not present because of states degeneracies. If not allowed an exception will be raised in this case.

Parameters:
  • allow_fractional (bool) – whether to allow fractional occupations in the states. If None it will be set equal to self.has_fractional_occ.

  • only_occupied (bool) – if True only occupied states will be considered.

  • reorder_irrep_index (bool) – if True the irrep_index of the states will changed to be in ascending order.

Returns:

a list of the lowest lying states filled with electrons.

Return type:

States

Raises:

RuntimeError – if the states will contain fractional occupations and allow_fractional is False.

get_shells(spin=None)[source]

Generate a Shells object with the occupied shells in the list of States.

Parameters:

spin (str) – string describing the spin. Values allowed: “alpha”, “beta” and the shortcuts “a” and “b”.

Returns:

the occupied shells for the states

Return type:

Shells

property has_fractional_occ

Check if any of the states has a fractional occupation.

property has_hole

Check if the system has a hole.

property homo

Get the HOMO state.

property homo_index

Get the index of the HOMO state.

insert(index, state)[source]

Insert state at the specified index.

property irrep_indices

Get the list of all the indices of the irreducible representations.

property irreps

Get the list of all the irreducible representations.

property is_uhf

Determine whether the calculation is a UHF one.

property lumo

Get the LUMO state.

None if no empty state is available.

property lumo_index

Get the index of the LUMO state.

None if no empty state is available.

property n_states

Get the number of states.

property occupations

Get the list of all the occupations.

property spins

Get the list of all the spins.

property total_electrons

Get the total numer of electrons.

Can be a float if occupations are fractional.

turbomoleio.output.states.get_mos_energies(dg_string)[source]

Get the molecular orbital energies.

Given the string of a mos datagroup or the content of the mos file this extracts the list of energies associated with each state. Each state is identified by its irreducible representation and the index relative that that irrep.

Parameters:

dg_string (str) – the string with the datagroup

Returns:

A list of energies, each element of the list contains the irrep, the index relative to the irred and the energy.

Module contents

Module for output parsing.