An optimized geometry supplies one point on a molecular potential-energy surface. An ensemble of initial conditions also needs the spread of nuclear positions and momenta. The route used here is to approximate the local vibrations as independent harmonic oscillators, sample their Wigner distributions, and transform the sampled normal coordinates back into atomic coordinates and velocities.

This is the nuclear counterpart of a familiar phonon calculation. We continue with the same 30-atom molecular motor as Part I. The main question is practical: how did one tutorial structure become a pool of 2000 candidate geometries without first running a molecular-dynamics trajectory? The harmonic model explains that construction. Its initial-state approximation and the later NaF propagation are separate choices.

1. Why One Optimized Geometry Is Insufficient

In a VASP relaxation, the atomic forces approach zero at an equilibrium structure. The same condition applies to an isolated molecule. Let \(\mathbf R\) collect its \(3N\) Cartesian coordinates, and let \(E(\mathbf R)\) denote the electronic potential energy used to prepare the nuclei. An optimized stationary structure \(\mathbf R_0\) satisfies

\[ \nabla E(\mathbf R_0)\simeq 0. \]

This condition determines a center. It does not specify a nuclear distribution around that center. At finite temperature the molecule has thermally occupied vibrations; at zero temperature its nuclear wavefunction still has a finite width. Giving every trajectory exactly \(\mathbf R_0\) and zero velocity would remove both sources of initial nuclear spread.

To construct that spread, we first need the restoring forces near \(\mathbf R_0\). A local harmonic model supplies those forces and a tractable quantum initial distribution. Throughout the derivation, \(\omega\) means angular frequency, while a reported vibrational wavenumber \(\tilde\nu\) in cm−1 obeys \(\omega=2\pi c\tilde\nu\). Masses, lengths, energies, and time must use a consistent unit system.

2. Read the Local Curvature from the Hessian

Write \(\Delta\mathbf R=\mathbf R-\mathbf R_0\). Expanding the energy about the stationary geometry gives

\[ E(\mathbf R_0+\Delta\mathbf R) =E_0+\underbrace{\nabla E(\mathbf R_0)^{\mathsf T}\Delta\mathbf R}_{\simeq0} +\frac12\Delta\mathbf R^{\mathsf T}\mathbf K\Delta\mathbf R +O(\lVert\Delta\mathbf R\rVert^3), \qquad K_{ab}=\left.\frac{\partial^2E}{\partial R_a\partial R_b}\right|_{\mathbf R_0}. \]

The Hessian \(\mathbf K\) is a matrix of local force constants. Its diagonal entries describe curvature along individual Cartesian coordinates. Off-diagonal entries describe how displacing one coordinate changes the force along another. These couplings are why independently shaking every atom would not reproduce the harmonic nuclear distribution.

A central finite-difference construction uses analytical forces, with \(F_a=-\partial E/\partial R_a\):

\[ K_{ab}\simeq- \frac{F_a(\mathbf R_0+\delta\mathbf e_b) -F_a(\mathbf R_0-\delta\mathbf e_b)}{2\delta}. \]

Here \(\mathbf e_b\) is a Cartesian unit displacement and \(\delta\) is the displacement size. This is the same force-constant logic used by VASP finite-difference phonon calculations. A crystal adds periodicity and wavevector-dependent dynamical matrices; an isolated molecular Hessian describes the finite molecule directly. VASP documents the force-constant construction and its zone-center scope.

Our motor has \(N=30\), so its Cartesian Hessian is \(90\times90\). A stationary point alone is not proof of a minimum: negative curvature in the internal vibrational subspace produces an imaginary frequency. Such a direction must be diagnosed before applying a stable-oscillator initial-state model.

3. Obtain Independent Harmonic Normal Modes

Curvature alone does not determine a vibration frequency. A heavy atom accelerates less than a light atom under the same force. Introduce the diagonal Cartesian mass matrix, repeating each atomic mass three times:

\[ \mathbf M=\operatorname{diag}(m_1,m_1,m_1,\ldots,m_N,m_N,m_N). \]

The harmonic equation of motion is \(\mathbf M\Delta\ddot{\mathbf R}=-\mathbf K\Delta\mathbf R\). Define mass-weighted displacement \(\mathbf y=\mathbf M^{1/2}\Delta\mathbf R\); multiplying the equation by \(\mathbf M^{-1/2}\) gives

