Spectra and diffraction
The public plot API accepts arrays or saved calculation result mappings. Plotting a saved result does not repeat its electronic or response calculation. The examples below preserve the method and geometry conditions in their JSON downloads.
UV–Vis
Section titled “UV–Vis”saved = json.loads(Path("uv-vis.json").read_text())plot.uv_vis(saved["content"])The saved water example has five sTDA/g-xTB states between 12.6 and 16.8 eV at a PBE/def2-SVP relaxed geometry, with Gaussian width 0.15 eV.
All five lie in the vacuum ultraviolet.
Photon energy increases from left to right.
The curve, excited-state sticks, and any reference curves use separate relative scales.
State sticks represent oscillator strengths.
The saved example uses the native algebraic sTDA eigenproblem. Current Python
engines also expose this through XTB.get_excitations(atoms, nstates=...).
Excitation analysis and natural transition orbitals
Section titled “Excitation analysis and natural transition orbitals”from atomli.analysis import excitation_analysisfrom atomli.calculators import XTB
# water is the relaxed PBE geometry used for the comparison above.water.calc = XTB(method="gxtb", device="cpu")excited = excitation_analysis(water, nstates=5, compute_ntos=True)state = excited.states[0]print(state.energy_ev, state.oscillator_strength)nto = state.ntoif nto is not None: print(nto.participation_ratio, nto.hole_atom_weights, nto.particle_atom_weights) nto.plot_weights().write_html("nto-weights.html")Natural transition orbitals come from an SVD of the signed transition-amplitude matrix. Pair weights describe how compactly a transition can be represented; atom-resolved hole/particle populations and charge-transfer distance depend on the supplied AO partition. The native calculation record retains amplitudes, energies, oscillator strengths, transition dipoles, and NTO summaries.
Excitation and NTO calculation record
The method is an approximate molecular sTDA model. Its energies are distinct from canonical HOMO–LUMO differences and from a converged ab initio excitation calculation. An NTO requires transition amplitudes, coefficients, and overlap; a list of oscillator strengths alone is insufficient. Reconstructing from a truncated list of dominant transitions only would analyze that truncated model.
saved = json.loads(Path("raman.json").read_text())plot.raman(saved["content"])Water Raman activities
The saved example uses PBE/def2-SVP finite displacements and finite electric fields at the unoptimized experimental-like geometry O(0, 0, 0), H(±0.758, 0.587, 0) Å, so the frequencies are harmonic values at a point that is not a PBE stationary point. Raman shift increases from left to right.
saved = json.loads(Path("xrd.json").read_text())plot.xrd(saved["content"])plot.xrd displays a supplied pattern and preserves its geometry-dependent values.
Debye data from a finite molecule use a connected curve. Periodic peak records use sticks.
Two-theta increases from left to right, in degrees.
Export
Section titled “Export”figure.write_html("spectrum.html")figure.save("spectrum.svg")HTML export writes to the Python filesystem. Image export uses the connected browser. The plot gallery lists all supported plot families and data conditions.