Metadata-Version: 2.4
Name: xtb_step
Version: 2026.11.26
Summary: A SEAMM plug-in for xTB
Home-page: https://github.com/molssi-seamm/xtb_step
Author: Paul Saxe
Author-email: psaxe@molssi.org
License: BSD-3-Clause
Keywords: SEAMM,SEAMMplugin,flowchart
Platform: Linux
Platform: Mac OS-X
Platform: Unix
Platform: Windows
Classifier: Environment :: Plugins
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: AUTHORS.rst
Requires-Dist: seamm
Requires-Dist: seamm-util
Requires-Dist: seamm-widgets
Requires-Dist: tabulate
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: platform
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

=================
SEAMM xTB Plug-in
=================

.. image:: https://img.shields.io/github/issues-pr-raw/molssi-seamm/xtb_step
   :target: https://github.com/molssi-seamm/xtb_step/pulls
   :alt: GitHub pull requests

.. image:: https://github.com/molssi-seamm/xtb_step/workflows/CI/badge.svg
   :target: https://github.com/molssi-seamm/xtb_step/actions
   :alt: Build Status

.. image:: https://codecov.io/gh/molssi-seamm/xtb_step/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/molssi-seamm/xtb_step
   :alt: Code Coverage

.. image:: https://github.com/molssi-seamm/xtb_step/workflows/CodeQL/badge.svg
   :target: https://github.com/molssi-seamm/xtb_step/security/code-scanning
   :alt: Code Quality

.. image:: https://github.com/molssi-seamm/xtb_step/workflows/Release/badge.svg
   :target: https://molssi-seamm.github.io/xtb_step/index.html
   :alt: Documentation Status

.. image:: https://img.shields.io/pypi/v/xtb_step.svg
   :target: https://pypi.python.org/pypi/xtb_step
   :alt: PyPi VERSION

A SEAMM plug-in for the `xTB <https://github.com/grimme-lab/xtb>`_ family
of extended tight-binding methods from the Grimme group.

* Free software: BSD-3-Clause
* Documentation: https://molssi-seamm.github.io/xtb_step/index.html
* Code: https://github.com/molssi-seamm/xtb_step

Features
--------

* Single-point energies, geometry optimizations, and harmonic
  vibrational frequencies for molecular (non-periodic) systems.
* The full set of xTB Hamiltonians and the GFN-FF force field:

  - **GFN2-xTB** (default) -- self-consistent, multipole electrostatics,
    density-dependent dispersion. Recommended for general use.
  - **GFN1-xTB** -- earlier self-consistent method.
  - **GFN0-xTB** -- non-self-consistent, useful for robust screening.
  - **GFN-FF** -- generic force field, automatically parameterized.

* Implicit solvation with all three xTB-supported models:

  - **ALPB** -- analytical linearized Poisson-Boltzmann
    (Ehlert et al., *J. Chem. Theory Comput.* **2021**, *17*, 4250).
  - **GBSA** -- generalized-Born model.
  - **CPCM-X** -- conductor-like polarizable continuum
    (Stahn et al., *J. Phys. Chem. A* **2023**, *127*, 7036).

  with the standard xTB solvent list (water, methanol, DMSO,
  acetonitrile, etc.).

* Net charge and spin multiplicity are read from the configuration,
  so the same flowchart works unchanged across O\ :sub:`2`,
  triplet O\ :sub:`2`, and O\ :sub:`2`\ :sup:`+` -- a single loop
  can scan a list of systems with different charge/spin states.

* Optimization with all eight xTB convergence levels (crude through
  extreme) and flexible structure handling: overwrite the current
  configuration in place, store the optimized structure as a new
  configuration, store it in a new system, or discard.

* Vibrational analysis using xTB's analytic Hessian, with the
  optimize-then-Hessian (``--ohess``) workflow recommended by xTB
  (or ``--hess`` alone if the geometry is already at a stationary
  point). Thermochemistry quantities (ZPE, H(T), T*S, S, G(T),
  total free energy) are reported in chemist-friendly units of
  kJ/mol and J/mol/K, not E\ :sub:`h`.

* Tabulated results in the local ``step.out`` and storage in the
  SEAMM property database using the standard ``<name>#xTB#{model}``
  property-naming convention, so downstream plug-ins
  (Thermochemistry, Reaction Path, ...) can pick up the values.

* Automatic citation tracking. The principal xTB program reference,
  the active GFN method reference, the DFT-D4 dispersion references
  (for GFN2-xTB), and the implicit-solvation reference are all added
  to the run's reference list automatically.

* Automatic installation of the xtb executable into a dedicated
  ``seamm-xtb`` conda environment, and of tblite (for the MDI engine) into
  ``seamm-tblite``, via the standard SEAMM Installer.

Acknowledgements
----------------

This package was created with the `molssi-seamm/cookiecutter-seamm-plugin`_ tool, which
is based on the excellent Cookiecutter_.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`molssi-seamm/cookiecutter-seamm-plugin`: https://github.com/molssi-seamm/cookiecutter-seamm-plugin