\[ \ddot{\mathbf y}=-\mathbf D\mathbf y, \qquad \mathbf D=\mathbf M^{-1/2}\mathbf K\mathbf M^{-1/2}. \]

In the internal vibrational subspace, diagonalize the symmetric matrix \(\mathbf D\). Collect its orthonormal eigenvectors as columns of \(\mathbf L\):

\[ \mathbf D\mathbf e_k=\omega_k^2\mathbf e_k, \qquad \mathbf L^{\mathsf T}\mathbf L=\mathbf I, \qquad \mathbf L^{\mathsf T}\mathbf D\mathbf L =\operatorname{diag}(\omega_1^2,\ldots,\omega_f^2). \]

For an isolated nonlinear molecule, the six rigid translations and rotations are excluded, leaving \(f=3N-6\) internal modes. The motor therefore has 84 vibrational modes. Linear molecules have five rigid modes and require a different count. The projection and normalization must match the format expected by the sampler.

Let \(\boldsymbol\pi=\mathbf M\dot{\mathbf R}\) be the atomic Cartesian momentum. The normal coordinates and their conjugate momenta are

\[ \mathbf Q=\mathbf L^{\mathsf T}\mathbf M^{1/2}\Delta\mathbf R, \qquad \mathbf P=\mathbf L^{\mathsf T}\mathbf M^{-1/2}\boldsymbol\pi. \]

Within this vibrational subspace, the inverse relations are \(\Delta\mathbf R=\mathbf M^{-1/2}\mathbf L\mathbf Q\) and \(\boldsymbol\pi=\mathbf M^{1/2}\mathbf L\mathbf P\). Substitute them into kinetic and potential energy:

\[ T=\frac12\boldsymbol\pi^{\mathsf T}\mathbf M^{-1}\boldsymbol\pi =\frac12\mathbf P^{\mathsf T}\mathbf P, \qquad U-E_0=\frac12\mathbf Q^{\mathsf T}\mathbf L^{\mathsf T}\mathbf D\mathbf L\mathbf Q =\frac12\sum_k\omega_k^2Q_k^2. \]

The resulting Hamiltonian is

\[ \boxed{H_{\mathrm{harm}}=E_0+ \sum_{k=1}^{f}\left(\frac{P_k^2}{2}+\frac{\omega_k^2Q_k^2}{2}\right).} \]

This is the independent-SHO approximation. Each oscillator is a collective nuclear vibration. Its effective mass is one because its coordinate is mass weighted. Independence holds in the local quadratic model; higher-order terms in the actual potential can couple the modes.

Three actual collective modes of the motor, with displacement arrows on the same equilibrium structure.
Three of the motor's actual GFN2-xTB normal modes, spanning 47.7, 994.5, and 3511.7 cm−1. Axes are projected Cartesian positions in angstrom. Teal arrows show three times the displacement from setting one mode to its zero-temperature coordinate standard deviation; the factor of three improves visibility. Mode signs are arbitrary. These arrows describe mode patterns, not a propagated trajectory.

4. Represent a Quantum Oscillator in Phase Space

The harmonic reduction tells us what the modes are, but not how to initialize them. At zero temperature, quantize one mass-weighted mode:

\[ \hat H_k=\frac{\hat P_k^2}{2}+\frac{\omega_k^2\hat Q_k^2}{2}, \qquad [\hat Q_k,\hat P_k]=i\hbar. \]

Suppress the mode index for a moment. The ground-state wavefunction is a Gaussian,

\[ \psi_0(Q)=\left(\frac{\omega}{\pi\hbar}\right)^{1/4} \exp\!\left(-\frac{\omega Q^2}{2\hbar}\right). \]

Sampling \(|\psi_0(Q)|^2\) supplies a coordinate, but a trajectory also needs a momentum. The Wigner transform represents the density operator \(\hat\rho\) on phase space:

\[ W(Q,P)=\frac{1}{2\pi\hbar}\int_{-\infty}^{\infty}d\xi\, e^{-iP\xi/\hbar} \left\langle Q+\frac\xi2\middle|\hat\rho\middle|Q-\frac\xi2\right\rangle. \]

