JLmol can run fast semiempirical quantum chemistry calculations on the current structure using xtb with the g-xTB method. This lets you get energies and optimized geometries in seconds — ideal for quick screening, pre-optimizing structures before a high-level ElemCo.jl calculation, or exploring conformations. These calculations run in the desktop app only.
What You Can Do:
- Calculate Energy: runs
xtb <coord.xyz> --gxtb and reports the total energy of the current structure.
- Optimize Geometry: runs
xtb <coord.xyz> --gxtb --opt and replaces the geometry in the viewer with the optimized structure.
- Set calculation parameters: specify the molecular charge, the number of unpaired electrons (
--uhf), and any extra xtb command-line flags.
Constrained Optimization (Freeze Atoms):
- Enable “Relax only selected atoms (freeze the rest)” to optimize just part of a structure.
- When atoms are selected, JLmol writes an xtb
$fix block listing every non-selected atom (passed via --input xtb.inp), so only the selected atoms move while the rest stay fixed.
- This is handy for relaxing an adsorbate on a rigid surface, a fragment within a larger molecule, or a newly added group.
- The option is ignored if no atoms are selected.
Setup & Requirements:
- Download the g-xTB binary directly from grimme-lab/g-xtb. At the moment that is all you need — there is no separate xtb installation or parameter download.
- Extract it to a folder and make sure the
xtb binary in its bin directory is reachable: either add it to your PATH (e.g. create a symbolic link in ~/bin), or simply set the full path to the binary in Settings → xtb.
- The xtb command is configurable in Settings → xtb (just like the Julia command), and supports WSL. To run xtb under WSL, use a login shell so your environment and
PATH are picked up, e.g. wsl --shell-type login xtb.
- JLmol checks that xtb is reachable and shows a clear message if it is not.
Best Practices & Troubleshooting:
- Use g-xTB to pre-optimize a structure, then refine it with a higher-level method via the ElemCo.jl integration.
- If a calculation fails to start, verify the xtb command in Settings — make sure the path to the g-xTB binary is correct or that it is on your
PATH.
- Set the correct charge and number of unpaired electrons for open-shell or charged species.
- The browser version cannot run xtb; install jlmol locally to use this feature.
References: