\(\newcommand{\AA}{\text{Å}}\)
CRYSTALClear.crystal_io#
Objects of input / output files of CRYSTAL. Methods to edit or substract data from corresponding files are provided.
- class Crystal_input#
Bases:
Crystal_inputBASE
Crystal input object inherited from the Crystal_inputBASE object. For the basic set-ups of keywords, please refer to manuals there.
- geom_from_cif(file, zconv=None, keyword='EXTERNAL', pbc=[True, True, True], gui_name='fort.34', **kwargs)#
Read geometry from cif file and put infomation to geom block, either as “EXTERNAL” or “CRYSTAL”. CIF files with a single geometry only.
CIF with Symmetry is required.
Note
CIF files should have the “.cif” extension.
- Parameters:
file (str) – CIF file.
keyword (str) – “EXTERNAL” or “CRYSTAL”.
zconv (list[list[int, int]]) – 1st element: The index of atom; 2nd element: The new conventional atomic number. Atoms of the irreducible unit is required.
pbc (list[bool]) – Valid only if
keyword = EXTERNAL
. Force to remove periodic boundary conditions along x, y, z axis.gui_name (str) – Valid only if
keyword = EXTERNAL
. Gui file’s name.**kwargs – Passed to Pymatgen SpacegroupAnalyzer object.
- geom_from_pmg(struc, zconv=None, keyword='EXTERNAL', gui_name='fort.34', **kwargs)#
Read geometry defined by PyMatGen structure object and put infomation into geom block, either as “EXTERNAL” or “CRYSTAL”.
See Crystal_input.geom_from_cif for definition of arguments.
Note
Coordinates of corresponding atoms may not consistent with the original CIF file if “CRYSTAL” is used, in which case coordinates of another symmetry equivalent atom is used.
- bs_from_bse(name, element, zconv=None)#
Download basis set definitions from BSE. A wrapper of BasisSetBASE.from_bse.
- Parameters:
name (str) – Basis set’s name.
element (list[str] | list[int]) – List of elements.
zconv (list[int]) – If not none, use the conventional atomic number. Its length must be the same as element. Its sequence must be consistent with basis set’s.
- bs_from_string(fmt='crystal')#
Define basis set from a string. A wrapper of BasisSetBASE.from_string.
- Parameters:
bs_str (str)
fmt (str) – Format string. Consistent with BSE python API.
- bs_from_file(fmt='crystal')#
Define a basis set from a file. A wrapper of BasisSetBASE.from_file.
- class Crystal_output(output=None)#
Bases:
object
This class reads a CRYSTAL output and generates an object.
- read_cry_output(output_name)#
Deprecated
- get_dielectric_tensor()#
Extracts the dielectric tensor from the output.
- Returns:
self.dielectric_tensor (list[float]) – Dielectric tensor values.
- get_eigenvectors()#
Extracts eigenvectors from the output.
- Returns:
self.num_ao (int) – Number of atomic orbitals.
self.num_k (int) – Number of k points.
- get_dimensionality()#
Gets the dimensionality of the system.
- Returns:
self.dimensionality (int) – Dimensionality of the system.
- get_symmops()#
Return the symmetry operators
- Returns:
self.symmops (numpy.ndarray) – Symmetry operators.
- get_geometry(initial=True, write_gui=False, gui_name=None, symmetry='pymatgen', **kwargs)#
Get the geometry.
- Parameters:
initial (bool) – Read the initial or last gemetry. Useful in case of geometry optimization.
write_gui (bool) – If True, write .gui file
gui_name (str) – Valid only if
write_gui = True
. Gui file is named asgui_name
. If None, usebasename.gui
. The basename is the same as output file.symmetry (str) – Valid only if
write_gui = True
. “pymatgen” to use symmetry info from a pymatgen SpacegroupAnalyzer; “initial” to use symmetry information on output file. If “None”, no symmetry. Otherwise it is taken from the existing gui file.**kwargs – Valid only if
write_gui = True
andsymmetry = "pymatgen"
. Passed to Pymatgen SpacegroupAnalyzer object.
- Returns:
self.geometry (Structure | Molecule) – A pymatgen Structure or molecule object.
- get_last_geom(write_gui_file=False, symm_info='initial')#
Return the last optimised geometry.
- Returns:
self.last_geom (list) – To be documented.
- get_lattice(initial=True)#
Returns the lattice of the system. Unit: Angstrom.
- Parameters:
initial (bool) – Read the initial or last lattice. Useful in case of geometry optimization.
- Returns:
self.lattice (np.ndarray) – Lattice of the system.
- get_reciprocal_lattice(initial=True)#
Returns the reciprocal lattice of the system. Unit: Angstrom^-1. Reciprocal lattice is consistent with CRYSTAL: 2pi is added.
- Parameters:
initial (bool) – Read the initial or last lattice. Useful in case of geometry optimization.
- Returns:
self.reciprocal_lattice (np.ndarray) – Lattice of the system.
- property sg_number#
CRYSTAL 0~3D space group number. Before geometry editing.
- property sg_symbol#
CRYSTAL 0~3D 0~3D space group symbol. Before geometry editing.
- property n_atoms#
Number of atoms. After geometry editing.
- property atom_symbols#
Atom symbols. After geometry editing.
- property atom_numbers#
Conventional atom numbers. After geometry editing.
- property atom_positions#
Composite fractional / Cartesian atomic coordinates. Consistent with CRYSTAL definitions. 3D: Fractional; 2D: Frac, Frac, Cart; 1D Frac, Cart, Cart; 0D: Cart, Cart, Cart. After geometry editing (before optimization).
- property atom_positions_cart#
Cartesian atomic coordinates. After geometry editing (before optimization).
- property atom_positions_frac#
Fractional atomic coordinates. After geometry editing (before optimization).
- get_trans_matrix()#
Get cell transformation matrix
- Returns:
self.trans_matrix (np.ndarray) – 3*3 array of supercell expansion matrix
- get_primitive_geometry(initial=True, write_gui=False, gui_name=None, symmetry='pymatgen', **kwargs)#
Get the primitive geometry, reduced by cell transformation matrix inversed.
Note
This is not the standard primitive cell. This method returns geometry before supercell expansion keywords such as “SUPERCEL” or “SCELPHONO”.
Conventional atomic numbers are not available.
- Parameters:
initial (bool) – Read the initial or last geometry. Useful in case of geometry optimization.
write_gui (bool) – If True, write .gui file
gui_name (str) – Valid only if
write_gui = True
. Gui file is named as “gui_name”. If None, use “basename.gui”. The basename is the same as output file.symmetry (str) – Valid only if
write_gui = True
. “pymatgen” to use symmetry info from a pymatgen SpacegroupAnalyzer; “initial” to use symmstry information on output file. If None, no symmetry. Otherwise it is taken from the existing gui file.**kwargs – Valid only if
write_gui = True
andsymmetry = 'pymatgen'
. Passed to Pymatgen SpacegroupAnalyzer object.
- Returns:
self.primitive_geometry (Structure | Molecule) – A pymatgen Structure or molecule object.
- get_primitive_lattice(initial=True)#
Returns the primitive lattice of the system reduced by cell transformation matrix inverse. Unit: Angstrom.
- Parameters:
initial (bool) – Read the initial or last lattice. Useful in case of geometry optimization.
- Returns:
self.primitive_lattice (np.ndarray) – Lattice of the system.
- get_primitive_reciprocal_lattice(initial=False)#
Returns the primitive reciprocal lattice of the system before expansion by cell transformation matrix inverse. Unit: Angstrom^-1.
- Parameters:
initial (bool) – Read the initial or last lattice. Useful in case of geometry optimization.
- Returns:
self.primitive_reciprocal_lattice (np.ndarray) – Lattice of the system.
- get_config_analysis(return_multiplicity=False)#
Return the configuration analysis for solid solutions (CONFCON keyword in input)
- Parameters:
return_multiplicity (bool, optional) – Return multiplicity
information (default is False)
- Returns:
list or str – Configuration analysis if available, or a warning message
- get_convergence(history=False)#
The upper level of
get_scf_convergence
andget_opt_convergence
. For analysing the geometry and energy convergence.Note
It might not work well with SCF / OPT cycles of multiple systems such as PREOPTGEOM + EOS calculations
- Parameters:
history (bool) – If true, the convergence history of optimisation (energy,gradient, displacement) / SCF is returned.
- Returns:
self (Crystal_output) – New attributes listed below
self.final_energy (float) – eV
For other attributes, see
get_scf_convergence
andget_opt_convergence
methods on the same page.
- get_scf_convergence(all_cycles=False)#
Returns the scf convergence energy and energy difference. A wrapper of
CRYSTALClear.base.SCFBASE.read_convergence
.- Parameters:
all_cycles (bool, optional) – Return all SCF steps for a geometry opt. The “ONELOG’” CRYSTAL keyword is needed.
- Returns:
self (Crystal_output) – New attributes listed below
self.scf_cycles (int | array) – Number of cycles. Array if
all_cycles=True
.self.scf_status (str | list) – “terminated”, “converged”, “too many cycles” and “unknown”. List if
all_cycles=True
.self.scf_energy (array) – SCF energy convergence. Unit: eV
self.scf_deltae (array) – Energy difference. Unit: eV
- get_fermi_energy(history=False)#
Returns the system Fermi energy.
- Parameters:
history (bool) – Whether to read the convergence history of Fermi energy.
- Returns:
self.fermi_energy (float | array) – Fermi energy of the system. For spin-polarized insulating systems,
self.fermi_energy
would be either a 2*1 array (history=False
) or a nCYC*2 array (history=True
).
- get_band_gap(history=False)#
Returns the system band gap.
- Parameters:
history (bool) – Whether to read the convergence history of band gap.
- Returns:
self.band_gap (float | array) – Band gap of the system. For spin-polarized systems,
self.band_gap
would be either a 2*1 array (history=False
) or a nCYC*2 array (history=True
).
- get_mulliken_charges()#
Return the atomic Mulliken charges (PPAN keyword in input).
- Returns:
self.mulliken_charges (array) – natom*1 for non spin-polarised systems. natom*3 for spin-polarised systems. [total, \(alpha\), \(beta\)].
- get_final_energy()#
Get the final energy of the system. A wrapper of
self.get_convergence
.- Returns:
self.final_energy (float) – The final energy of the system.
- get_num_cycles()#
Deprecated
- Returns:
self.scf_cycles (int) – Number of SCF cycles.
- get_opt_convergence_energy()#
Deprecated. Returns the energy for each opt step.
- Returns:
self.opt_energy (array) – Energy for each optimization step.
- get_opt_convergence(primitive=False, scf_history=False, write_gui=False, gui_name=None, symmetry='pymatgen', **kwargs)#
Returns optimisation convergence. A wrapper of
CRYSTALClear.base.OptBASE.read_convergence
.- Parameters:
primitive (bool) – Restore the primitive cell (multiply by the cell transform matrix inversed)
scf_history (bool) – Read SCF history of each optimisation step. Keyword “ONELOG” is needed. Please refer to
self.get_scf_convergence(all_cycles=True)
method.write_gui (bool) – If True, write .gui file of each step
gui_name (str) – Valid only if
write_gui = True
. Gui file is named as “gui_name-optxxx.gui”. If “None”, use “basename-optxxx.gui”. The basename is the same as output.symmetry (str) – Valid only if
write_gui = True
. “pymatgen” to use symmetry info from a pymatgen SpacegroupAnalyzer; “initial” to use symmetry information on output file. If “None”, no symmetry. Otherwise it is taken from the existing gui file.**kwargs – Valid only if
write_gui = True
andsymmetry = 'pymatgen'
. Passed to Pymatgen SpacegroupAnalyzer object.
- Returns:
self (Crystal_output) – New attributes listed below
self.opt_cycles (int) – Number of cycles.
self.opt_status (str) – “terminated”, “converged”, “failed” and
“unknown”
self.opt_energy (array) – Total energy convergence. Unit: eV
self.opt_deltae (array) – Total energy difference. Unit: eV
self.opt_geometry (list) – Pymatgen structure at each step.
self.opt_maxgrad (array) – Maximum gradient convergence. Unit: Hartree/Bohr
self.opt_rmsgrad (array) – RMS gradient convergence. Unit: Hartree/Bohr
self.opt_maxdisp (array) – Maximum displacement convergence. Unit: Bohr
self.opt_rmsdisp (array) – RMS displacement convergence. Unit: Bohr
- get_forces(initial=True, grad=False)#
Read forces.
- Parameters:
initial (bool) – Return forces from the initial calculation. If
initial=False
, return to the last forces, which is valid only for geometry optimizations and the keyword “ONELOG” is needed in .d12 file.grad (bool) – Return gradient convergence history. For optimizations only.
- Returns:
self (Crystal_output) – New attributes listed below
self.forces_atoms (array) – natom*3 array. Atomic forces. Unit: Hartree/Bohr
self.forces_cell (array) – 3*3 array. Cell forces, 3D only. Unit: Hartree/Bohr
self.opt_maxgrad (array) – Maximum gradient convergence. Unit: Hartree/Bohr
self.opt_rmsgrad (array) – RMS gradient convergence. Unit: Hartree/Bohr
- get_phonon(read_eigvt=False, rm_imaginary=True, rm_overlap=True, imaginary_tol=-0.0001, q_overlap_tol=0.0001, eigvt_amplitude=1.0)#
Read phonon-related properties from output file.
- Parameters:
read_eigvt (bool) – Whether to read phonon eigenvectors and normalize it to 1.
rm_imaginary (bool) – Remove the modes with negative frequencies and set all the related properties to NaN.
rm_overlap (bool) – For dispersion calculations Remove repeated q points and recalculate their weights.
imaginary_tol (float) – Valid only if
rm_imaginary = True
. The threshold of negative frequencies.q_overlap_tol (float) – Valid only if
rm_overlap = True
. The threshold of overlapping points, defined as the 2nd norm of the difference of fractional q vectorseigvt_amplitude (float | str) – Valid if
read_eigvt = True
. Amplitude of normalization, or “classical”, “classical-rev”, classical amplitude and revmove classical amplitude.
Note
In QHA calculations, the “q point” dimension refer to harmonic phonons computed. In other cases it refers to points in reciprocal space.
- Returns:
self (Crystal_output) – New attributes listed below
self.edft (array[float]) – \(E_{0}\) Energy with empirical correction. Unit: kJ/mol.
self.nqpoint (int) – Number of q points
self.qpoint (list[list[array[float], float]]) – A nqpoint*1 list of 2*1 list whose first element is a 3*1 array of fractional coordinates and the second is its weight.
self.nmode (array[int]) – Number of modes at q point. nqpoint*1 array.
self.frequency (array[float]) – nqpoint*nmode array ofvibrational frequency. Unit: THz
self.intens (array[float]) – nqpoint*nmode array of harmonic intensiy. Unit: km/mol
self.IR (array[bool]) – nqpoint*nmode array of boolean values specifying whether the mode is IR active
self.Raman (array[bool]) – nqpoint*nmode array of boolean values specifying whether the mode is Raman active
self.eigenvector (array[complex]) – Valid if
read_eigvt = True
. nqpoint*nmode*natom*3 array of eigenvectors. Normalized to 1.
- get_q_info()#
Deprecated.
- get_mode()#
Deprecated.
- get_phonon_eigenvector()#
Deprecated.
- get_IR()#
Extract harmonic IR spectrum from CRYSTAL output.
- Returns:
self.IR_HO_0K (np.array) – 2D array containing harmonic IR frequency and intensities computed at 0 K.
- get_Raman()#
Extract harmonic Raman spectrum from CRYSTAL output.
- Returns:
self (Crystal_output) – New attributes listed below.
self.Ram_HO_0K_tot (np.array) – 2D array containing harmonic Raman frequency and intensities (total) computed at 0 K.
self.Ram_HO_0K_par (np.array) – 2D array containing harmonic Raman frequency and intensities (parallel) computed at 0 K.
self.Ram_HO_0K_per (np.array) – 2D array containing harmonic Raman frequency and intensities (perpendicular) computed at 0 K.
self.Ram_HO_0K_comp_xx (np.array) – 2D array containing harmonic Raman frequency and intensities (xx component) computed at 0 K.
Note
Please, note that for the sake of brevity, only the xx component attributes have been listed here, but the yy, zz, xy, xz, yz components are available as well.
- get_anh_const()#
Extract anharmonic terms of the PES (ANHAPES).
- Returns:
self (Crystal_output) – New attributes listed below.
self.PES_single (np.array) – 2D array containing single-mode anharmonic force constants (col 1: mode; cols 2-3: cubic and quartic single-mode terms of the PES, respectively).
self.PES_couple (np.array) – 2D array contaning anharmonic force constants coupling two phonon modes (col 1: mode I; col 2: mode J; cols 3-7: two-mode anharmonic force constants of type IIJ, IJJ, IIIJ, IJJJ and IIJJ, respectively.)
self.PES_triplet (np.array) – 2D array contaning anharmonic force constant coupling three phonon modes (col 1: mode I; col 2: mode J; col 3: mode K; cols 4-7: three-mode anharmonic force constants of type IJK, IIJK, IJJK and IJKK, respectively)
- get_anh_spectra()#
Extract anharmonic (VSCF and VCI) IR and Raman spectra (in development).
- Returns:
self (Crystal_output) – New attributes listed below.
self.IR_HO_0K (np.array) – 2D array containing harmonic IR frequency and intensities computed at 0 K.
self.IR_HO_T (np.array) – 2D array containing harmonic IR frequency and intensities computed at temperature T.
self.IR_VSCF_0K (np.array) – 2D array containing VSCF IR frequency and intensities computed at 0 K.
self.IR_VSCF_T (np.array) – 2D array containing VSCF IR frequency and intensities computed at temperature T.
self.IR_VCI_0K (np.array) – 2D array containing VCI IR frequency and intensities computed at 0 K.
self.IR_VCI_T (np.array) – 2D array containing VCI IR frequency and intensities computed at temperature T.
self.Ram_HO_0K_tot (np.array) – 2D array containing harmonic Raman frequency and intensities (total) computed at 0 K.
self.Ram_HO_0K_per (np.array) – 2D array containing harmonic Raman frequency and intensities (perpendicular component ) computed at temperature 0 K.
self.Ram_HO_0K_par (np.array) – 2D array containing harmonic Raman frequency and intensities (parallel component ) computed at temperature 0 K.
self.Ram_HO_T_tot (np.array) – 2D array containing harmonic Raman frequency and intensities (total) computed at temperature T.
self.Ram_HO_T_per (np.array) – 2D array containing harmonic Raman frequency and intensities (perpendicular component ) computed at temperature T.
self.Ram_HO_T_par (np.array) – 2D array containing harmonic Raman frequency and intensities (parallel component ) computed at temperature T.
self.Ram_VSCF_0K_tot (np.array) – 2D array containing VSCF Raman frequency and intensities (total) computed at 0 K. self.Ram_VSCF_0K_per (array[float]): 2D numpy array containing VSCF Raman frequency and intensities (perpendicular component) computed at 0 K.
self.Ram_VSCF_0K_par (np.array) – 2D array containing VSCF Raman frequency and intensities (parallel component) computed at 0 K.
self.Ram_VSCF_T_tot (np.array) – 2D array containing VSCF Raman frequency and intensities (total) computed at temperature T. self.Ram_VSCF_T_per (array[float]): 2D numpy array containing VSCF Raman frequency and intensities (perpendicular component) computed at temperature T.
self.Ram_VSCF_T_par (np.array) – 2D array containing VSCF Raman frequency and intensities (parallel component) computed at temperature T.
self.Ram_VCI_0K_tot (np.array) – 2D array containing VCI Raman frequency and intensities (total) computed at 0 K.
self.Ram_VCI_0K_per (np.array) – 2D array containing VCI Raman frequency and intensities (perpendicular component) computed at 0 K.
self.Ram_VCI_0K_par (np.array) – 2D array containing VCI Raman frequency and intensities (parallel component) computed at 0 K.
self.Ram_VCI_T_tot (np.array) – 2D array containing VCI Raman frequency and intensities (total) computed at temperature T.
self.Ram_VCI_T_per (np.array) – 2D array containing VCI Raman frequency and intensities (perpendicular component) computed at temperature T.
self.Ram_VCI_T_par (np.array) – 2D array containing VCI Raman frequency and intensities (parallel component) computed at temperature T.
self.Ram_HO_0K_comp_xx (np.array) – 2D array containing harmonic Raman frequency and intensities (xx component) computed at 0 K.
self.Ram_HO_T_comp_xx (np.array) – 2D array containing harmonic Raman frequency and intensities (xx component) computed at temperature T.
self.Ram_VSCF_0K_comp_xx (np.array) – 2D array containing VSCF Raman frequency and intensities (xx component) computed at 0 K.
self.Ram_VSCF_T_comp_xx (np.array) – 2D array containing VSCF Raman frequency and intensities (xx component) computed at temperature T.
self.Ram_VCI_0K_comp_xx (np.array) – 2D array containing VCI Raman frequency and intensities (xx component) computed at 0 K.
self.Ram_VCI_T_comp_xx (np.array) – 2D array containing VCI Raman frequency and intensities (xx component) computed at temperature T.
Note
Please, note that for the sake of brevity, only the xx Raman component attributes have been listed here, but the yy, zz, xy, xz, yz components are available as well.
- get_anscan(anscanwf)#
Work in progress for ANSCAN stuff (in development).
- get_elatensor()#
Extracts the elastic tensor from CRYSTAL output.
- Returns:
self.elatensor (np.array) – Symmetrized 6x6 elastic tensor.
- get_EOS()#
Extracts the Equation of state output data and corresponding fittings
- Returns:
self (Crystal_output) – New attributes listed below.
self.VvsE (np.array) – numpy array containing the computed volumes and the corresponding energies in the first and second column respectively
self.murnaghan (np.array) – numpy array containing the fitted thermodynamics functions with the Murnaghan Equation
self.bmurnaghan (np.array) – numpy array containing the fitted thermodynamics functions with the Birch-Murnaghan Equation
self.pt (np.array) – numpy array containing the fitted thermodynamics functions with the Poirier-Tarantola Equation
self.vinet (np.array) – numpy array containing the fitted thermodynamics functions with the Vinet Equation
- class Properties_input(input_name=None)#
Bases:
object
Create a properties_input object
- from_file(input_name)#
Read the properties input from a file.
- Parameters:
input_name (str) – Name of the input file.
- Returns:
self (Properties_input) – Properties_input object.
- make_newk_block(shrink1, shrink2, Fermi=1, print_option=0)#
Returns the newk block.
- Parameters:
shrink1 (int) – First newk shrinking factor.
shrink2 (int) – Second newk shrinking factor.
Fermi (int) – Fermi recalculation option (default is 1).
print_option (int) – Properties printing option (default is 0).
- make_bands_block(k_path, n_kpoints, first_band, last_band, print_eig=0, print_option=1, precision=5, title='BAND STRUCTURE CALCULATION')#
Returns the bands block for a bands calculation.
- Parameters:
k_path (list or HighSymmKpath) – k-path for bands calculation.
n_kpoints (int) – Number of k-points along the path.
first_band (int) – Index of the first band.
last_band (int) – Index of the last band.
print_eig (int) – Printing options for eigenvalues (default is 0).
print_option (int) – Properties printing options (default is 1).
precision (int) – Number of zeros in the calculation of the gcd
title (str) – Title of the calculation (default is “BAND STRUCTURE CALCULATION”).
- make_doss_block(n_points=200, band_range=None, e_range=None, plotting_option=2, poly=12, print_option=1)#
Returns the doss block for a doss calculation.
- Parameters:
n_points (int) – Number of points in the DOS plot (default is 200).
band_range (list or tuple) – Range of bands to include in the DOS calculation (default is None).
e_range (list or tuple) – Energy range for the DOS calculation (default is None).
plotting_option (int) – DOS plotting options (default is 2).
poly (int) – Degree of the polynomial for smearing (default is 12).
print_option (int) – Properties printing options (default is 1).
- make_pdoss_block(projections, proj_type='atom', output_file=None, n_points=200, band_range=None, e_range=None, plotting_option=2, poly=12, print_option=1)#
Returns the pdoss block for a pdoss calculation.
- Parameters:
projections (dict) – Dictionary specifying the projections for the pdoss calculation.
proj_type (str) – Type of projection (“atom” or “site”, default is “atom”).
output_file (str) – Output file name (default is None).
n_points (int) – Number of points in the DOS plot (default is 200).
band_range (list or tuple) – Range of bands to include in the DOS calculation (default is None).
e_range (list or tuple) – Energy range for the DOS calculation (default is None).
plotting_option (int) – DOS plotting options (default is 2).
poly (int) – Degree of the polynomial for smearing (default is 12).
print_option (int) – Properties printing options (default is 1).
- write_properties_input(input_name)#
Writes the properties input to a file.
- Parameters:
input_name (str) – Name of the output file.
- class Properties_output#
Bases:
object
Creates a Properties_output object.
- read_file(properties_output)#
Parse the properties output file.
- Parameters:
properties_output (str) – Properties output file.
- Returns:
Properties_output – Updated Properties_output object.
- read_electron_band(band_file, output=None)#
Generate bands object from CRYSTAL BAND.DAT or fort.25 file. Energy unit: eV. E Fermi is aligned to 0.
- Parameters:
band_file (str) – Name of BAND.DAT or fort.25 file
output (str) – Properties output file (.outp or .out). For 3D, k coordinates and geometry information.
- Returns:
self.bands (BandsBASE) – A Bands base object
- read_electron_dos(properties_output)#
Generate doss object from CRYSTAL DOSS.DAT or fort.25 file. Energy unit: eV. E Fermi is aligned to 0.
- Parameters:
properties_output (str) – File name
- Returns:
self.doss (DOSBASE) – A DOS base object
- read_cry_bands(properties_output)#
Deprecated.
- read_cry_doss(properties_output)#
Deprecated.
- read_cry_contour(properties_output)#
- Read the CRYSTAL contour files (SURFRHOO, SURFLAPP, SURFLAPM, SURFGRHO,
SURFELFB, SURFVIRI, SURFGKIN, SURFKKIN) to create the contour objects.
- Parameters:
properties_output (str) – Properties output file.
- Returns:
Properties_output – Updated Properties_output object.
- read_cry_xrd_spec(properties_output)#
Read XRD spectrum data from a file.
- Parameters:
properties_output (str) – Path to the properties output file.
- Returns:
self – The modified object with extracted XRD spectrum data.
- read_cry_rholine(properties_output)#
Read density line data from a file.
- Parameters:
properties_output (str) – Path to the properties output file.
- Returns:
self – Modified object with extracted density line data.
- read_cry_seebeck(properties_output)#
Read Seebeck coefficient data from a file.
- Parameters:
properties_output (str) – Path to the properties output file.
- Returns:
self – Modified object with extracted Seebeck coefficient data.
- read_cry_sigma(properties_output)#
Read electrical conductivity data from a file.
- Parameters:
properties_output (str) – Path to the properties output file.
- Returns:
self – Modified object with extracted electrical conductivity data.
- read_cry_lapl_profile(properties_output)#
Read Laplacian profile data from a file.
- Parameters:
properties_output (str) – Path to the properties output file.
- Returns:
self – Modified object with extracted Laplacian profile data.
- read_cry_density_profile(properties_output)#
Read density profile data from a file.
- Parameters:
properties_output (str) – Path to the properties output file.
- Returns:
self – Modified object with extracted density profile data.
- read_vecfield(properties_output, which_prop)#
Reads the fort.25 file to return data arrays containing one or more vectiorial density properties.
- Parameters:
properties_output (str) – Properties output file.
which_prop (str) – Density property selected by the user: “m” (magnetization), “j” (spin current), “J” (spin current density)
- Returns:
Properties_output (str) – fort.25 output file.
- read_cry_ECHG(properties_output)#
Read density profile data from a file.
- Parameters:
properties_output (str) – Path to the fort.25 file.
- Returns:
self – Modified object with extracted ECHG data.
- read_cry_ECHG_delta(properties_output1, properties_output2)#
Read density profile data from two files and plots the difference. It is important that the header stays the same for the two output files.
- Parameters:
properties_output1 (str) – Path to first fort.25 file.
properties_output2 (str) – Path to second fort.25 file.
- Returns:
self – Modified object with extracted ECHG data.
- read_topond_trho(properties_output)#
- Read the TOPOND TRHO run output file to create associated DataFrames:
Coordinates for the nuclei at the unitcell (nuclei_df)
Data of the critical points (CP) discoverd (topo_df)
- Parameters:
properties_output (str) – Properties output file.
- Returns:
Properties_output – Updated Properties_output object.
- topond_viz_file(cp_type='ALL', add_atoms=False, file_type='xyz')#
Given the existence of TOPOND TRHO DataFrames, write files with the critical points (CP) coordinates for further visualization.
- Parameters:
cp_type (str) –
Generate file for a given type CP. Options: “ALL” to include all CP in the system,
”BCP” for Bond CPs, “RCP” for Ring CPs, “CCP” for Cage CPs, “NNA” for Nuclear/Non-Nuclear Atractors.
add_atoms (bool) – Include the Nuclei atoms read from the TOPOND output in the same file.
file_type (str) – Type of output file to be generated.
- Returns:
ase_obj – ASE object.
- read_topond_tlap(properties_output)#
- Read the TOPOND TLAP run output file to create associated DataFrames:
Coordinates for the nuclei at the unitcell (nuclei_df)
Data of the laplacian critical points (CP) discoverd (tlap_df)
- Parameters:
properties_output (str) – Properties output file.
- Returns:
Properties_output – Updated Properties_output object.
- topond_viz_tlap_file(cp_type='+3', add_atoms=False, file_type='xyz')#
Given the existence of TOPOND TLAP DataFrames, write files with the critical points (CP) coordinates for further visualization.
- Parameters:
cp_type (str) –
Generate file for a given type CP. Options: ‘ALL’ to include all CP in the system,
’+3’ for CPs with +3 signature, ‘+1’ for CPs with +1 signature, ‘-1’ for CPs with -1 signature, ‘+1’ for CPs with -3 signature.
add_atoms (bool) – Include the Nuclei atoms read from the TOPOND output in the same file.
file_type (str) – Type of output file to be generated.
- Returns:
ase_obj – The generated ASE object.
- class Crystal_gui#
Bases:
object
This class can read a CRYSTAL gui file into an object or substrate information of the object to generate a gui file.
- read_gui(gui_file)#
This is used mainly to convert the object into an ASE or pymatgen object.
- Parameters:
gui_file (str) – CRYSTAL structure (gui) file
- write_gui(gui_file, symm=True, pseudo_atoms=[])#
Write a CRYSTAL gui file (to file)
- Parameters:
gui_file (str) – Name of the gui that is going to be written (including .gui).
symm (bool) – Whether to include symmetry operations (default is True).
pseudo_atoms (list[int]) – A list of atoms whose core is described by a pseudopotential
- class Crystal_density#
Bases:
object
Read density data from a .f98 file.
- read_cry_irr_density(fort98_unit)#
Read density profile data from a CRYSTAL .f98 file. :param fort98_unit: File containing the formatted density matrix. :type fort98_unit: str
- Returns:
None
Note: This is a work in progress. If you are interested in this functionality, please open an Issue on GitHub.
- cry_combine_density(density1, density2, density3, new_density='new_density.f98', spin_pol=False)#
Combine density matrix files.
- Parameters:
density1 (str) – First density matrix file.
density2 (str) – Second density matrix file.
density3 (str) – Density matrix file for the whole system.
new_density (str, optional) – Name of the new density matrix (default is “new_density.f98”).
spin_pol (bool, optional) – Specifies if the system is spin polarized (default is False).
- Returns:
None
Note
This is a work in progress. If you are interested in this functionality, please open an Issue on GitHub.
- write_cry_density(fort98_name, new_p, new_fort98)#
Write the formatted density matrix.
- Parameters:
fort98_name (str) – Name of the previous density matrix file.
new_p (list) – New density matrix.
new_fort98 (str) – Name of the new density matrix file.
Returns
None
Note
This is a work in progress. If you are interested in this functionality, please open an Issue on GitHub.
- class External_unit#
Bases:
object
- read_external_unit(external_unit)#
- read_cry_irspec(external_unit)#
Reads the IRSPEC.DAT unit produced by CRYSTAL (IRSPEC keyword).
- Parameters:
external_unit (str) – Path of the IRSPEC.DAT file.
- Returns:
self – Modified object to be read by plot_cry_irspec().
- read_cry_ramspec(external_unit)#
Reads the RAMSPEC.DAT unit produced by CRYSTAL (RAMSPEC keyword).
- Parameters:
external_unit (str) – Path of the RAMSPEC.DAT file.
- Returns:
self – Modified object to be read by plot_cry_ramspec().
- read_phonon_band(band_file, output=None)#
Generate bands object from CRYSTAL PHONBAND.DAT or fort.25 file. Energy unit: eV. E Fermi is aligned to 0.
- Parameters:
band_file (str) – Name of PHONBAND.DAT or fort.25 file
output (str) – Properties output file (.outp or .out). For 3D, k coordinates and geometry information.
- Returns:
self.bands (BandsBASE) – A Bands base object.
- read_phonon_dos(external_unit)#
Generate doss object from CRYSTAL PHONONDOSS.DAT or fort.25 file. Energy unit: eV. E Fermi is aligned to 0.
- Parameters:
properties_output (str) – File name.
- Returns:
self.doss (DOSBASE) – A DOS base object.