For the ground state, the density-matrix factor inside this integral is

\[ \psi_0\!\left(Q+\frac\xi2\right) \psi_0^*\!\left(Q-\frac\xi2\right) =\sqrt{\frac{\omega}{\pi\hbar}} \exp\!\left(-\frac{\omega Q^2}{\hbar} -\frac{\omega\xi^2}{4\hbar}\right). \]

The Fourier integral of this Gaussian contributes \(\sqrt{4\pi\hbar/\omega}\exp[-P^2/(\hbar\omega)]\). Combining the factors gives

\[ \boxed{W_0(Q,P)=\frac{1}{\pi\hbar} \exp\!\left[-\frac{\omega Q^2+P^2/\omega}{\hbar}\right].} \]

Its integral over phase space is one. Integrating out \(P\) recovers \(|\psi_0(Q)|^2\); integrating out \(Q\) recovers the momentum probability density. More generally, Wigner averages reproduce expectations of the corresponding symmetrically ordered operators. A Wigner function is a quasiprobability, but this particular ground-state function is everywhere nonnegative and can be sampled with ordinary positive weights.

The exponent separates into a coordinate term and a momentum term. Thus independent standard normal random variables \(\xi_Q,\xi_P\sim\mathcal N(0,1)\) generate a sample through

\[ Q=\sqrt{\frac{\hbar}{2\omega}}\,\xi_Q, \qquad P=\sqrt{\frac{\hbar\omega}{2}}\,\xi_P. \]

The coordinate width grows as a mode becomes softer, while its momentum width decreases. Their product is \(\sigma_Q\sigma_P=\hbar/2\). Even at zero temperature neither width vanishes. Position and momentum here are phase-space sampling variables; they are not a prescription for simultaneously measuring two noncommuting operators on one molecule.

5. Include Temperature and Draw Each Mode

At finite temperature, a harmonic mode occupies vibrational levels \(n=0,1,\ldots\) with Boltzmann probabilities. Set \(\beta=1/(k_{\mathrm B}T)\) and define

\[ C_k=\coth\!\left(\frac{\beta\hbar\omega_k}{2}\right). \]

The exact harmonic thermal Wigner function remains a Gaussian:

\[ W_{\beta,k}(Q_k,P_k)=\frac{1}{\pi\hbar C_k} \exp\!\left[-\frac{\omega_kQ_k^2+P_k^2/\omega_k}{\hbar C_k}\right]. \]
Derive the thermal factor from the vibrational-state mixture

For one mode, let \(r=e^{-\beta\hbar\omega}\) and \(s=(\omega Q^2+P^2/\omega)/\hbar\). The level probabilities are \(p_n=(1-r)r^n\); the level Wigner functions are \(W_n=(-1)^ne^{-s}L_n(2s)/(\pi\hbar)\), where \(L_n\) is a Laguerre polynomial. Use the generating function

\[ \sum_{n=0}^{\infty}t^nL_n(x)=\frac{1}{1-t} \exp\!\left(-\frac{tx}{1-t}\right). \]

Taking \(t=-r\) gives the signed mixture before any sampling:

\[ \sum_np_nW_n =\frac{1-r}{\pi\hbar(1+r)} \exp\!\left[-s\frac{1-r}{1+r}\right], \qquad C=\frac{1+r}{1-r} =\coth\!\left(\frac{\beta\hbar\omega}{2}\right). \]

This positive Gaussian is the exact harmonic thermal target. Individual excited-state Wigner functions can be negative; their signed thermal sum must be formed consistently.

Since the harmonic Hamiltonian is a sum of independent mode Hamiltonians, its thermal density operator is a tensor product. Its Wigner function therefore factorizes:

\[ \hat\rho_\beta=\bigotimes_k\hat\rho_{\beta,k}, \qquad W_\beta(\mathbf Q,\mathbf P)=\prod_kW_{\beta,k}(Q_k,P_k). \]

Consequently, all coordinate and momentum draws can be made independently in the normal-mode basis:

\[ \boxed{ Q_k=\sqrt{\frac{\hbar C_k}{2\omega_k}}\,\xi_{Q,k}, \qquad P_k=\sqrt{\frac{\hbar\omega_kC_k}{2}}\,\xi_{P,k}.} \]

As \(T\to0\), \(C_k\to1\) and the ground-state widths are recovered. When \(k_{\mathrm B}T\gg\hbar\omega_k\), \(\coth x\simeq1/x\), so

\[ \sigma_{Q_k}^2\longrightarrow\frac{k_{\mathrm B}T}{\omega_k^2}, \qquad \sigma_{P_k}^2\longrightarrow k_{\mathrm B}T. \]

These are the classical canonical widths in mass-weighted coordinates. The limit depends on the frequency of each mode. A low-frequency deformation can be thermally active while a high-frequency stretching mode remains close to its quantum ground state at the same temperature.

From normal coordinates to a molecular geometry

Actual motor normal-mode patterns, available without JavaScript.

Strict harmonic Gaussian teaching figure; not a replay of SHARC 4.1 finite-temperature output.

Gray outlines show the equilibrium geometry; filled atoms and solid bonds show the selected displacement. Positions and momenta use independent Gaussian coordinates. The slider spans a demonstration range only; this is an initial-condition picture, with no dynamics.
Quantum and classical position marginal densities at 50 K for 47.7 and 1000 inverse-centimeter harmonic modes.
Analytic coordinate marginals at 50 K. Teal solid: exact harmonic thermal Wigner; brown dashed: classical canonical. Each panel uses its own dimensionless coordinate \(q=\sqrt{\omega/\hbar}\,Q\). The 1000 cm−1 classical distribution is much narrower because it omits zero-point spread. These are teaching curves, not histograms of the SHARC candidate pool.

6. Reconstruct the Whole Molecule

Independent modes do not mean independent atoms. Each normal-mode eigenvector specifies a collective pattern across the whole molecule. After drawing all \((Q_k,P_k)\), use the inverse transformation:

\[ \boxed{\mathbf R=\mathbf R_0+\mathbf M^{-1/2}\mathbf L\mathbf Q, \qquad \mathbf v=\mathbf M^{-1/2}\mathbf L\mathbf P.} \]

Writing the same relation for atom \(i\), with \(\mathbf e_{ik}\) its three-component part of mode \(k\), makes the assembly explicit:

\[ \mathbf R_i=\mathbf R_{i,0}+\frac{1}{\sqrt{m_i}}\sum_k\mathbf e_{ik}Q_k, \qquad \mathbf v_i=\frac{1}{\sqrt{m_i}}\sum_k\mathbf e_{ik}P_k. \]

One independent draw of all 84 mode pairs gives one complete molecular coordinate-and-velocity set. Repeating the draw gives an ensemble without propagating an MD trajectory between samples. The atomic displacements are generally correlated, as their covariance shows:

\[ \left\langle\Delta\mathbf R\Delta\mathbf R^{\mathsf T}\right\rangle =\mathbf M^{-1/2}\mathbf L\, \operatorname{diag}(\sigma_{Q_1}^2,\ldots,\sigma_{Q_f}^2) \mathbf L^{\mathsf T}\mathbf M^{-1/2}. \]

The off-diagonal entries need not vanish. Independent normal coordinates have become correlated Cartesian displacements. This is the precise meaning of sampling independent oscillators and then assembling the molecule.

Thermal Wigner and classical phase space

Analytic quantum and classical position densities at 50 K.

Strict harmonic Gaussian teaching figure; not a replay of SHARC 4.1 finite-temperature output.

Blue: thermal Wigner; dashed brown: classical canonical distribution. The ellipses have one-standard-deviation semiaxes, enclosing 39.3% of a two-dimensional Gaussian. Axes use a fixed 1000 cm⁻¹ reference; a panel explicitly marks any clipped tails. At zero temperature the classical distribution is a point and its position marginal is a delta distribution.

The single-mode slider displays one chosen coordinate coefficient, while its momentum is drawn separately. Selecting all modes combines independent coordinate and momentum draws. The displayed velocities come from \(\mathbf P\), not from differentiating a manually moved slider. Neither view performs a time propagation.

7. Understand What a Sampled Energy Means

