Skip to content

Quantum Thermodynamics Toy Models

This notebook guide specifies a reproducible finite-dimensional calculation for quantum thermodynamics toy models. The baseline notebook should build the two-point measurement work distribution for a driven two-level system, compute exact branch probabilities, sample synthetic experimental records, and verify a simple quantum Jarzynski equality and Crooks relation numerically.

As of this review, no executable notebook under notebooks/density-open-systems/quantum-thermodynamics-toy-models/ is promoted as a reproduced artifact. This page is the admission contract for that notebook: it states the model, work convention, fluctuation-relation checks, Monte Carlo diagnostics, and accepted outputs required before thermodynamic numerical claims should be cited.

The notebook should demonstrate how to:

  • construct thermal populations for a finite two-level Hamiltonian;
  • implement the Two-Point Measurement Scheme;
  • compute a discrete Work Distribution from branch probabilities;
  • drive the system with a simple unitary transition matrix;
  • verify normalization, positivity, and detailed branch bookkeeping;
  • compute ⟨e−βW⟩\langle e^{-\beta W}\rangle and compare it with e−βΔFe^{-\beta\Delta F};
  • verify a Crooks branch-ratio check for the matching reverse protocol;
  • compare exact sums with finite-sample Monte Carlo estimates;
  • record conventions clearly enough that signs of work and free energy are not ambiguous.

The first version should be a closed-system TPM notebook. Lindblad heat exchange, quantum-jump thermodynamics, feedback, and continuously monitored work definitions should be added only after the closed finite-dimensional baseline is reproducible.

Use a dedicated directory:

notebooks/density-open-systems/quantum-thermodynamics-toy-models/
quantum-thermodynamics-toy-models.ipynb
README.md

The opening notebook cell or README.md should state:

  • Python and package versions;
  • basis ordering;
  • energy convention and units;
  • inverse temperature β\beta;
  • forward and reverse Hamiltonians;
  • transition-unitary convention;
  • sign convention for work;
  • number of Monte Carlo samples and random seed;
  • numerical tolerances for fluctuation-relation residuals;
  • date and commit identifier when the notebook is promoted.

Use two Hamiltonians with the same energy basis:

H0=ϵ0∣e⟩⟨e∣,Hτ=ϵτ∣e⟩⟨e∣.H_0 = \epsilon_0 \lvert e\rangle\langle e\rvert, \qquad H_\tau = \epsilon_\tau \lvert e\rangle\langle e\rvert .

The ground energy is set to zero in both Hamiltonians. This convention is simple but not mandatory; if another zero of energy is used, the notebook should show that the work differences are unchanged by a common energy shift applied consistently.

The partition functions are

Z0=1+e−βϵ0,Zτ=1+e−βϵτ.Z_0 = 1+e^{-\beta\epsilon_0}, \qquad Z_\tau = 1+e^{-\beta\epsilon_\tau}.

The initial Gibbs probabilities for the forward process are

pg0=1Z0,pe0=e−βϵ0Z0.p_g^0 = \frac{1}{Z_0}, \qquad p_e^0 = \frac{e^{-\beta\epsilon_0}}{Z_0}.

The equilibrium free-energy difference is encoded by

e−βΔF=ZτZ0,ΔF=−1βln⁡ZτZ0e^{-\beta\Delta F} = \frac{Z_\tau}{Z_0}, \qquad \Delta F = - \frac{1}{\beta} \ln \frac{Z_\tau}{Z_0}

for β≠0\beta\ne0. The notebook should use the partition-function ratio directly when testing the Jarzynski equality, especially if it includes high-temperature limits.

Use a unitary drive that produces transition probability rr between the two energy states:

Pg→e=Pe→g=r,Pg→g=Pe→e=1−r,0≤r≤1.P_{g\to e} = P_{e\to g} = r, \qquad P_{g\to g} = P_{e\to e} = 1-r, \qquad 0\le r\le1.

A concrete implementation is the rotation

U(θ)=e−iθσx/2,r=sin⁡2(θ2).U(\theta) = e^{-i\theta\sigma_x/2}, \qquad r=\sin^2\left(\frac{\theta}{2}\right).

The transition matrix is doubly stochastic:

∑mPm∣n=1,∑nPm∣n=1.\sum_m P_{m|n}=1, \qquad \sum_n P_{m|n}=1.

The second condition is the unitarity ingredient needed in the closed-system Jarzynski proof. The notebook should check both sums numerically rather than assuming that a matrix of numbers called probabilities is physically valid.

Use the work sign convention from Energy, Heat, and Work:

W=Emτ−En0,W = E_m^\tau-E_n^0,

where nn is the first measured energy outcome and mm is the final measured energy outcome. The four forward branches are:

