# Laser physics simulator - population inversion, rate equations, cavity modes, Gaussian beams

> Laser simulator: animated 2/3/4-level atoms show inversion; rate equations give threshold, L–I curve, spiking and Q-switching; cavity modes and Gaussian beams.

- URL: https://qilingtools.com/en/physics/laser
- Category: Physics Tools (https://qilingtools.com/en/physics)
- Tags: [Physics](https://qilingtools.com/en/tags/physics), [Education](https://qilingtools.com/en/tags/education)
- Last updated: 2026-10-29
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

An interactive tour of how a laser works, from single atoms to the output beam. Watch spontaneous emission, stimulated emission and absorption atom by atom and see why a two-level system can never lase. Then use the four-level rate equations for threshold, slope efficiency, turn-on spiking and Q-switched pulses, and finish with which cavity modes lase and how a Gaussian beam focuses and spreads.

## How to use

1. On the Atoms & inversion tab pick a two-, three- or four-level scheme, set the pump rate and press Play to watch the populations, the inversion and the output photons.
2. On the Rate equations tab choose a laser preset or enter mirror reflectivities, cross-section and lifetime to get the threshold pump power and slope efficiency, then simulate turn-on or a Q-switched pulse.
3. On the Cavity & modes tab change the cavity length, gain linewidth and gain-to-loss ratio and count the modes above threshold.
4. On the Gaussian beam tab enter a waist and wavelength for the Rayleigh range, divergence and spot size at any distance, or get the mode waist straight from a two-mirror stable cavity.
5. On the Presets & safety tab compare common lasers and read what laser classes 1 to 4 mean.

## Features

- Atom-level Monte Carlo animation: pumping, fast decay, spontaneous and stimulated emission and absorption, with photons amplified between two mirrors
- Analytic steady-state inversion curves for two-, three- and four-level schemes, showing why at least three levels are needed
- Four-level rate equations integrated with RK4: turn-on spiking, relaxation oscillation period and damping, L–I curve
- Q-switched giant pulse: initial and final inversion, extraction efficiency, pulse energy, peak power and width, numerical vs analytic
- Cavity mode spacing c/2nL, finesse, cavity linewidth, Airy transmission, and lasing modes under a Gaussian gain curve
- Gaussian beam and stable-cavity calculator, with He-Ne, Nd:YAG, diode, CO₂ and fiber laser presets and a laser safety class guide

## FAQ

### Why can't a two-level system lase?

When you pump two-level atoms with light, the pump excites ground-state atoms but also drives excited atoms back down by stimulated emission with the same probability, because the Einstein B coefficients for absorption and stimulated emission are equal. However hard you pump, the upper population can only approach the lower one, never exceed it, so there is no gain. Three- and four-level schemes separate the pump transition from the laser transition, which makes inversion possible.

### Why does a four-level laser have a lower threshold than a three-level one?

In a three-level laser the lower laser level is the ground state, so more than half of all atoms must be moved up before there is any inversion. In a four-level laser the lower level sits above the ground state and empties quickly, so it is almost always empty and a small upper population already counts as inversion. That is why four-level lasers like Nd:YAG have a far lower threshold than ruby.

### Why does the output start with a train of spikes?

When pumping starts, the inversion builds up past threshold while there are still very few photons in the cavity, so it overshoots. Once the photon number avalanches it drains the inversion below threshold, the photons die away, and the cycle repeats. These are relaxation oscillations, with a small-signal period of about 2π√(τ τc/(r−1)), and they damp towards the steady state.

### How does Q-switching produce such high peak power?

While pumping, a shutter or an electro-optic or acousto-optic switch keeps the cavity loss high so the laser cannot oscillate, and the inversion builds far above the normal threshold. The loss is then dropped suddenly and the stored energy comes out as one short pulse within a few photon lifetimes. The tool solves n_i − n_f = ln(n_i/n_f) for the extraction efficiency, gives pulse energy, peak power and width, and checks them against a numerical integration.

### How do I work out the mode spacing and the number of lasing modes?

Adjacent longitudinal modes are spaced by c/(2nL), about 500 MHz for a 30 cm He-Ne cavity. Only modes inside the band where gain exceeds the cavity loss can lase. A He-Ne with its 1.5 GHz Doppler linewidth usually runs on two or three modes, while a sub-millimetre diode laser has mode spacings of a hundred GHz or more. In homogeneously broadened media mode competition reduces the count further.

## Related tools

- [Unit Converter](https://qilingtools.com/en/math/unit): Free online unit converter: length, area, volume, weight, temperature, time, speed, data, pressure, energy and angle — one value converts every unit at once.
- [Vector Calculator](https://qilingtools.com/en/math/vector): Free online vector calculator for 2D and 3D: addition, scalar multiples, dot and cross products, magnitude, angle, unit vector and projections, with checks.
- [Significant Figures Calculator](https://qilingtools.com/en/math/significant-figures): Free online sig fig calculator: count significant figures digit by digit, round to N sig figs or decimals with six rounding modes, and compute by sig fig rules.
- [Tone Generator](https://qilingtools.com/en/audio/tone-generator): Free online tone generator: sine, square, sawtooth and triangle waves from 1 to 20,000 Hz, a note picker, sweeps, white/pink/brown noise and a WAV download.
- [Audio Spectrogram](https://qilingtools.com/en/audio/spectrogram): Free online spectrogram generator: see time, frequency and level from a Hann-windowed STFT, with FFT size, log axis, dB range and colour maps. Exports PNG.
- [Decibel Meter](https://qilingtools.com/en/audio/decibel): Free online decibel meter: measure noise with your mic in real time, A/C/Z weighting, fast/slow response, min/max/average/Leq, 60-second graph and calibration.
- [Physics Formula Calculator](https://qilingtools.com/en/physics/physics): Physics formulas solved with steps: SUVAT, projectiles, Newton’s laws, inclines, energy, Ohm’s law, resistors, RC, buoyancy, waves, lenses, gravity.
- [Fourier Series & FFT Visualizer](https://qilingtools.com/en/math/fourier): Fourier series coefficients and animated partial sums for square, sawtooth, triangle or any function (Gibbs), draw-your-own epicycles and FFT spectra.
