Exporting Module#

This is an experimental module! It is used within our group to export data from SlothPy to popular editors.

Module for experimental exports of SlothPy data.

slothpy.exporting.table_energy_and_g(slt_file, group, i_last_doublet, krames, i_first_doublet=0, decomp='total_angular', i_first_composition=0, i_last_composition=0, threshold=0.1, output_path='./', output_name='')[source]#

Creates .docx file containing table with g tensor and energy information.

Parameters:
  • slt_file (Compound) – Slt file storing data needed for the table.

  • group (str) – Name of a group from .slt file for which table will be created. Requires f”{group}_soc_energies”, f”{group}_g_tensors_axes” and f”{group}_magnetic_decomposition” or f”{group}_total_angular _decomposition” (outputs of Compound functions: soc_energies_cm_1, calculate_g_tensor_and_axes_doublet, matrix_decomposition_in_z_pseudo _spin_basis(with ‘soc’ and ‘total_angular’ or ‘magnetic’ setting, additionally rotation should be set as one for the ground state)).

  • i_last_doublet (int) – Index of the last doublet used in the table. For example, if you are working with the lanthanides ions 3+ this index should be matching the splitting of the ground term of the considered lanthanide. (J2+1 states, since we take index of doublet /2 and -1 since we count from 0): Ce: 2, Pr: 3, Nd: 4, Pm: 3, Sm: 2, Eu: 0, Gd: 3, Yb: 3, Tm: 5, Er: 7, Ho: 7, Dy: 7, Tb: 5

  • krames (bool) – Determines if the table should use the table’s template for Krames ions (even electron number) or non-Krames ions (odd electron number).

  • i_first_doublet (int = 0) – Index of the last doublet used in the table.

  • decomp (Union["total_angular", "magnetic"] = "total_angular") – Determines the type of decomposition used.

  • i_first_composition (int = 0) – Determines first decomposed doublet, if 0 i_first_composition = i_ first_doublet.

  • i_last_composition (int = 0) – Determines last decomposed level, if 0 i_last_composition = i_last_doublet.

  • threshold (float = 0.1) – Determines how high the contribution of energy state has to be to be shown in the table [%].

  • output_path (str = "./") – Path to which the output will be saved.

  • output_name (str = "") – Name of the output .docx file.

Return type:

Nothing

Raises:
  • SltFileError – If a Compound object is not passed as an input or it doesn’t include all the necessary data.

  • SltSaveError – If the program is unable to correctly save the .docx file.

slothpy.exporting.axes_in_xyz(slt_file, group, central_atom, xyz_path, xyz_file_name, doublet_number=0, scale_factor=1, output_path='./')[source]#

Adds main XYZ magnetic axes corresponding to the chosen doublet to a .xyz file.

Parameters:
  • slt_file (Compound) – Name of a Compound object corresponding to the .slt file that will be used.

  • group (str) – Name of the group with axes and g_tensors (result of the calculate_g_tensor_and_axes_doublet method).

  • xyz_path (str) – Path to the .xyz file to which axes will be added.

  • xyz_file_name (str) – Name of the .xyz file to which axes will be added.

  • central_atom (str) – Symbol of a unique central atom from which axes will begin.

  • doublet_number (int, optional) – Number of the doublet whose magnetic axes will be added., by default 0

  • scale_factor (float64, optional) – Factor by which the lengths of the axes will be scaled., by default 1

  • output_path (str, optional) – Path to which .xyz output file with the suffix _axes will be saved., by default “./”

Raises:
  • SltFileError – If a Compound object is not passed as an input.

  • SltInputError – If the name of an input xyz file does not end with .xyz.

  • SltSaveError – If the program is unable to correctly save the new .xyz file.

Note

Magnetic axes are scaled by the corresponding pseudo-g-tensor values along them. Atoms representing the axes are as follows: Lv - X, Ts - Y, Og - Z.

slothpy.exporting.axes_in_mol2(slt_file, group, mol2_file_path, mol2_file_name, atom_name, doublet_number=0, scale_factor=1, output_path='')[source]#

Adds main XYZ magnetic axes corresponding to the chosen doublet to a .mol2 file.

Parameters:
  • slt_file (Compound) – Name of a Compound object corresponding to the .slt file that will be used.

  • group (str) – Name of the group with axes and g_tensors (result of the calculate_g_tensor_and_axes_doublet method).

  • mol2_file_path (str) – Path to the .mol2 file to which axes will be added.

  • mol2_file_name (str) – Name of the .mol2 file to which axes will be added.

  • atom_name (str) – Name of a central atom from which axes will begin.

  • doublet_number (int = 0) – Number of the doublet whose magnetic axes will be added., by default 0

  • scale_factor (float64 = 1) – Factor by which the lengths of the axes will be scaled., by default 1

  • output_path (str = "./") – Path to which .mol2 output file with the suffix _axes will be saved., by default “./”

Raises:
  • SltFileError – If a Compound object is not passed as an input.

  • SltInputError – If the name of an input xyz file does not end with .xyz.

  • SltSaveError – If the program is unable to correctly save the new .xyz file.

Note

Magnetic axes are scaled by the corresponding pseudo-g-tensor values along them. Atoms representing the axes are as follows: Lv - X, Ts - Y, Og - Z.