%%html
<script src="https://bits.csb.pitt.edu/preamble.js"></script>
<style>:root {--jp-cell-prompt-width: 32px}</style>
Syllabus Update¶
Artificial Intelligence (AI) Use¶
AI tools (including large language models such as ChatGPT, Claude, and Copilot) may be used to assist with coursework unless otherwise specified. For example, you may use AI to help understand concepts, debug code, or determine how to accomplish a task with tools such as Python, matplotlib, PyMOL, or OpenMM. You remain responsible for understanding, verifying, and being able to explain any work you submit.
Figures, plots, molecular visualizations, and other scientific images submitted for this course must be generated directly from the underlying data or structures using conventional, reproducible computational tools. Generative AI may not be used to directly create, modify, enhance, or replace any submitted scientific figure or image.
For example, it is acceptable to ask an AI system how to write a matplotlib command to plot your data or how to use PyMOL to display a protein structure. The resulting figure, however, must be produced by running those commands on the actual data or structure. It is not acceptable to ask an AI to create or alter the figure itself.
The guiding principle is that the connection between the underlying scientific data and the submitted visualization must be direct and reproducible.
Reminders¶
| Microstate = single configuration | Macrostate = set of configurations | |
|---|---|---|
| Partition function | - | $ \hat{Z}= \int_V e^{-U(x)/k_BT} dx$ |
| Configuration energy | $U(x)$ | $\langle U \rangle = \hat{Z}^{-1} \int_V U(x)\,e^{-U(x)/k_B T} dx$ |
| Unnormalized probability | $e^{-U(x)/k_B T}$ | $e^{-F/k_B T} \propto e^{S/k_B}\,e^{-\langle U \rangle/k_B T}$ |
| Free energy | - | $F = - k_B T \ln Z$ |
| Entropy | - | $S = \frac{\langle U\rangle-F}{T} $ |
$$\Large \Delta F = \Delta U - T \Delta S$$
Here $\Delta U = \Delta \langle E \rangle $, the average energy, but the kinetic energy terms cancel so we only care about the difference in average potential energy.
$S$ is the entropy, which is related to the number of states and their probabilities - how disordered the system is.
Gibbs Entropy¶
$$S_{\large \mathrm{Gibbs}}= -k_B\sum_i p_i \ln p_i$$
What happens when $p_i = \frac{1}{N}$?
What about $p_i = Z^{-1} e^{-\frac{U(i)}{k_B T}}$ ?
Shannon Entropy (Information Theory)¶
$$\Large S_{\mathrm{Shannon}}= -\sum_i p_i \log_2 p_i$$
With $\log_2$ the units of Shannon entropy are "bits" or "Shannons."
In information theory, the entropy of a random variable quantifies the average level of uncertainty or information associated with the variable's potential states or possible outcomes. This measures the expected amount of information needed to describe the state of the variable, considering the distribution of probabilities across all potential states.
--Wikipedia)
%%html
<div id="distdisorder" style="width: 500px"></div>
<script>
var divid = '#distdisorder';
jQuery(divid).asker({
id: divid,
question: "Which distribution is most disordered (highest entropy)?",
answers: ["A","B","C"],
server: "https://bits.csb.pitt.edu/asker.js/example/asker.cgi",
charter: chartmaker})
$(".jp-InputArea .o:contains(html)").closest('.jp-InputArea').hide();
</script>
Water Free Energy¶
Consider the two systems below and the enthalpic and entropic contributions of the highlighted water molecule to the system.
| $W_1$ | $W_2$ |
|---|---|
![]() | ![]() |
%%html
<div id="waterH1" style="width: 500px"></div>
<script>
var divid = '#waterH1';
jQuery(divid).asker({
id: divid,
question: "What is the expected relationship in enthalpies (average energy)?",
answers: ["H₁ < H₂","H₁ ≈ H₂","H₁ > H₂"],
server: "https://bits.csb.pitt.edu/asker.js/example/asker.cgi",
charter: chartmaker})
$(".jp-InputArea .o:contains(html)").closest('.jp-InputArea').hide();
</script>
%%html
<div id="waterS1" style="width: 500px"></div>
<script>
var divid = '#waterS1';
jQuery(divid).asker({
id: divid,
question: "What is the expected relationship in entropies?",
answers: ["S₁ < S₂","S₁ ≈ S₂","S₁ > S₂"],
server: "https://bits.csb.pitt.edu/asker.js/example/asker.cgi",
charter: chartmaker})
$(".jp-InputArea .o:contains(html)").closest('.jp-InputArea').hide();
</script>
Water Free Energy¶
Consider this real example of a crystallographic water (1). How does it thermodynamically relate to water in bulk solvent (2)?
%%html
<div id="waterH2" style="width: 500px"></div>
<script>
var divid = '#waterH2';
jQuery(divid).asker({
id: divid,
question: "What is the expected relationship in enthalpies (average energy)?",
answers: ["H₁ < H₂","H₁ ≈ H₂","H₁ > H₂"],
server: "https://bits.csb.pitt.edu/asker.js/example/asker.cgi",
charter: chartmaker})
$(".jp-InputArea .o:contains(html)").closest('.jp-InputArea').hide();
</script>
%%html
<div id="waterS2" style="width: 500px"></div>
<script>
var divid = '#waterS2';
jQuery(divid).asker({
id: divid,
question: "What is the expected relationship in entropies?",
answers: ["S₁ < S₂","S₁ ≈ S₂","S₁ > S₂"],
server: "https://bits.csb.pitt.edu/asker.js/example/asker.cgi",
charter: chartmaker})
$(".jp-InputArea .o:contains(html)").closest('.jp-InputArea').hide();
</script>
Factor Xa, an active serine protease responsible for turning prothrombin into thrombin in the blood clotting cascade.
v.show()
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
Fatty acid binding protein 4 (FABP4)¶
Transports fatty acids within cells. Important for metabolism and inflammation (through regulation of signaling molecules).
FABP4 Inhibitors 16di and 16do¶
v.show()
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
Hint: The main difference in these structures is not the protein-ligand interactions but the solvent-solvent interactions.
%%html
<div id="fab4H" style="width: 500px"></div>
<script>
var divid = '#fab4H';
jQuery(divid).asker({
id: divid,
question: "What is the expected relationship in enthalpies (average energy)?",
answers: ["16di(c) < 16do(g)","16di(c) ≈ 16do(g)","16di(c) > 16do(g)"],
server: "https://bits.csb.pitt.edu/asker.js/example/asker.cgi",
charter: chartmaker})
$(".jp-InputArea .o:contains(html)").closest('.jp-InputArea').hide();
</script>
%%html
<div id="fab4S" style="width: 500px"></div>
<script>
var divid = '#fab4S';
jQuery(divid).asker({
id: divid,
question: "What is the expected relationship in entropies?",
answers: ["16di(c) < 16do(g)","16di(c) ≈ 16do(g)","16di(c) > 16do(g)"],
server: "https://bits.csb.pitt.edu/asker.js/example/asker.cgi",
charter: chartmaker})
$(".jp-InputArea .o:contains(html)").closest('.jp-InputArea').hide();
</script>
$$\Large \Delta G_{\mathrm{bind}} \neq \text{"strength of protein-ligand interactions"}$$
Entropy-Enthalpy Compensation¶
An observed phenomenon where the entropic and enthalpic contributions to binding vary substantially and in an opposing manner as the ligand is modified.
Olsson TS, Williams MA, Pitt WR, Ladbury JE. The thermodynamics of protein–ligand interaction and solvation: insights for ligand design. Journal of molecular biology. 2008 Dec 26;384(4):1002-17.
Thermodynamics¶
...is taking derivatives...
%%html
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/tuxbMfKO9Pg?start=1"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen>
</iframe>
Thermodynamic Temperature¶
$$\Large \frac{1}{T} = \left ( \frac{d S}{dE} \right )_{N,V}$$
Average Energy as a Derivative¶
Let's take the derivative of the partition function with respect to temperature and see what happens...
$$\Large \frac{\partial Z}{\partial T} = \frac{\partial}{\partial T} \int e^{\frac{-E(x,p)}{k_B T}} dx dp = \int \frac{\partial}{\partial T} e^{\frac{-E(x,p)}{k_B T}} dx dp$$
$$\Large \frac{\partial Z}{\partial T} = \int \frac{E(x,p)}{k_B T^2 } e^{\frac{-E(x,p)}{k_B T}} dx dp = \frac{1}{k_B T^2 } \int E(x,p) e^{\frac{-E(x,p)}{k_B T}} dx dp$$
$$\Large \frac{\partial \ln Z}{\partial T} = \frac{1}{Z}\frac{\partial Z}{\partial T} = \frac{1}{k_B T^2 } \frac{ \int E(x,p) e^{\frac{-E(x,p)}{k_B T}} dx dp}{ \int e^{\frac{-E(x,p)}{k_B T}} dx dp } = \frac{1}{k_B T^2 } \langle E \rangle$$ $$\Large \langle E \rangle = k_B T^2 \frac{\partial \ln Z}{\partial T} = -\frac{\partial \ln Z}{\partial \beta} = \frac{\partial \beta F}{\partial \beta}$$
Entropy as a Derivative¶
$$\Large \frac{\partial F}{\partial T} = \frac{\partial}{\partial T} \left ( -k_BT\ln Z \right)$$
Reminder: $Z$ is a function of temperature.
$$\Large \frac{\partial F}{\partial T} = -k_B\ln Z -k_BT \frac{\partial}{\partial T} \ln Z$$
$$\Large \frac{\partial F}{\partial T} = \frac{F}{T} - \frac{\langle E \rangle}{T}$$
$$\Large S = -\frac{\partial F}{\partial T} = \frac{\langle E \rangle - F}{T}$$
Second Derivatives Compute Variance¶
$$ \frac{\partial^2 \ln Z}{\partial \beta^2} = \frac{\partial}{\partial \beta} \left ( \frac{1}{Z} \frac{\partial Z}{\partial \beta} \right ) = \frac{\partial}{\partial \beta} \frac{ \int -E(x,p) e^{-\beta E(x,p)} dx dp } { \int e^{-\beta E(x,p)}dx dp} $$
$$ = \frac{ \frac{\partial}{\partial \beta} \int -E(x,p) e^{-\beta E(x,p)} dx dp}{Z} + \int -E(x,p) e^{-\beta E(x,p)} dx dp \left ( \frac{\partial}{\partial \beta} Z^{-1} \right)$$
$$ = \frac{\int E(x,p)^2 e^{-\beta E(x,p)}}{Z} + \int -E(x,p) e^{-\beta E(x,p)} dx dp \left( -Z^{-2} \frac{\partial}{\partial \beta} Z \right)$$
Second Derivatives Compute Variance¶
$$\frac{\partial^2 \ln Z}{\partial \beta^2} = \frac{\int E(x,p)^2 e^{-\beta E(x,p)}}{Z} + \frac{ \left( \int -E(x,p) e^{-\beta E(x,p)} dx dp \right) \left( \int -E(x,p) e^{-\beta E(x,p)} dx dp\right)}{-Z^2}$$
$$\Large = \langle E^2 \rangle - \langle E \rangle ^2$$
$$\Large = \mathrm{Var}(E) = \sigma^2_E = \frac{\partial^2 \ln Z}{\partial \beta^2}$$
Heat Capacity¶
The amount of heat needed to be added to an object to raise the temperature one degree. Specific heat capacity is per unit mass; molar heat capacity is per mole.
$$ \Large C_V = \dfrac{\partial \langle E \rangle}{\partial T} = \frac{\partial \beta}{\partial T} \dfrac{\partial \langle E \rangle }{\partial \beta} = \left( -\frac{1}{k_B T^2} \right) \left(\frac{\partial}{\partial \beta} \frac{-\partial \ln Z}{\partial \beta} \right) $$
$$\Large = \dfrac{1}{k_BT^2} \dfrac{\partial^2}{\partial \beta^2} \: \ln Z = \frac{\sigma^2_E}{k_B T^2}$$
Heat capacity is proportional to the variance in the internal energy.
Differential Scanning Calorimetry¶
Measure the amount of heat needed to raise the temperature of a sample. The peak is when the variance of the energy is high.
For a protein in solution, what does this mean?
*What we are actually measuring is $C_P$
https://www.tainstruments.com/applications-notes/characterizing-protein-stability-by-dsc-mc175/
%%html
<div id="Tmmean" style="width: 500px"></div>
<script>
var divid = '#Tmmean';
jQuery(divid).asker({
id: divid,
question: "A higher Tm (peak at higher temperature) means a protein is",
answers: ["More Stable","Less Stable"],
server: "https://bits.csb.pitt.edu/asker.js/example/asker.cgi",
charter: chartmaker})
$(".jp-InputArea .o:contains(html)").closest('.jp-InputArea').hide();
</script>
%%html
<div id="Tmchange" style="width: 500px"></div>
<script>
var divid = '#Tmchange';
jQuery(divid).asker({
id: divid,
question: "What do you expect to happen to the Tm of a protein if we measure it when bound to a ligand?",
answers: ["Decrease","Stay the Same","Increase","Unknown"],
server: "https://bits.csb.pitt.edu/asker.js/example/asker.cgi",
charter: chartmaker})
$(".jp-InputArea .o:contains(html)").closest('.jp-InputArea').hide();
</script>
What do you think is happening here?¶
From stat mech to thermo¶
The partition function connects microscopic states to macroscopic thermodynamics.
Statistical mechanics describes the mathematical constructs that generate observable and important properties of molecules such as protein stability (melting point temperature).
Although Boltzmann (probably) couldn't imagine such a thing, we can use these mathematical constructs to compute these quantities.
Multidimensional Statistical Mechanics¶
One "atom" in two dimensions¶
Let's compute the partition function for a single particle constrained to a square box with side length $L$ that has no interactions ($U(x,y) = 0$).
$$ Z = \frac{1}{h^2} \int\limits_{-\infty}^{\infty}dp_x \int\limits_{-\infty}^{\infty} dp_y \int\limits_{0}^{L} d_x \int\limits_{0}^{L} dy \,e^{-\frac{ \frac{p_x^2}{2m} + \frac{p_y^2}{2m} + U(x,y)}{k_BT}}$$
Good news! The momentum terms still factor out.
$$Z = \left( \frac{1}{h} \int\limits_{-\infty}^{\infty}dp_x \,e^{-\frac{ \frac{p_x^2}{2m}}{k_BT}} \right) \left( \frac{1}{h} \int\limits_{-\infty}^{\infty}dp_y \,e^{-\frac{ \frac{p_y^2}{2m}}{k_BT}} \right) \int\limits_{0}^{L} d_x \int\limits_{0}^{L} dy \,e^{-\frac{ U(x,y)}{k_BT}} = \frac{1}{\lambda^2} \int\limits_{0}^{L} d_x \int\limits_{0}^{L} dy \,e^{-\frac{ U(x,y)}{k_BT}}$$
One "atom" in two dimensions¶
For $U(x,y) = 0$
$$\Large Z = \frac{1}{\lambda^2} \int\limits_{0}^{L} dx \int\limits_{0}^{L} dy \, 1 = \frac{L^2}{\lambda^2}$$
One "atom" in two dimensions¶
$$\langle U \rangle = 0$$
$$\langle KE \rangle = k_BT$$
$$S = \frac{\langle E \rangle - F}{T} = \frac{k_BT - (-k_BT \ln Z)}{T} = k_B \left( 1 + \ln \left( \frac{L^2}{\lambda^2} \right) \right)$$
$$\Large S \approx k_B \ln \left( \frac{L^2}{\lambda^2} \right) $$
Two particles¶
Particles are still non-interacting: $U(x^A, y^A, x^B, y^B) = 0$.
$$ \begin{align*} Z &= \left( \frac{1}{h} \int_{-\infty}^{+\infty} dp_x^A e^{-\left[(p_x^A)^2 / 2m_A\right] / k_B T} \right) \left( \frac{1}{h} \int_{-\infty}^{+\infty} dp_y^A e^{-\left[(p_y^A)^2 / 2m_A\right] / k_B T} \right) \\ &\quad \times \left( \frac{1}{h} \int_{-\infty}^{+\infty} dp_x^B e^{-\left[(p_x^B)^2 / 2m_B\right] / k_B T} \right) \left( \frac{1}{h} \int_{-\infty}^{+\infty} dp_y^B e^{-\left[(p_y^B)^2 / 2m_B\right] / k_B T} \right) \\ &\quad \times \int_0^L dx^A \int_0^L dy^A \int_0^L dx^B \int_0^L dy^B \exp\left[-\frac{U(x^A, y^A, x^B, y^B)}{k_B T}\right] \\ &= \frac{L^4}{\lambda_A^2 \lambda_B^2}. \end{align*} $$
$$\Large S \approx k_B \ln \frac{L^4}{\lambda_A^2 \lambda_B^2} = k_B \left[ \ln \left( \frac{L^2}{\lambda_A^2} \right) + \ln \left( \frac{L^2}{\lambda_B^2} \right) \right]$$
Diatomic "molecule" in 2D¶
Assume the two particles are connected by a spring with constant $\kappa$ so that the potential energy in terms of the distances between them, $r$, is $$U = \frac{1}{2}\kappa (r - r_0)^2, \mathrm{where}\,\, r = \sqrt{(x^A-x^B)^2 + (y^A-y^B)^2}$$
$$ Z = \frac{1}{\lambda_A^2 \lambda_B^2} \int_0^L dx^A \int_0^L dy^A \int_0^L dx^B \int_0^L dy^B \, e^{-U(r)/k_B T}$$
Convert to polar coordinates for B relative to A.
$$\int \int \int \int dx^A dy^A dx^B dy^B = \int \int \int \int dx^A dy^A r \, dr \, d\phi$$
Change of Variables¶
In vector calculus, the Jacobian matrix of a vector-valued function of several variables is the matrix of all its first-order partial derivatives. The Jacobian can be understood by considering a unit area in the new coordinate space; and examining how that unit area transforms when mapped into xy coordinate space in which the integral is visually understood. --Wikipedia
$$\mathbf{f} : \mathbf{R}^n → {R}^m$$
$$\mathbf{J_f} = \begin{bmatrix} \dfrac{\partial \mathbf{f}}{\partial x_1} & \cdots & \dfrac{\partial \mathbf{f}}{\partial x_n} \end{bmatrix} = \begin{bmatrix} \nabla^{\mathsf{T}} f_1 \\ \vdots \\ \nabla^{\mathsf{T}} f_m \end{bmatrix} = \begin{bmatrix} \dfrac{\partial f_1}{\partial x_1} & \cdots & \dfrac{\partial f_1}{\partial x_n}\\ \vdots & \ddots & \vdots\\ \dfrac{\partial f_m}{\partial x_1} & \cdots & \dfrac{\partial f_m}{\partial x_n} \end{bmatrix}$$
Polar to Cartesian¶
$$\Large \begin{align} x &= r \cos \phi \\ y &= r \sin \phi \end{align}$$
$$\Large \mathbf J_{\mathbf F}(r, \phi) = \begin{bmatrix} \frac{\partial x}{\partial r} & \frac{\partial x}{\partial\phi}\\[0.5ex] \frac{\partial y}{\partial r} & \frac{\partial y}{\partial\phi} \end{bmatrix} = \begin{bmatrix} \cos\phi & - r\sin \phi \\ \sin\phi & r\cos \phi \end{bmatrix}$$
What is the determinant of $\mathbf J_{\mathbf F}$?
Change of Variables¶
$$\Large \iint_{\mathbf F(A)} f(x, y) \,dx \,dy = \iint_A f(r \cos \varphi, r \sin \varphi) \, r \, dr \, d\varphi $$
Diatomic "molecule" in 2D¶
$$ Z = \frac{1}{\lambda_A^2 \lambda_B^2} \int_0^L dx^A \int_0^L dy^A \int_0^{r_{\text{max}}} r \, dr \int_0^{2\pi} d\phi \, e^{-U(r)/k_B T}$$
$$ \simeq \frac{2\pi}{\lambda_A^2 \lambda_B^2} \int_0^L dx^A \int_0^L dy^A \int_0^{r_{\text{max}}} dr \, r \, e^{-\frac{\kappa(r - r_0)^2}{2k_B T}}$$
$$ \simeq \frac{2\pi L^2}{\lambda_A^2 \lambda_B^2} \int_0^{\infty} dr \, r e^{-\frac{\kappa(r - r_0)^2}{2k_B T}} \simeq \frac{2\pi L^2}{\lambda_A^2 \lambda_B^2} r_0 \int_0^{\infty} dr \, e^{-\frac{\kappa(r - r_0)^2}{2k_B T}}$$
$$\Large \simeq \frac{2\pi L^2}{\lambda_A^2 \lambda_B^2} r_0 \sqrt{\frac{2\pi k_B T}{\kappa}} $$
$$S \simeq k_B \ln Z = k_B \left[ \ln \left( \frac{L^2}{\lambda_A^2} \right) + \ln \left( \frac{ 2\pi r_0 \sqrt{2\pi k_B T / \kappa}}{\lambda_B^2} \right) \right]$$
Comparing Entropies¶
$$\Large S_\mathrm{one\ atom} \approx k_B \ln \left( \frac{L^2}{\lambda^2} \right) $$
$$\Large S_{\mathrm{two\ atom}} \approx k_B \ln \frac{L^4}{\lambda_A^2 \lambda_B^2} = k_B \left[ \ln \left( \frac{L^2}{\lambda_A^2} \right) + \ln \left( \frac{L^2}{\lambda_B^2} \right) \right]$$
$$\Large S_{\mathrm{diatomic}} \simeq k_B \ln Z = k_B \left[ \ln \left( \frac{L^2}{\lambda_A^2} \right) + \ln \left( \frac{r_0 \sqrt{2\pi k_B T / \kappa}}{\lambda_B^2} \right) \right]$$
The General Unimolecular Partition Function¶
$$\Large Z = \frac{1}{\mathcal{N}_D} \left[ \prod_{i=1}^N \lambda_i^{-3} \right] \int dx_1 \, dy_1 \, dz_1 \, \dots \, dx_N \, dy_N \, dz_N \, e^{-U(\mathbf{r}^N)/k_B T} $$
$$\Large = \frac{1}{\mathcal{N}_D} \left[ \prod_{i=1}^N \lambda_i^{-3} \right] \int d\mathbf{r}^N \, e^{-U(\mathbf{r}^N)/k_B T}$$
where $\mathcal{N}_D$ is the degeneracy number that prevents overcounting of of indistinguishable states and $\mathbf{r}^N$ is the position vector $(x_1,y_1,z_1,\cdots,x_N,y_N,z_N$).
Problem: For any useful energy potential, $U(\mathbf{r}^N)$ cannot be factored into separable components and this integral has no closed form solution.
%%html
<div id="gridZ" style="width: 500px"></div>
<script>
var divid = '#gridZ';
jQuery(divid).asker({
id: divid,
question: "Suppose we want to numerically integrate the general unimolecular partition function for a molecule with $N$ atoms using a cubic grid with side lengths 100Å and a 0.1Å resolution. How many energy evaluations do I need to perform?",
answers: ["3000N","N^1000","1000^(3N)","10^(3N)"],
server: "https://bits.csb.pitt.edu/asker.js/example/asker.cgi",
charter: chartmaker})
$(".jp-InputArea .o:contains(html)").closest('.jp-InputArea').hide();
</script>
%%html
<div id="gridZ2" style="width: 500px"></div>
<script>
var divid = '#gridZ2';
jQuery(divid).asker({
id: divid,
question: "What will be the most common value inside the integral?",
answers: ["0","1","e","unknown"],
server: "https://bits.csb.pitt.edu/asker.js/example/asker.cgi",
charter: chartmaker})
$(".jp-InputArea .o:contains(html)").closest('.jp-InputArea').hide();
</script>