BranchProbabilityWork
g→gg\to gpg0(1−r)p_g^0(1-r)00
g→eg\to epg0rp_g^0rϵτ\epsilon_\tau
e→ge\to gpe0rp_e^0r−ϵ0-\epsilon_0
e→ee\to epe0(1−r)p_e^0(1-r)ϵτ−ϵ0\epsilon_\tau-\epsilon_0

Thus

PF(W)=pg0(1−r)δ(W)+pg0r δ(W−ϵτ)+pe0r δ(W+ϵ0)+pe0(1−r)δ ⁣(W−ϵτ+ϵ0).\begin{aligned} P_F(W) = {}& p_g^0(1-r)\delta(W) + p_g^0r\,\delta(W-\epsilon_\tau) \\ &+ p_e^0r\,\delta(W+\epsilon_0) + p_e^0(1-r) \delta\!\left( W-\epsilon_\tau+\epsilon_0 \right). \end{aligned}

The exact mean work is

⟨W⟩F=pg0r ϵτ−pe0r ϵ0+pe0(1−r)(ϵτ−ϵ0).\begin{aligned} \langle W\rangle_F = {}& p_g^0r\,\epsilon_\tau - p_e^0r\,\epsilon_0 \\ &+ p_e^0(1-r) \left( \epsilon_\tau-\epsilon_0 \right). \end{aligned}

The notebook should compute the distribution from arrays of branch data, not from hard-coded symbolic formulas only. The symbolic formulas are validation targets.

For the exact branch table,

⟨e−βW⟩F=∑m,npF(m,n)e−β(Emτ−En0).\left\langle e^{-\beta W} \right\rangle_F = \sum_{m,n} p_F(m,n) e^{-\beta(E_m^\tau-E_n^0)} .

The notebook should compare this number with

e−βΔF=ZτZ0.e^{-\beta\Delta F} = \frac{Z_\tau}{Z_0}.

Report the residual

RJ=∣⟨e−βW⟩F−ZτZ0∣.R_J = \left| \left\langle e^{-\beta W}\right\rangle_F - \frac{Z_\tau}{Z_0} \right|.

For the exact finite table, RJR_J should be near floating-point roundoff. If the residual is large, common causes are:

  • the transition matrix is not doubly stochastic;
  • the sign of work is reversed;
  • Z0Z_0 and ZτZ_\tau are swapped;
  • thermal probabilities were assigned to the wrong Hamiltonian;
  • the notebook sampled records but compared one noisy Monte Carlo estimate as though it were exact.

The reverse protocol starts in the thermal state of HτH_\tau and drives back to H0H_0 with the reverse unitary. For this toy model, use the same transition probability rr for matched reverse branches:

PR(n∣m)=PF(m∣n).P_R(n|m) = P_F(m|n).

The reverse branch probability is

pR(n,m)=e−βEmτZτPR(n∣m),p_R(n,m) = \frac{e^{-\beta E_m^\tau}}{Z_\tau} P_R(n|m),

and the reverse work is

WR=En0−Emτ=−WF.W_R = E_n^0-E_m^\tau = -W_F .

For each branch with nonzero matched transition probability,

pF(m,n)pR(n,m)=eβ(Wmn−ΔF).\frac{p_F(m,n)}{p_R(n,m)} = e^{\beta(W_{mn}-\Delta F)} .

The distribution-level Crooks relation is

PF(W)PR(−W)=eβ(W−ΔF)\frac{P_F(W)}{P_R(-W)} = e^{\beta(W-\Delta F)}

when the work value identifies matching probability weight. If different branches share the same work value, the notebook should aggregate probabilities at equal work before forming the distribution ratio.

Report a branch-ratio residual such as

RC=max⁡m,n∣ln⁡pF(m,n)pR(n,m)−β(Wmn−ΔF)∣R_C = \max_{m,n} \left| \ln \frac{p_F(m,n)}{p_R(n,m)} - \beta(W_{mn}-\Delta F) \right|

over branches whose forward and reverse probabilities are both nonzero.

After the exact branch table works, sample synthetic TPM records:

  1. draw the initial energy nn from the Gibbs probabilities for H0H_0;
  2. draw the final energy mm from Pm∣nP_{m|n};
  3. store nn, mm, WmnW_{mn}, and the branch label;
  4. estimate the empirical distribution of WW;
  5. estimate ⟨W⟩\langle W\rangle and ⟨e−βW⟩\langle e^{-\beta W}\rangle with standard errors.

For NN independent records, the sample mean

A^N=1N∑j=1Ne−βWj\widehat A_N = \frac{1}{N} \sum_{j=1}^N e^{-\beta W_j}

has standard error estimated by

SE⁡(A^N)=sAN,\operatorname{SE}(\widehat A_N) = \frac{s_A}{\sqrt N},

where sAs_A is the sample standard deviation of the values e−βWje^{-\beta W_j}.