A harmonic ground state has a sharply defined quantum energy \(\hbar\omega/2\). Its Wigner samples nevertheless occupy the full phase plane. Evaluating the classical harmonic function on those points gives

\[ E_{\mathrm{cl}}=\frac{P^2}{2}+\frac{\omega^2Q^2}{2}, \qquad \langle E_{\mathrm{cl}}\rangle_{W_0}=\frac{\hbar\omega}{2}. \]

The equality constrains the ensemble mean. It does not constrain each point to one energy shell. Define \(q=\sqrt{\omega/\hbar}Q\), \(p=P/\sqrt{\hbar\omega}\), and \(\epsilon=E_{\mathrm{cl}}/(\hbar\omega)=(q^2+p^2)/2\). The ground-state density is \(e^{-q^2-p^2}/\pi\). Integrating it over the polar angle gives

\[ \mathcal P(\epsilon)=2e^{-2\epsilon}, \quad\epsilon\ge0, \qquad \langle\epsilon\rangle=\frac12. \]

Many points therefore have \(E_{\mathrm{cl}}<\hbar\omega/2\). They are phase-space samples of the ground-state density operator, not individual quantum energy eigenstates. Rescaling every point to the same zero-point energy would replace the Gaussian distribution by an energy shell and change the initial state. A projective quantum energy measurement is a different operation: it returns \(\hbar\omega/2\) with certainty for this ground state.

Exponential distribution of classical harmonic energies evaluated on ground-state Wigner points, with mean one half.
Analytic distribution of the classical energy function evaluated on ground-state Wigner points. Teal: \(2e^{-2\epsilon}\); dashed brown: its mean at \(\epsilon=1/2\). The curve is not the distribution of outcomes of a quantum energy measurement. Its weight below one half is a feature of the representation, not evidence of an initial zero-point-energy leak.

8. Follow the Actual xTB–SHARC–CASSCF Workflow

The derivation above describes the exact thermal distribution of a quadratic model. The actual dataset construction has two further choices: which electronic method supplies that model, and how the installed sampler implements its finite-temperature proposal.

The input was the 30-atom motor from the PSiNaD tutorial. GFN2-xTB 6.7.1 optimized this structure and computed a numerical Hessian. The xTB frequency documentation describes this optimization-plus-Hessian route. The existing Hessian was mass weighted and projected to the 84 internal modes, whose frequencies span 47.744 to 3511.746 cm−1. All 84 positive modes were retained. PySCF's normal-mode analysis utility assisted the conversion; that use of PySCF did not perform a new CASSCF Hessian calculation.

SHARC 4.1 then generated 2000 candidate coordinate-and-velocity sets at 50 K. Masses were passed explicitly to maintain consistency with the Hessian conversion. In a generic directory containing the prepared frequency file and mass-input file, the sampling command has the form

python wigner.py -n 2000 -t 50 -r 2026103107 \
  -f 4 -m -L 0.1 -x -o initconds normal-modes.molden < masses.stdin

The mode file contains coordinates, frequencies, and orthonormal mass-weighted eigenvectors in SHARC's format 4. The 0.1 cm−1 cutoff did not remove any of these 84 internal modes. The initconds output retains velocities as well as coordinates; its companion XYZ file alone is insufficient to reconstruct the full phase-space initial conditions.

There is an implementation distinction at finite temperature. The retained SHARC source proposes dimensionless coordinates and momenta in a finite square, selects a vibrational level during each rejection proposal, and never accepts a negative value of that level's Wigner function. Reading that logic gives a proposal density proportional to

\[ \mathbf1_{[-5,5]^2}(q,p)\sum_np_n[W_n(q,p)]_+, \qquad [a]_+=\max(a,0). \]

This is not the signed sum \(\sum_np_nW_n\) derived in Section 5. The script also adjusts the center of mass and removes translational and rotational velocity components by default. Its finite-temperature candidate distribution therefore must be distinguished from the exact Gaussian illustrated above. A prior deterministic quadrature for the softest mode at 50 K found about a −4.08% coordinate-variance difference for the positive-part proposal. That number concerns the proposal before final coordinate/velocity processing; it is not a moment validation of all 2000 output records or of the selected training data.