Developed by the Molecular Sciences Software Institute (MolSSI_),
which receives funding from the `National Science Foundation`_ under
award CHE-2136142.

.. _MolSSI: https://molssi.org
.. _`National Science Foundation`: https://www.nsf.gov


=======
History
=======

2026.11.26 -- Bugfix: the tblite MDI engine ignored SEAMM's conda wrapper
    * The engine was launched with the conda named in xtb.ini, while SEAMM's local
      executor prefers CONDA_EXE. On clusters CONDA_EXE is SEAMM's wrapper that unpacks
      an environment kept as an archive onto the node, so an archive-only seamm-tblite
      could not start ("MDI engine exited (return code 1) before connecting"; ARC,
      SEAMM job 6088). The engine now uses the same conda as the executor: CONDA_EXE,
      else the ini's, and a prefix (-p) for an environment given as a path.

2026.11.21.1 -- Bugfix: the installer bypassed SEAMM's environment policies
    * 2026.11.21's installer made the two conda environments itself, which skipped the
      installation's policies: shared or prefixed code environments, environments kept
      as archives (as on clusters with slow shared file systems), and the guard against
      replacing an environment SEAMM did not make. It now leaves ``seamm-xtb`` to the
      standard installer and makes ``seamm-tblite`` the same way, as a directory or an
      archive as the installation keeps them. A ``seamm-xtb`` directory that still holds
      tblite from before 2026.11.21 is removed first, so it is made again from the new
      environment file.

2026.11.21 -- Bugfix: xTB optimisations crashed, and failures went unnoticed
    * Geometry optimisations failed after the first cycle with the conda-forge
      environment as it now resolves: xtb 6.4.1, which the tblite 0.5.0 pin forced
      into the environment, stops with "Fortran runtime error: Missing comma between
      descriptors" under the gfortran 16 runtime. The xtb executable now has its own
      environment, ``seamm-xtb``, with xtb 6.7.1, and the tblite MDI engine has
      ``seamm-tblite`` with tblite 0.5.0 (tblite 0.6 with dftd4 4.2 still crashes
      for GFN2). Updating the plug-in's installation recreates ``seamm-xtb`` and
      creates ``seamm-tblite``, and records it as ``tblite-environment`` in xtb.ini;
      until then the engine keeps using ``conda-environment``.
    * When xtb fails -- a non-zero exit, no ``xtbout.json``, or no energy -- the step
      now stops with an error naming the directory and quoting the end of xtb's error
      output. Before, it printed "No results were collected" and carried on, so a Loop
      of failed calculations finished with no errors counted.

2026.11.11 -- Settings fingerprints for xTB's model-chemistry calculations
    * Calculations through an xTB **Model Chemistry** (e.g. ``xTB:SQM@GFN2-xTB``) now
      carry a fingerprint of their settings -- the program and its version, the method
      and the accuracy -- like the other codes' calculations. Steps that reuse results,
      such as **Thermochemistry** with its fragment store, can then tell which stored
      xTB results match the calculation they need.
    * Needs seamm-mdi 2026.11.11 or later for the fingerprints; with an older
      seamm-mdi, xTB calculations work as before, without them.

2026.11.5 -- Tight convergence on request for finite differences
    * Steps that take finite differences of xTB's gradients over its MDI engine, such
      as the new Vibrational Analysis step, can now ask for tight convergence: every
      calculation then runs at accuracy 1e-4. The engine starts each SCF from the
      previous structure's, and at the default accuracy that left noise depending on
      the previous structure (water's anharmonic force constants: 92 cm^-1 of noise,
      0.12 with the tighter accuracy).
    * The MDI engine takes an ``--accuracy`` option.

2026.10.20 -- Bugfix: an SCF that did not converge ended the MDI engine
    * In the tblite MDI engine (used e.g. by the Dimer Builder), one structure whose
      SCF did not converge ended the engine, and with it the whole step. A failed SCF
      is now retried from a fresh start, then with more iterations and stronger
      damping, then from another starting guess -- none of which changes the
      converged energy. If none converges, the engine returns NaN for that structure
      and carries on, so the step can leave the point out. For Li+ with ethylene
      carbonate the failures were at large separations, 7-9 Å, and the retries
      converged them.


2026.10.9 -- Bugfix: GFN2-xTB through tblite crashed
    * Any GFN2-xTB calculation through tblite (the MDI engine, as used by the Dimer
      Builder) crashed with a segmentation fault: tblite 0.6 and 0.7 need dftd4 4.2,
      and that combination fails in dftd4's polarizabilities. The environment now pins
      tblite-python 0.5.0 (dftd4 3.7), which works; with it the xtb program is 6.4.1.
      GFN1-xTB was not affected.
    * Internal: requires Python 3.12; CI installs with uv from PyPI (no conda test
      environment); the unused Docker installation option was removed.

2026.5.2: Plug-in created using the SEAMM plug-in cookiecutter.

2026.5.12: Initial working version
    * Support for Energy, Optimization, and Frequencies
    * GFN0-xTB, GFN1-xTB, GFN2-xTB (the default), and GFN-FF supported
    * ALPB, GBSA, or CPCM-X implicit solvation