The notebook should compare the Monte Carlo estimate with the exact sum. It should not declare the fluctuation relation failed merely because rare work values are undersampled. Exponential averages are often dominated by rare branches, especially at large β\beta.

Use dimensionless parameters such as

βϵ0∈{0.5,1,2,5},ϵτϵ0∈{0.5,1,1.5,2},r∈{0,0.1,0.5,1}.\beta\epsilon_0\in\{0.5,1,2,5\}, \qquad \frac{\epsilon_\tau}{\epsilon_0}\in\{0.5,1,1.5,2\}, \qquad r\in\{0,0.1,0.5,1\}.

For each point, save:

  • Z0Z_0, ZτZ_\tau, and Zτ/Z0Z_\tau/Z_0;
  • the branch-probability table;
  • exact ⟨W⟩\langle W\rangle;
  • exact ⟨e−βW⟩\langle e^{-\beta W}\rangle;
  • RJR_J and RCR_C;
  • Monte Carlo estimates and standard errors for selected sample sizes.

The sweep should include both gentle and strongly nonequilibrium cases. For r=0r=0, the state follows the same energy label. For r=1r=1, the population branches swap. Intermediate rr gives a simple model of nonadiabatic transitions.

The promoted notebook should pass these checks.

Verify

∑m,npF(m,n)=1,pF(m,n)≥0\sum_{m,n}p_F(m,n)=1, \qquad p_F(m,n)\ge0

within numerical tolerance. Do the same for the reverse process.

Check both column and row sums:

∑mPm∣n=1,∑nPm∣n=1.\sum_m P_{m|n}=1, \qquad \sum_n P_{m|n}=1.

Column sums alone make conditional probabilities valid. Row sums are what make the transition matrix compatible with a closed finite-dimensional unitary in this simple nondegenerate setting.

If two branches produce the same work value, aggregate their probabilities before plotting a histogram or comparing PF(W)P_F(W) and PR(−W)P_R(-W). Floating-point work values should be grouped by a declared tolerance.

The exact table should satisfy

RJ≲10−12R_J \lesssim 10^{-12}

in ordinary double precision for moderate parameter values. A larger residual can be acceptable only if the notebook explains the numerical source, such as intentionally low precision.

For Monte Carlo estimates, show convergence with sample size. The exact result should fall within a few estimated standard errors once NN is large enough for the chosen parameters.

As a deliberate negative test, compute the Jarzynski residual with WW replaced by −W-W. The result should generally fail unless the protocol is specially symmetric. This test catches accidental sign conventions.

This notebook is intentionally small. Its value is not that a driven two-level system exhausts quantum thermodynamics, but that every branch, probability, work value, and fluctuation-relation residual can be inspected directly.

Several limitations should be stated clearly:

  • the baseline model is closed during the drive, so there is work but no heat exchange with a bath during the protocol;
  • the initial Gibbs state is an assumption, not the result of simulated thermalization;
  • projective energy measurements are part of the TPM definition and can disturb coherent initial states;
  • the Jarzynski equality checks the whole distribution, not just the mean work;
  • Monte Carlo failure at small sample size is not a physical violation;
  • adding a Lindblad bath requires a trajectory-level heat and entropy convention, not just the same closed-system formula.

For open trajectory formulations, use Quantum-Jump Trajectories and Fluctuation Theorems as the conceptual entry points. The present notebook should first make the closed TPM bookkeeping airtight.

A promoted version should save:

  • a branch table for each parameter point;
  • an exact work-distribution table with aggregated work values;
  • a plot of PF(W)P_F(W) for selected parameters;
  • exact Jarzynski and Crooks residual tables;
  • Monte Carlo convergence plots for ⟨e−βW⟩\langle e^{-\beta W}\rangle;
  • a warning or diagnostic for undersampled rare branches;
  • a summary file recording all conventions and tolerances.

Accepted outputs should be regenerated from a clean run. Scratch plots and exploratory parameter scans may remain in the notebook, but they should not be cited as reproduced results.

  • Replacing the final nonequilibrium state by a final thermal state in the forward process.
  • Treating work as an ordinary Hermitian observable independent of the measurement protocol.
  • Forgetting that W=Emτ−En0W=E_m^\tau-E_n^0 is a signed energy difference.
  • Swapping Z0Z_0 and ZτZ_\tau in ΔF\Delta F.
  • Verifying the Jarzynski equality with exact sums, then claiming that a small Monte Carlo sample should match equally well.
  • Using a conditional probability matrix that is column-stochastic but not compatible with a unitary transition matrix.
  • Comparing Crooks ratios before aggregating branches with the same work value.
  • Adding an open-system dissipator and expecting the closed-system TPM relation to apply without additional heat and bath entropy terms.

