QM Toolchain and Hyperpolarizability Notes
Date: 2026-03-11
Workspace: /path/to/DELFIN

Installed local tool entry points
- /path/to/DELFIN/delfin/qm_tools/bin/xtb
- /path/to/DELFIN/delfin/qm_tools/bin/crest
- /path/to/DELFIN/delfin/qm_tools/bin/std2
- /path/to/DELFIN/delfin/qm_tools/bin/stda
- /path/to/DELFIN/delfin/qm_tools/bin/xtb4stda
- /path/to/DELFIN/delfin/qm_tools/bin/dftb+

Activation
- source /path/to/DELFIN/delfin/qm_tools/env.sh

Verified versions / provenance
- xtb: 6.7.1
- crest: 3.0.2
- orca: 6.1.1
- std2: 2.0
- stda: 1.6.1 official binary from grimme-lab/xtb4stda release v1.0
- xtb4stda: 1.0 official binary from grimme-lab/xtb4stda release v1.0
- dftb+: development version from local micromamba env

What the paper 024108_1_online.pdf actually uses
- Paper:
  M. de Wergifosse and S. Grimme,
  "Nonlinear-response properties in a simplified time-dependent density functional theory (sTD-DFT) framework:
  Evaluation of the first hyperpolarizability",
  J. Chem. Phys. 149, 024108 (2018),
  DOI: 10.1063/1.5037665
- Core method:
  sTD-DFT nonlinear response for SHG first hyperpolarizability beta(-2w; w, w)
- Ultra-fast variant:
  sTD-DFT-xTB
- The paper states explicitly that the linear and quadratic responses are implemented in the sTDA program.
- The paper also states that the xTB-coupled variant is used for very large systems.
- Reference TD-DFT values in the paper were computed with GAMESS.
- The paper discusses TURBOMOLE as another implementation reference, but that is not required for our practical workflow.

Practical consequence for this server
- For fast beta / beta_HRS screening, the relevant tools are:
  - xtb4stda
  - stda
  - std2
- For geometry preparation and cheap conformer handling:
  - xtb
  - crest
- For higher-level validation and general QM workflows:
  - ORCA can still be used, but it is intentionally not bundled inside qm_tools
- DFTB+ is available for additional tight-binding experiments, but it is not the main route used in the paper.

Important note about std2 vs stda
- std2 is the modern successor of stda.
- The installed std2 binary contains nonlinear-response strings such as:
  - "beta_HRS"
  - "SHG first hyperpolarizability"
  - "Welcome in nonlinear response sTD-DFT program"
- Therefore std2 is relevant for current work, while stda is kept because the 2018 paper explicitly refers to the sTDA program and xtb4stda release bundles a working historical binary.

Recommended workflow for hyperpolarizability in this workspace

Stage 1: Geometry
- Optimize a structure with xtb or ORCA.
- For larger flexible molecules, sample conformers with crest first.

Stage 2: Fast beta screening
- Run xtb4stda on the final xyz structure to prepare the xTB-based input data.
- Run stda or std2 in nonlinear-response mode to evaluate SHG beta and beta_HRS.
- Use this as the cheap prescreen for many candidates.

Stage 3: Focused validation
- Recompute only a shortlist with a higher-level DFT / TD-DFT workflow in ORCA.
- This is for relative confirmation, not because ORCA reproduces the exact sTD-DFT paper workflow one-to-one.

What is installed vs not installed
- Installed and ready:
  - xtb
  - crest
  - std2
  - stda
  - xtb4stda
  - dftb+
- Not installed:
  - GAMESS
  - TURBOMOLE
  - ORCA
- Reason:
  - they are not required for the practical fast-screening workflow we want to build here
  - the paper uses GAMESS for reference TD-DFT comparisons, not as the screening engine

Minimal command pattern
- source /path/to/DELFIN/delfin/qm_tools/env.sh
- xtb molecule.xyz --opt
- xtb4stda xtbopt.xyz
- prepare an stda/std2 input file for nonlinear response / SHG beta
- run stda or std2 with that input file

Files to expect from the sTDA-xTB path
- xtb4stda typically prepares the ground-state data needed by stda/std2
- stda/std2 then read those files and compute excited-state / response properties

Next recommended engineering step
- Build a tiny DELFIN-side wrapper that:
  - takes xyz or smiles-derived xyz
  - runs xtb or crest if needed
  - runs xtb4stda
  - runs std2/stda
  - parses beta_HRS and related outputs into a machine-readable score file

Current DELFIN CLI
- A direct workflow is now available through:
  - delfin hyperpol_xtb
  - alias: delfin hyperpol
- Example from SMILES:
  - delfin hyperpol_xtb --smiles 'c1ccccc1' --label benzene --engine std2 --preopt xtb --wavelength 1064 --energy-window 15
- Example from XYZ:
  - delfin hyperpol_xtb --xyz-file /path/to/mol.xyz --engine std2 --preopt none --wavelength 1064
- The std2/stda -resp call automatically emits the static response (infinity) in addition to each requested wavelength.

Source references
- Paper local copy:
  /path/to/024108_1_online.pdf
- std2 release series:
  https://github.com/grimme-lab/std2/releases
- xtb4stda release with binaries:
  https://github.com/grimme-lab/xtb4stda/releases/tag/v1.0
