MolecularDiffusion.runmodes.analyze.xtb_electronic

XTB Electronic Property Computation using xtb-python.

Provides functions to compute electronic properties for XYZ files using the xtb-python interface directly, with support for batch processing and multiple output formats (CSV, JSON, ASE database).

Attributes

Functions

batch_xtb_electronic(→ pandas.DataFrame)

Batch compute XTB electronic properties for XYZ files or ASE DB rows.

compute_xtb_electronic(→ dict[str, Any])

Compute XTB electronic properties for a single XYZ file.

Module Contents

MolecularDiffusion.runmodes.analyze.xtb_electronic.batch_xtb_electronic(input_dir: str, output_path: str | None = None, output_format: str = 'csv', method: int | str = 2, charge: int = 0, n_unpaired: int = 0, solvent: str | None = None, properties: list[str] | None = None, corrected: bool = True, timeout: int = 120, n_jobs: int = 1, auto_charge: bool = False, annotate_db: bool = False) pandas.DataFrame

Batch compute XTB electronic properties for XYZ files or ASE DB rows.

MolecularDiffusion.runmodes.analyze.xtb_electronic.compute_xtb_electronic(xyz_path: str, method: int | str = 2, charge: int = 0, n_unpaired: int = 0, solvent: str | None = None, properties: list[str] | None = None, corrected: bool = True, auto_charge: bool = False) dict[str, Any]

Compute XTB electronic properties for a single XYZ file.

Parameters:
  • xyz_path – Path to XYZ file.

  • method – XTB method (1=GFN1, 2=GFN2, “ptb”=PTB via xtb binary).

  • charge – Molecular charge.

  • n_unpaired – Number of unpaired electrons.

  • solvent – Solvent name for ALPB implicit solvation (e.g. “water”, “thf”).

  • properties – Property groups to compute. Defaults to [“energy”]. Available: energy, dipole, reactivity, global, charges, fukui, bond_orders, all. PTB supports energy/dipole/charges/bond_orders only (no reactivity/global/fukui — PTB gives no total energy).

  • corrected – Kept for API compatibility. Previously applied morfeus empirical IP/EA corrections; now has no effect (raw ΔE values are returned).

  • auto_charge – For PTB only, infer +1/-1 from XYZ chemistry when a neutral singlet request has parity-incompatible electron count.

Returns:

Dictionary with computed properties and metadata.

Notes

IP = E(cation) - E(neutral); EA = E(neutral) - E(anion). Both in eV. Fukui condensed indices use the finite-difference approximation:

f+(k) = q_k(N) - q_k(N+1) [electrophilicity, electron addition] f-(k) = q_k(N-1) - q_k(N) [nucleophilicity, electron removal] f0(k) = (f+ + f-) / 2 dual(k) = f+(k) - f-(k)

Global descriptors follow Parr/Mayr-Ofial DFT reactivity theory.

MolecularDiffusion.runmodes.analyze.xtb_electronic.ANGSTROM_TO_BOHR = 1.8897259886
MolecularDiffusion.runmodes.analyze.xtb_electronic.ATOMIC_LEVEL_GROUPS
MolecularDiffusion.runmodes.analyze.xtb_electronic.BOHR_DEBYE = 2.5417464519
MolecularDiffusion.runmodes.analyze.xtb_electronic.HARTREE_TO_EV = 27.211386245988
MolecularDiffusion.runmodes.analyze.xtb_electronic.MOLECULAR_LEVEL_GROUPS
MolecularDiffusion.runmodes.analyze.xtb_electronic.PROPERTY_GROUPS
MolecularDiffusion.runmodes.analyze.xtb_electronic.logger