From the 2000 candidates, 140 initial records and 1000 additional training candidates were selected. PySCF SA2-CASSCF(12,9)/6-31G* supplied their two-state energies, gradients, and nonadiabatic-coupling labels. The final merged dataset contains 1128 admitted records: 126 from the first batch, 879 from the additional batch, and 123 recovered by small-step electronic optimization. The remaining 12 selected records were not included. This is the origin of the seed dataset used before the subsequent DPGEN augmentation.

The roles remain distinct: xTB proposes a nuclear distribution; SHARC generates candidate phase-space points; CASSCF labels the selected geometries. Computing CASSCF labels does not reweight those points into a CASSCF equilibrium ensemble. Selection for geometric diversity also changes the training distribution relative to the original sampling distribution.

9. Run the Numerical Check

A compact reproducible example draws 50,000 independent exact harmonic Gaussian samples at 50 K for all 84 retained modes, with NumPy seed 20261105. It tests mode means, variances, and cross correlations, then reconstructs Cartesian displacements and velocities and transforms them back to mode coordinates. This exercise checks the Gaussian sampler and the normal-mode transformation; it does not rerun the deployed SHARC proposal or validate a molecular potential.

CheckObserved valueDeclared limit
Largest absolute standardized mean0.014510.02683
Largest absolute relative variance error0.018260.03795
Largest absolute off-diagonal correlation0.017330.02683
Mode → Cartesian → mode maximum error, in mode standard deviations2.09 × 10−1410−10

The moment limits are six-standard-error engineering checks at the stated sample count, not a proof that every property of a distribution has converged. The mean and correlation limits use \(6/\sqrt{N_s}\); the relative variance limit uses \(6\sqrt{2/(N_s-1)}\). Position–momentum and inter-mode correlations are tested together. The small reconstruction error checks the inverse transformation using the exported modes and consistent masses.

Download the following files into one directory:

python sample_harmonic.py --output wigner-example \
  --samples 50000 --seed 20261105 --temperature 50

The script requires NumPy and Matplotlib. It preserves the standardized Gaussian draws and analytic plot arrays in the chosen output directory. Analytic curves are checked for finite values, ordered abscissae, isolated spikes, endpoint behavior, and plotting-grid refinement; they are not smoothed. These checks concern the displayed examples, rather than the convergence of a later trajectory ensemble.

10. Identify What This Initial Distribution Covers

The independent-oscillator approximation is a local model of internal nuclear vibrations around one minimum. It can provide zero-point and thermal spread within that model, but a single Hessian does not describe a whole photochemical reaction path, multiple conformers, barrier crossing, or strongly anharmonic torsions. Those regions require additional sampling and appropriate physical checks.

After initialization, the nuclei can be propagated with NaF on nonquadratic, electronically coupled potential-energy surfaces. They are not required to continue as independent harmonic oscillators. Conversely, using a quantum-informed initial distribution does not make a subsequent classical-trajectory propagation exact quantum nuclear dynamics. Choosing the initial electronic state, including any excitation-window or oscillator-strength selection, is also a separate preparation step.

In the current workflow, the xTB/SHARC seed pool supplies initial geometrical coverage and CASSCF supplies the labels. For the next stage, a HamGNN committee is intended to guide short PSiNaD/NaF explorations and identify geometries for new labels. The harmonic construction explains where the first geometries and velocities came from; the planned active-learning loop addresses coverage along the dynamics that follows.

Sources and related reading

  1. VASP Wiki: Phonons from finite differences — force constants, dynamical matrices, and periodic-system scope.
  2. xTB: Calculation of Vibrational Frequencies — optimization, numerical Hessians, and imaginary-mode diagnostics.
  3. SHARC 4.1 Manual, Wigner Distribution Sampling — frequency/mode input and initial-condition output.
  4. SHARC source at the retained v4.1 commit — vibrational-state selection, rejection sampling, reconstruction, and rigid-motion removal. The exact thermal Gaussian demonstration in this article is deliberately distinguished from this implementation.
  5. PySCF normal-mode analysis source — mass weighting and rigid-motion projection.
  6. PSiNaD nonadiabatic tutorial at the retained source revision — provenance of the molecular motor.

Molecular Excited States Series