airsspy.abacustools#
ABACUS output parsing and result composition.
Utilities for parsing ABACUS log files, STRU structure files, and composing result documents compatible with the AIRSS jobflow pipeline.
Supports both ABACUS develop (v3.9.x) and LTS (v3.10.x) versions which differ in log output format for energy and SCF convergence messages.
Module Contents#
Functions#
Parse an ABACUS running log file for key results. |
|
Convert CASTEP .cell content to ABACUS STRU format. |
|
Parse an ABACUS STRU file to extract structure information. |
|
Detect the ABACUS log file path based on calculation type. |
|
Extract quality-affecting computational parameters from ABACUS output. |
|
Build REM block lines for a .res file from ABACUS output. |
|
Extract results from a completed ABACUS calculation. |
Data#
API#
- airsspy.abacustools.logger#
‘getLogger(…)’
- airsspy.abacustools.BOHR_TO_ANG#
0.529177249
- airsspy.abacustools.BOHR3_TO_ANG3#
0.148184743
- airsspy.abacustools.GPA_KBAR_TO_EV_PER_ANG3#
0.006241510219780177
- airsspy.abacustools.parse_abacus_log(logfile: str) dict[source]#
Parse an ABACUS running log file for key results.
Handles format differences between ABACUS develop (v3.9.x) and LTS (v3.10.x).
Args: logfile: Path to the ABACUS log file (e.g. OUT.ABACUS/running_cell-relax.log).
Returns: Dictionary with keys: energy, pressure, volume, converged, scf_converged, n_ionic_steps.
- airsspy.abacustools.cell_to_stru(cell_content: str) str[source]#
Convert CASTEP .cell content to ABACUS STRU format.
Parses the LATTICE_CART, POSITIONS_FRAC, and SPECIES_POT blocks from a .cell file and produces an ABACUS STRU file string.
Args: cell_content: Content of the .cell file.
Returns: STRU file content as a string.
- airsspy.abacustools.parse_abacus_stru(stru_path: str)[source]#
Parse an ABACUS STRU file to extract structure information.
Args: stru_path: Path to the STRU file.
Returns: Tuple of (elements, positions, cell) where: - elements: list of element symbols (str) - positions: numpy array of fractional positions (N x 3) - cell: numpy array of cell vectors in Angstrom (3 x 3)
- airsspy.abacustools.detect_logfile(workdir: str, input_path: str) Optional[str][source]#
Detect the ABACUS log file path based on calculation type.
Args: workdir: Path to the ABACUS working directory. input_path: Path to the INPUT file.
Returns: Path to the log file, or None if not found.
- airsspy.abacustools.extract_abacus_rem(struct_name: str) dict[source]#
Extract quality-affecting computational parameters from ABACUS output.
Reads the ABACUS INPUT file and log file to extract metadata for the REM block of a .res file.
Args: struct_name: Structure name (without extension).
Returns: Dictionary with keys: functional, cutoff, basis_type, kspacing, nkpts, psps, orbital_info.
- airsspy.abacustools.build_abacus_rem_lines(struct_name: str) list[str][source]#
Build REM block lines for a .res file from ABACUS output.
Args: struct_name: Structure name (without extension).
Returns: List of REM line strings (without “REM “ prefix).
- airsspy.abacustools.compose_abacus_task_doc(struct_name: str) dict[source]#
Extract results from a completed ABACUS calculation.
Reads the ABACUS log and STRU_ION_D output, creates an ASE Atoms object, saves a
.resfile, and returns a dictionary suitable for constructing anAirssResultDoc.Args: struct_name: Structure name (without extension).
Returns: Dictionary with energy, structure, volume, formula, etc.