Show that the four forward branch probabilities sum to one.

Solution

The branch probabilities are

pg0(1−r),pg0r,pe0r,pe0(1−r).p_g^0(1-r), \quad p_g^0r, \quad p_e^0r, \quad p_e^0(1-r).

Their sum is

pg0[(1−r)+r]+pe0[r+(1−r)]=pg0+pe0=1.p_g^0[(1-r)+r] + p_e^0[r+(1-r)] = p_g^0+p_e^0 = 1.

Using the branch table, verify

⟨e−βW⟩F=ZτZ0.\left\langle e^{-\beta W}\right\rangle_F = \frac{Z_\tau}{Z_0}.
Solution

The exponential average is

⟨e−βW⟩F=pg0(1−r)+pg0re−βϵτ+pe0reβϵ0+pe0(1−r)e−β(ϵτ−ϵ0).\begin{aligned} \left\langle e^{-\beta W}\right\rangle_F = {}& p_g^0(1-r) + p_g^0r e^{-\beta\epsilon_\tau} \\ &+ p_e^0r e^{\beta\epsilon_0} + p_e^0(1-r) e^{-\beta(\epsilon_\tau-\epsilon_0)} . \end{aligned}

Substitute

pg0=1Z0,pe0=e−βϵ0Z0.p_g^0=\frac{1}{Z_0}, \qquad p_e^0=\frac{e^{-\beta\epsilon_0}}{Z_0}.

Then

⟨e−βW⟩F=1−rZ0+re−βϵτZ0+rZ0+(1−r)e−βϵτZ0=1+e−βϵτZ0=ZτZ0.\begin{aligned} \left\langle e^{-\beta W}\right\rangle_F = {}& \frac{1-r}{Z_0} + \frac{r e^{-\beta\epsilon_\tau}}{Z_0} + \frac{r}{Z_0} + \frac{(1-r)e^{-\beta\epsilon_\tau}}{Z_0} \\ = {}& \frac{1+e^{-\beta\epsilon_\tau}}{Z_0} = \frac{Z_\tau}{Z_0}. \end{aligned}

Derive

pF(m,n)pR(n,m)=eβ(Wmn−ΔF)\frac{p_F(m,n)}{p_R(n,m)} = e^{\beta(W_{mn}-\Delta F)}

for a matched branch.

Solution

For a matched branch,

pF(m,n)=e−βEn0Z0PF(m∣n),p_F(m,n) = \frac{e^{-\beta E_n^0}}{Z_0} P_F(m|n),

and

pR(n,m)=e−βEmτZτPR(n∣m).p_R(n,m) = \frac{e^{-\beta E_m^\tau}}{Z_\tau} P_R(n|m).

Microscopic reversibility in this toy model gives

PR(n∣m)=PF(m∣n).P_R(n|m)=P_F(m|n).

Therefore

pF(m,n)pR(n,m)=ZτZ0eβ(Emτ−En0).\frac{p_F(m,n)}{p_R(n,m)} = \frac{Z_\tau}{Z_0} e^{\beta(E_m^\tau-E_n^0)}.

Since

ZτZ0=e−βΔF,Wmn=Emτ−En0,\frac{Z_\tau}{Z_0} = e^{-\beta\Delta F}, \qquad W_{mn}=E_m^\tau-E_n^0,

the ratio is

eβ(Wmn−ΔF).e^{\beta(W_{mn}-\Delta F)}.

Why can ⟨e−βW⟩\langle e^{-\beta W}\rangle converge slowly in Monte Carlo sampling even when the exact branch table is tiny?

Solution

The exponential average weights negative-work branches strongly when β\beta is large. Those branches may have small probability, so a finite sample can miss them or sample them poorly. The exact sum includes their contribution automatically, but Monte Carlo estimates need enough records to resolve the rare weighted events. This is a sampling problem, not a violation of the fluctuation relation.

  • C. Jarzynski, “Nonequilibrium equality for free energy differences,” Physical Review Letters 78, 2690-2693 (1997).
  • G. E. Crooks, “Entropy production fluctuation theorem and the nonequilibrium work relation for free energy differences,” Physical Review E 60, 2721-2726 (1999).
  • H. Tasaki, “Jarzynski relations for quantum systems and some applications,” arXiv:cond-mat/0009244 (2000).
  • P. Talkner, E. Lutz, and P. Hänggi, “Fluctuation theorems: Work is not an observable,” Physical Review E 75, 050102(R) (2007).
  • M. Campisi, P. Hänggi, and P. Talkner, “Colloquium: Quantum fluctuation relations: Foundations and applications,” Reviews of Modern Physics 83, 771-791 (2011).
  • U. Seifert, “Stochastic thermodynamics, fluctuation theorems and molecular machines,” Reports on Progress in Physics 75, 126001 (2012).