Choose the electron
The particle that forms chemical bonds is the electron. How large is its wavelength compared with the size of a molecule?
Chapter 02 · Interactive edition
By tinkering, you will discover what an MD program does at every step: why we can treat atoms as balls, how often we need to compute them and how often we need to save them.
Find out with your own trials why atoms can be treated as classical balls and how F = ma produces a trajectory.
Starting from the bands of an IR spectrum, choose the time step of an MD program.
Measure, with data from a real simulation, how the saving interval changes what you can see.
The theory that correctly describes the world of atoms is quantum mechanics. Even so, an MD program moves atoms with Newton's law, F = ma. In this lab you will find out with your own trials why this is usually enough, where it is not, and why the Schrödinger equation cannot be applied to a whole protein.
A hint from experiment: in crystal structures we see atoms at definite positions and write a structure as a list of coordinates. This shows that thinking of atoms as balls with a definite position usually works. How "wave-like" a particle is, however, is given by the thermal de Broglie wavelength λ = h/√(2π·m·k·T): λ is a measure of how blurred the particle's position is according to quantum mechanics. If λ approaches the distance to neighboring atoms (about 3 Å), the "ball" picture breaks down.
The particle that forms chemical bonds is the electron. How large is its wavelength compared with the size of a molecule?
At the same temperature, switch from H to C or O (or the other way round). The mass grows 12-16 times; by what factor does λ shrink?
Change the temperature of the same particle by at least a factor of two. How does the quantum blur change?
In quantum mechanics a vibration cannot take just any energy: its energy rises in steps of size ħω (ħω = h·c·ν̃, where ν̃ is the wavenumber in the IR). The measure of the thermal energy coming from the surroundings is kT. If the step is much larger than kT, the vibration freezes on the lowest step; if it is much smaller, the steps are not noticeable and classical mechanics gives the right result. Classical MD, however, gives every vibration an average energy of kT, no matter how fast it is.
The parabola is the potential energy of the vibration; the horizontal lines are the allowed energy steps. The darkness of a line is the probability of being on that step (Boltzmann). The colored band is the thermal energy kT; the vertical axis is in units of kT.
Choose the O–H or C–H stretch between 250 and 350 K. What state is the vibration in?
The large, slow motions of proteins lie far below the IR, at tens of cm⁻¹. How accurate is classical mechanics here?
Find the wavenumber at which ħω is exactly equal to kT. Does this boundary depend on temperature?
We have accepted the classical picture: the nuclei are balls, and the whole effect of the electrons is an energy surface U(x). The rest of MD is a single rule: the force is the slope of the energy (F = −dU/dx) and the acceleration is the force divided by the mass (a = F/m). The surface here has two stable positions with a barrier between them; you can think of it as two conformations of a side chain. The calculation uses the velocity Verlet integrator used by MD programs, in steps of 0.5 fs. While paused, you can place the ball anywhere on the surface with the mouse or your finger; the force arrow shows the push at that point.
On the same surface, play two different masses for at least one vibration each. How does the motion change?
In the isolated system, try an initial energy once below and once above the barrier.
Keep the energy below the barrier, but make the surroundings a "heat bath" and increase the speed. What happens?
The button computes a 1 ns run (2 million steps) in a 300 K heat bath with the mass and barrier of the bench and counts the crossings. If you press it again with the same settings, the time adds up. Try different barriers.
With the same mass, count at least 3 crossings at each of at least three different barriers of at least 3 kT (7.5 kJ/mol). Keep at least 5 kJ/mol between the lowest and the highest barrier.
Do the same with a second mass and compare the two slopes.
In the workshop you saw that the electron is definitely a quantum particle. Electrons form chemical bonds, so the forces come from them too. The key idea here is the Born-Oppenheimer approximation: the electron is 1836 times lighter than even the lightest nucleus, the proton. By the time the nuclei have moved one step, the electrons have long since adjusted to the new arrangement. The nuclei can therefore be thought of as moving on an energy surface U(R) created by the electrons.
Solved for the electrons at every arrangement of the nuclei; gives U(R). Expensive; MD does not do this.
Writes U(R) approximately with springs (bonds, angles), torsions, van der Waals terms and charges. The parameters come from experiment and from quantum calculations.
The force on each atom is the slope of the energy with respect to that atom's position.
Newton: the acceleration is the force divided by the mass. This is what you did on the bench.
The integrator advances by Δt; then it returns to step 1. 500 million rounds for 1 µs (Δt = 2 fs).
So why don't we compute the electrons with quantum mechanics at every step? Because the cost grows very quickly with the number of atoms. Enlarge the system below: the bars show how many times more expensive one force calculation of each method becomes when you go from the 22-atom alanine dipeptide (without water) to the size you choose.
The scalings are formal: a force field grows roughly as N with a cut-off radius and neighbor lists (N log N with PME), common DFT methods as N³, and CCSD(T), regarded as the gold standard, as N⁷. There are also linear-scaling quantum methods and QM/MM, which combines a force field with quantum mechanics; ab initio MD usually stays at the scale of hundreds of atoms and picoseconds. The force-field speed is a rough estimate scaled linearly from the value measured in this book's alanine dipeptide pilot.
| Component | Criterion at 300 K | In classical MD | What is lost, how it is compensated |
|---|
The criteria have just been computed with the formulas on this page. The boundary values (0.15 and 0.5 for λ/3 Å) are this page's rough criterion, not a sharp physical threshold.
Models: thermal de Broglie wavelength λ = h/√(2π·m·k·T); quantum harmonic oscillator (Boltzmann distribution, mean energy including zero-point energy, Einstein heat capacity); on the bench U(x) = E_b·((x/0.5 Å)² − 1)², velocity Verlet (Δt = 0.5 fs), Langevin dynamics in the heat bath (BAOAB, friction 10 ps⁻¹, 300 K). Your notebook is stored only in this browser.
An MD program does not follow the positions of the atoms continuously; it computes them at intervals, moving forward by a time step Δt. If the interval is too large, it misses a fast motion. You already know the fastest motions from experiment: the bands in an IR spectrum are bond vibrations.
Think of a bond as two masses with a spring between them: the masses are the atoms, and the stiffness of the spring (the force constant k) is the strength of the bond. Change the atoms and the stiffness; the vibration of the bond and its position in the IR spectrum change instantly. The spectrum is schematic: the colored strips are the typical regions of the bands.
The vibration is slowed down 3 × 10¹³ times: 1 second on screen is about 33 fs for the bond. This way you can compare the speeds of different bonds by eye. The amplitude is enlarged so that it is visible.
Exactly like an experimental isotope exchange: the same bond, only the mass changes. Where does the band shift?
Keep the atoms fixed and change only k, for example from C–O to C=O.
A trick used in MD: make the mass of hydrogen 3 u. What happens to the vibration and the allowed Δt?
Here the bond you built in the workshop is computed with the velocity Verlet integrator, the method used by MD programs (harmonic approximation). Slide Δt; every place where you release the slider is added to the notebook below as a trial.
Top: the positions computed by the integrator, one dot per Δt. Bottom: the relative deviation of the total energy from its initial value over 20 vibrations. In a real molecule this energy does not change; the whole deviation is numerical error coming from the calculation interval. In a stable run the error always stays below zero: the bond is released from its longest, motionless state, and starting from this phase the velocity-Verlet energy only swings downwards.
On one bond, try at least four Δt values that differ considerably from each other.
Increase Δt until the calculation blows up, then narrow the limit from both sides.
Make trials on two different bonds, then switch the horizontal axis to "calculations per period".
In a protein all these bonds are present at once, and the time step is set by the fastest vibration. A commonly used rule in practice is to limit the step to one fifth of the period of the fastest vibration (the T/5 rule: at least five steps per period); the grompp stage of GROMACS warns by this rule too. It is a safety margin established by experience; the limit that cannot be crossed is T/π (blow-up). You can see the counterpart on the bench: at Δt = T/10 the energy error is about 10%, at T/5 about four times that (the error grows with Δt²). T/5 is an upper limit, not a comfortable setting.
| Bond | ν̃ (cm⁻¹) | Period T (fs) | Blow-up limit ≈ T/π (fs) | grompp limit T/5 (fs) | T/10 (fs) | Energy error at 2 fs |
|---|
Bonds involving H (O–H, N–H, C–H) are the fastest, because hydrogen is very light. A protein computed with them needs Δt ≈ 0.5 to 1 fs. MD programs use two routes:
Constraints: The lengths of these bonds are fixed (SHAKE, LINCS, SETTLE). Once their vibration is removed from the calculation, the fastest remaining vibrations are those of about 20 fs, such as C=O (with this page's spring constant; in this project's ubiquitin topology the fastest free bond is 22.21 fs, T/5 = 4.44 fs), and Δt = 2 fs can be used comfortably.
Hydrogen mass repartitioning (HMR): The trick you tried in the workshop. Mass is taken from the bonded heavy atom and given to the hydrogen (the total mass does not change). The vibrations slow down; together with constraints, up to 4 fs becomes possible. The masses are artificial, so conclusions about the speed of the dynamics (such as diffusion) must be interpreted with care.
The last column of the table has just been computed with the harmonic model on this page. Real bonds are anharmonic and vibrations in a protein are coupled to each other; the numbers are therefore rules of thumb, not the energy error of a protein itself. The spring constants in the table are textbook values. In this project's ubiquitin topology (amber99sb-ildn) the periods are somewhat different: O–H 8.99 fs, backbone N–H 10.11 fs, backbone C=O 23.83 fs (about 1,400 cm⁻¹; the C=O spring of this force field does not by itself give the amide I band). The bond-by-bond detail is in the MD-DT module.
Model: diatomic harmonic oscillator. ν̃ = (1/2πc)·√(k/μ), T = 1/(c·ν̃); velocity Verlet. The force constants are approximate textbook values; the computed band positions fall in the same region as typical measurements but do not replace the spectrum of a molecule. Your notebook is stored only in this browser.
An MD program computes the forces at every time step, but writes a frame to the trajectory file only at certain intervals. The saving interval does not change the accuracy of the calculation; it changes what you can see afterwards. In this lab you will save first a vibration and then a real simulation from this book at sparse intervals, and measure what is lost.
A hint from experience: in films, a fast-spinning car wheel sometimes seems to slow down, stop or even turn backwards. The camera takes a fixed number of frames per second; if the wheel makes almost a full turn between two frames, it appears to stand still in the frames. An MD trajectory is the same: the program computes the motion at every step but writes a frame to the file only at certain intervals. Choose a bond and slide the saving interval.
On the same bond, bring the saving interval slightly below and slightly above half the period. When does the apparent period start to be wrong?
Exactly like the wheel standing still in a film: make the saving interval equal to the period.
Make the saving interval slightly longer than the period. What do you see in the frames?
Run 1 of this book's alanine dipeptide pilot: GROMACS 2026.3, 2 fs calculation step, 10 ns. The program wrote a frame every 500 steps, that is every 1 ps (nstxout-compressed = 500), and saved only the dipeptide. Below are the dipeptide's ψ angle (or φ, if you like) and its conformation in every frame (αR, β, αL; definitions as in MD-U). ψ separates αR from β: the dashed lines are the edges of the αR band (−120° and 50°); the color changes in the strip below are the moments when ψ crosses these lines. What would we have seen if we had saved more sparsely? Choose a saving interval; the page subsamples the same data at that interval.
Whatever you choose, the calculation is the same run with a 2 fs step; only the frames written to the file change.
Every interval you choose on the bench is added here as a trial. Both quantities are divided by their values at 1 ps: 1 means that thinning out the saving changed nothing.
Try at least three intervals, one of them 100 ps or sparser. How much did the αR fraction change?
What happened to the number of state changes counted in the same trials?
Compare the file sizes of 1 ps and a sparse interval.
| Question | Rule for the saving interval | In the pilot data |
|---|
The saving interval does not change the accuracy of the calculation: the forces are computed every 2 fs, and the frames are only stored. But it determines which questions you can ask afterwards; a frame that was not written cannot be recovered. In GROMACS the relevant settings are nstxout-compressed (the number of steps between written positions), compressed-x-grps (which atoms are written) and nstenergy (the interval for the energy terms). In the pilot, positions and energies were written every 500 steps (1 ps); positions only for the dipeptide.
Model and data: in the stroboscope the vibration is a cosine, with periods from the formula of Lab 2; the apparent period is computed from sampling theory (aliasing) and is shown as "seems to stand still" if it exceeds 50 times the period. The data on the bench come from this book's alanine dipeptide pilot; the state definitions are as in MD-U (αL: φ ≥ 0; αR: φ < 0 and −120° ≤ ψ < 50°; β: the rest). Your notebook is stored only in this browser.
Next module, MD-PBC: instead of a single particle as on this page, we will put thousands of atoms into a small box and decide what happens at the edge of the box.
About this page. Interactive edition for CH02. The numbers on this page are being computed in your browser right now; the data of Lab 3 come from this project's alanine dipeptide pilot (GROMACS 2026.3). The models in Labs 1 and 2 are teaching models; their details are given below each lab.
The definition of each term and the other modules where it appears are in the glossary.