Cavity Forces¶
This section describes the mathematical formulation of cavity-molecule coupling and the resulting forces on nuclei and photonic modes.
Complete Hamiltonian Derivation¶
From Minimal Coupling to Pauli-Fierz Form¶
This section presents the self-contained derivation of the classical light-matter Hamiltonian used in Cavity HOOMD, starting from quantum electrodynamics and systematically reducing to a classical treatment suitable for molecular dynamics simulations.
Minimal Coupling Hamiltonian¶
Starting Point:
The quantum Hamiltonian describing matter (electrons and nuclei) interacting with the electromagnetic field in the minimal coupling form:
where the matter Hamiltonian is:
and the electromagnetic field Hamiltonian is:
Components:
\(N_\mathrm{n}\) nuclei with charge \(+Z_i e\) and mass \(M_i\)
\(N_e\) electrons with charge \(-e\) and mass \(m_j\)
\(\hat{\mathbf{A}}\): Vector potential of electromagnetic field
\(\hat{V}_\mathrm{nn}, \hat{V}_\mathrm{ee}, \hat{V}_\mathrm{ne}\): Coulombic interactions
Coulomb Gauge:
We adopt \(\nabla \cdot \hat{\mathbf{A}} = 0\), incorporating the scalar potential into static Coulombic interactions. The electromagnetic fields are purely transverse.
Mode Expansion¶
Transform to Harmonic Oscillator Form:
Express the electromagnetic energy in terms of the vector potential using \(\hat{\mathbf{E}} = -\partial_t \hat{\mathbf{A}}\) and \(\hat{\mathbf{B}} = \nabla \times \hat{\mathbf{A}}\):
Fabry-Pérot Cavity:
For a one-dimensional cavity with mirrors at \(z = \pm L/2\), expand the vector potential in normal modes:
where \(\hat{\mathbf{e}}_\alpha \perp \hat{\mathbf{z}}\) are transverse polarization vectors and:
with cavity volume \(V = AL\) (cross-sectional area \(A = L^2\)).
Harmonic Oscillator Mapping:
Assign each cavity mode to a harmonic oscillator via annihilation operator \(\hat{a}_{\ell,\alpha}\):
yielding:
Canonical Coordinates:
Define position and momentum operators:
so that:
Uniform Field Approximation¶
Due to the separation between molecular and cavity length scales, approximate the vector potential as spatially uniform:
Coupling Strength:
Identify the light-matter coupling strength \(\lambda = 1/\sqrt{\epsilon_0 V}\).
Gauge Transformations¶
First Transformation - Length Gauge:
Apply unitary transformation to eliminate the vector potential from kinetic energy:
where \(\hat{\boldsymbol{\mu}} = \sum_i Z_i e \hat{\mathbf{R}}_i - \sum_j e \hat{\mathbf{r}}_j\) is the total molecular dipole moment and \(\hat{\mu}_\alpha = \hat{\boldsymbol{\mu}} \cdot \hat{\mathbf{e}}_\alpha\).
Using the Baker-Campbell-Hausdorff formula with \([\hat{q}_{\ell,\alpha}, \hat{p}_{\ell',\alpha'}] = i\hbar\delta_{\ell\ell'}\delta_{\alpha\alpha'}\):
This removes the vector potential from matter kinetic energy and shifts photonic momenta:
where \(\hat{H}_\mathrm{M}^\mathrm{(free)}\) has no vector potential. This is the length gauge (dipole-field form).
Second Transformation - Phase Rotation:
Apply 90° phase rotation on photonic degrees of freedom:
giving:
Pauli-Fierz Hamiltonian:
After relabeling rotated variables as \((\hat{q}, \hat{p})\):
This is the Pauli-Fierz form in coordinate-displacement representation, where the molecular dipole moment displaces the light coordinate.
Cavity Born-Oppenheimer and Classical Treatment¶
Timescale Separation:
Nuclei move slowly compared to electrons, but electromagnetic modes match nuclear vibrational timescales. Apply the cavity Born-Oppenheimer approximation:
Adiabatic Approximation:
Since cavity modes are typically off-resonant from electronic transitions:
Classical Limit:
Treating slower degrees of freedom classically, the potential energy becomes:
where \(\mu_\alpha = \langle\psi_g|\hat{\mu}_\alpha|\psi_g\rangle\) is the classical dipole moment.
Mean-Field Approximation:
Approximate quantum fluctuations by classical mean-field:
Final Classical Hamiltonian:
Completing the square yields:
where:
This provides the foundation for classical cavity molecular dynamics.
General Multimode Formulation¶
Classical Hamiltonian¶
The complete classical Hamiltonian for cavity-coupled molecular dynamics is:
where \(H_{\text{mol}}\) is the molecular Hamiltonian and the sum runs over cavity modes k and polarizations λ.
Molecular Hamiltonian:
Where:
\(P_{nj}\): Momentum of nucleus j in molecule n
\(M_{nj}\): Mass of nucleus j in molecule n
\(R_{nj}\): Position of nucleus j in molecule n
\(V(\{R_{nj}\})\): Molecular potential energy (bonds, angles, LJ, Coulomb, etc.)
Cavity Mode Hamiltonian:
Where:
\(\tilde{q}_{k,\lambda}\): Normalized photonic coordinate for mode k, polarization λ
\(\tilde{p}_{k,\lambda}\): Conjugate momentum
\(m_{k,\lambda}\): Effective mass of photonic mode
\(\omega_{k,\lambda}\): Angular frequency of cavity mode
\(\tilde{\varepsilon}_{k,\lambda}\): Effective coupling strength
\(d_{ng,\lambda}\): Component of molecular dipole moment n in direction λ
\(N_{\text{sub}}\): Number of molecules in simulation cell
Physical Interpretation:
First term: Harmonic oscillator energy of cavity mode
Second term: Kinetic energy of cavity mode
Third term: Linear dipole-field coupling
Fourth term: Dipole self-energy (counter-term ensuring correct energetics)
Equations of Motion¶
Nuclear Motion:
From Hamilton’s equations:
Where:
\(F_{nj}^{(0)} = -\frac{\partial V}{\partial R_{nj}}\): Cavity-free force
\(\frac{\partial d_{ng,\lambda}}{\partial R_{nj}}\): Dipole moment gradient
Physical Interpretation:
The nuclear force has three contributions:
Molecular force \(F_{nj}^{(0)}\): Standard MD forces (bonds, LJ, etc.)
Linear coupling force \(-\tilde{\varepsilon}_{k,\lambda} \tilde{q}_{k,\lambda} \frac{\partial d_{ng,\lambda}}{\partial R_{nj}}\): Force from cavity field acting on molecular dipole
Self-energy force \(-\frac{\tilde{\varepsilon}_{k,\lambda}^2}{K_{k,\lambda}} D_{\lambda} \frac{\partial d_{ng,\lambda}}{\partial R_{nj}}\): Force from collective dipole interaction (where \(K_{k,\lambda} = m_{k,\lambda}\omega_{k,\lambda}^2\))
Photonic Mode Dynamics:
Where:
First term: Harmonic restoring force
Second term: Driving force from molecular dipoles
Single Mode Approximation¶
Simplifying to κ=0 Mode¶
For many applications, considering only the fundamental cavity mode (κ=0) suffices:
Reduced Hamiltonian:
Where:
\(D_\lambda = \sum_{n=1}^{N_{\text{sub}}} d_{ng,\lambda}\): Total dipole moment in direction λ
\(K_\lambda = m_{0,\lambda}\omega_{0,\lambda}^2\): Cavity spring constant
Sum over \(\lambda = x, y\) for transverse polarizations
Equations of Motion (Single Mode):
Nuclear motion:
Photonic mode:
When is Single Mode Valid?
Frequency separation: \(\omega_1 - \omega_0 \gg \Omega_R\) (next mode far from resonance)
Weak higher modes: Higher mode couplings negligible
Fundamental dominates: Most photon population in κ=0 mode
Force Decomposition¶
Total Force on Nuclei¶
The total force on nucleus j of molecule n can be decomposed as:
1. Molecular Force:
Standard molecular dynamics forces: bonds, angles, dihedrals, Lennard-Jones, Coulomb, etc.
2. Coupling Force:
This force arises from the cavity electric field acting on the molecular dipole moment.
Magnitude: Scales as \(g \times q \times |\nabla d|\)
Direction: Along dipole moment gradient (tends to align dipole with field)
3. Self-Energy Force:
This force accounts for the interaction energy of the molecular dipole with the collective dipole.
Magnitude: Scales as \(g^2 \times N \times |\nabla d|\)
Physical Meaning: Represents mean-field interaction with all other molecules mediated by the cavity
Energy Components¶
Total Energy Decomposition:
1. Kinetic Energy:
Includes both molecular and photonic kinetic energy.
2. Potential Energy:
Standard molecular potential energy.
3. Cavity Harmonic Energy:
Energy stored in cavity mode oscillations.
4. Coupling Energy:
Interaction energy between molecular dipoles and cavity field.
Sign: Can be positive or negative depending on relative orientation.
5. Self-Energy:
Collective dipole-dipole interaction energy.
Always positive: Represents energetic cost of dipole interactions.
Coupling Strength Parameter¶
Defining the Coupling¶
The effective coupling strength is:
Where:
\(N_{\text{cell}}\): Number of periodic simulation cells
\(\Omega\): Volume of simulation cell
\(\varepsilon_0\): Vacuum permittivity
In practical calculations:
where g is the user-specified coupling strength parameter.
Single-Molecule vs Collective Coupling¶
Single-molecule coupling:
Collective coupling:
For N molecules, the collective enhancement is \(\sqrt{N}\).
Example:
N = 512 molecules
\(g_{\text{single}} = 10^{-3}\) (atomic units)
\(g_{\text{collective}} = 10^{-3} \times \sqrt{512} \approx 0.0226\)
This collective enhancement enables strong coupling even with modest single-molecule coupling.
Finite-q Cavity Mode¶
Wave Vector Considerations¶
For finite momentum transfer \(\vec{k} \neq 0\):
Modified Coupling:
where \(\vec{R}_n\) is the position of molecule n.
For standing wave along z-axis:
where \(L_z\) is the box size in z-direction.
Phase factor:
For real fields, only cosine term contributes:
Cavity Particle Representation¶
In Cavity HOOMD implementation:
The cavity mode is represented by physical “cavity particles” with:
q=0 mode: Particles at origin, displacement represents mode amplitude
Finite-q mode: Particles positioned to represent standing wave
Position-mode relationship:
where \(\hat{e}_\lambda\) is the polarization direction unit vector.
Advantages:
Uses standard MD machinery
Easy visualization
Natural integration with HOOMD-blue
Straightforward implementation of time-varying coupling
Dipole Moment Calculation¶
For Diatomic Molecules¶
For a diatomic molecule with atoms at \(\vec{r}_1, \vec{r}_2\):
Dipole moment:
where \(q_{\text{eff}}\) is the effective charge.
For O₂: Approximately non-polar, but instantaneous dipole from charge fluctuations.
Dipole gradient:
For Polyatomic Molecules¶
General formula:
Gradient:
Practical Calculation:
In simulations, dipole moments are computed from:
Partial charges: From force field
Positions: From trajectory
Periodic boundary conditions: Must use unwrapped coordinates
Implementation Notes¶
Numerical Considerations¶
1. Timestep Selection:
Cavity oscillations impose constraint:
Guideline: \(\Delta t < 0.1 \times T_{\text{cavity}}\)
For \(\omega = 2000\) cm⁻¹:
2. Force Cutoffs:
Dipole gradients can be large near bonds. Use:
Smooth switching functions
Force capping for initialization
Gradual coupling ramp-up
3. Energy Conservation:
Monitor relative energy drift:
For well-behaved simulations.
GPU Optimization¶
Memory Layout:
Coalesced memory access for particle positions
Shared memory for reductions (total dipole calculation)
Texture memory for periodic wrapping
Kernel Structure:
Dipole calculation: All molecules → total \(D_\lambda\)
Force calculation: Distribute cavity force to all nuclei
Integration: Update cavity particle positions/velocities
Performance:
Typical speedup: 50-100× over CPU for N>1000 molecules.
Next Sections¶
Continue to:
Time-Varying Coupling for time-dependent coupling theory
Energy Conservation for energy decomposition details
Thermostats for temperature control
Strong Coupling for polariton physics
Related practical guides:
Running Simulations for parameter selection
Analysis Tools for energy analysis