Skip to content

Diffusive Trajectory Simulation

This notebook guide specifies a reproducible simulation of diffusive quantum trajectories for continuous weak qubit measurement. The baseline model is a monitored σz\sigma_z measurement with noisy records, stochastic state updates, state purification under monitoring, and ensemble averages that recover the unconditional master equation.

As of this review, no executable notebook under notebooks/density-open-systems/diffusive-trajectory-simulation/ is promoted as a reproduced artifact. This page is the admission contract for that notebook: it states the stochastic equation, record convention, numerical scheme, validation tests, convergence checks, and accepted outputs required before trajectories or records should be cited.

The notebook should demonstrate how to:

  • generate Wiener increments with a declared convention;
  • simulate continuous weak measurement records;
  • update a conditioned qubit density matrix with a diffusive stochastic master equation;
  • distinguish conditional trajectories from unconditional master-equation dynamics;
  • show state purification under efficient monitoring;
  • average many trajectories to recover dephasing;
  • test time-step, trajectory-number, and random-seed sensitivity;
  • diagnose trace, positivity, and Itō-convention errors.

The first version should use a single qubit and one monitored observable. More elaborate homodyne, heterodyne, and feedback examples should wait until this baseline is validated.

Use a dedicated directory:

notebooks/density-open-systems/diffusive-trajectory-simulation/
diffusive-trajectory-simulation.ipynb
README.md

The opening notebook cell or README.md should state:

  • Python and package versions;
  • basis ordering and Pauli convention;
  • stochastic calculus convention;
  • measurement strength and detection efficiency;
  • time step and total time;
  • number of trajectories;
  • random-number generator and seed;
  • normalization and positivity tolerances;
  • date and commit identifier when the notebook is promoted.

Use a continuous measurement of σz\sigma_z with collapse operator

c=κ σz,c = \sqrt{\kappa}\,\sigma_z,

where κ\kappa is the measurement-induced dephasing scale in this convention. With no Hamiltonian and no other dissipative channel, the unconditional generator is

Lρ=κD[σz]ρ,\mathcal L\rho = \kappa\mathcal D[\sigma_z]\rho,

where

D[σz]ρ=σzρσz−ρ.\mathcal D[\sigma_z]\rho = \sigma_z\rho\sigma_z-\rho.

The normalized diffusive stochastic master equation is

dρc=κD[σz]ρc dt+ηκ H[σz]ρc dWt,d\rho_c = \kappa\mathcal D[\sigma_z]\rho_c\,dt + \sqrt{\eta\kappa}\, \mathcal H[\sigma_z]\rho_c\,dW_t,

with efficiency 0≤η≤10\le\eta\le1 and

H[σz]ρ=σzρ+ρσz−2⟨σz⟩ρ.\mathcal H[\sigma_z]\rho = \sigma_z\rho+\rho\sigma_z - 2\langle\sigma_z\rangle\rho.

The corresponding record convention is

dYt=2ηκ ⟨σz⟩c dt+dWt.dY_t = 2\sqrt{\eta\kappa}\, \langle\sigma_z\rangle_c\,dt + dW_t.

The notebook must use the same convention for the SME and the record. Mixing record normalizations is one of the easiest ways to produce plausible-looking but wrong trajectories.

Generate Wiener increments as

dWn=dt ξn,ξn∼N(0,1).dW_n = \sqrt{dt}\,\xi_n, \qquad \xi_n\sim\mathcal N(0,1).

The notebook should check, for the generated increments,

1Nsteps∑ndWn≈0,1Nsteps∑ndWn2≈dt.\frac{1}{N_{\mathrm{steps}}} \sum_n dW_n \approx 0, \qquad \frac{1}{N_{\mathrm{steps}}} \sum_n dW_n^2 \approx dt.

These checks are not decorative. If the increments have variance 11 instead of dtdt, the trajectory will be wrong even if the code runs without errors.

For a first implementation, Euler-Maruyama is acceptable:

ρn+1=ρn+κD[σz]ρn dt+ηκ H[σz]ρn dWn.\rho_{n+1} = \rho_n + \kappa\mathcal D[\sigma_z]\rho_n\,dt + \sqrt{\eta\kappa}\, \mathcal H[\sigma_z]\rho_n\,dW_n.

After each step, the notebook should measure:

  • trace error;
  • Hermiticity error;
  • smallest eigenvalue;
  • purity Tr⁡ρ2\operatorname{Tr}\rho^2;
  • Bloch vector length;
  • current conditional expectation ⟨σz⟩c\langle\sigma_z\rangle_c.

Small numerical symmetrization may be used for plotting, but raw errors should be recorded before any repair. If positivity failures become visible at normal tolerances, reduce dtdt or use a more stable integrator.

For each trajectory, store the time series

ΔYn=2ηκ ⟨σz⟩n dt+dWn.\Delta Y_n = 2\sqrt{\eta\kappa}\, \langle\sigma_z\rangle_n\,dt + dW_n.

Also store the innovation estimate

ΔWn=ΔYn−2ηκ ⟨σz⟩n dt.\Delta W_n = \Delta Y_n - 2\sqrt{\eta\kappa}\, \langle\sigma_z\rangle_n\,dt.

The innovation should have zero mean and variance dtdt within sampling error. This is a central validation test: the state update must be driven by unpredictable record increments, not by the predicted signal that was already encoded in ρc\rho_c.

The unconditional master equation is pure dephasing. If

ρ(0)=(ρ00(0)ρ01(0)ρ10(0)ρ11(0)),\rho(0) = \begin{pmatrix} \rho_{00}(0)&\rho_{01}(0)\\ \rho_{10}(0)&\rho_{11}(0) \end{pmatrix},

then, under the convention above,

ρ01(t)=e−2κtρ01(0),ρ00(t)=ρ00(0).\rho_{01}(t) = e^{-2\kappa t}\rho_{01}(0), \qquad \rho_{00}(t)=\rho_{00}(0).

The notebook should average many conditioned trajectories,

ρˉN(t)=1N∑j=1Nρc(j)(t),\bar\rho_N(t) = \frac{1}{N} \sum_{j=1}^N \rho_c^{(j)}(t),

and compare ρˉN(t)\bar\rho_N(t) with the analytic unconditional solution. The maximum error should decrease as the number of trajectories increases, with the expected Monte Carlo scaling visible over a reasonable range.

Start from the maximally mixed state,

ρ(0)=12I.\rho(0)=\frac12I.

For efficient monitoring, individual conditioned states should tend toward σz\sigma_z eigenstates as the measurement record accumulates information. A useful diagnostic is the purity

P(t)=Tr⁡ρc(t)2.P(t) = \operatorname{Tr}\rho_c(t)^2.

The ensemble average can remain mixed even while individual trajectories purify. This is the main conceptual point the notebook should make: conditioning on a record changes the state assignment, while ignoring the record gives the nonselective state.

The notebook should compare at least two efficiencies, such as η=1\eta=1 and η=0.3\eta=0.3, to show how lost information weakens purification.

The accepted notebook should produce:

  • several sample measurement records ΔYn/dt\Delta Y_n/dt or binned currents;
  • sample trajectories for ⟨σz⟩c(t)\langle\sigma_z\rangle_c(t) and purity;
  • an ensemble-average density-matrix comparison with the analytic dephasing solution;
  • innovation mean and variance diagnostics;
  • convergence plots versus dtdt and number of trajectories.

Save accepted outputs under:

notebooks/density-open-systems/diffusive-trajectory-simulation/outputs/
sample-measurement-records.svg
diffusive-trajectories-purity.svg
ensemble-average-dephasing.svg
innovation-diagnostics.svg
diffusive-trajectory-validation.json

The JSON validation file should record:

  • package versions;
  • random seed;
  • κ\kappa, η\eta, dtdt, total time, and trajectory count;
  • maximum trace error;
  • minimum eigenvalue observed;
  • innovation mean and variance;
  • maximum ensemble-average error against the analytic solution;
  • whether convergence checks passed.

The notebook should include automated checks:

CheckRequired behavior
Wiener scalingsample variance of dWndW_n near dtdt
traceTr⁡ρc\operatorname{Tr}\rho_c stays near 11
Hermiticityρc−ρc†\rho_c-\rho_c^\dagger stays small
positivityeigenvalues stay nonnegative within tolerance
record conventioninnovations reconstruct generated dWndW_n
ensemble averagetrajectories recover e−2κte^{-2\kappa t} coherence decay
efficiencylower η\eta reduces conditioned purification
convergenceerrors decrease when dtdt is reduced

The notebook should deliberately include one bad-step demonstration in an appendix or disabled cell: for example, using dWn=ξndW_n=\xi_n instead of dtξn\sqrt{dt}\xi_n should fail the validation tests. This is a good way to prove the tests can catch a common stochastic-simulation bug.

  • Treating dWtdW_t as an ordinary deterministic small number.
  • Generating Gaussian increments with variance 11 instead of dtdt.
  • Updating the state with one measurement-record convention and plotting another.
  • Forgetting that ensemble averages must recover the unconditional master equation.
  • Interpreting a conditioned trajectory as a hidden classical path of the system.
  • Assuming purification occurs when the measurement record is discarded.
  • Comparing one noisy trajectory to the master equation instead of comparing the ensemble average.
  • Ignoring small positivity violations until they dominate the result.

If dW=dtξdW=\sqrt{dt}\xi with ξ∼N(0,1)\xi\sim\mathcal N(0,1), compute E[dW]\mathbb E[dW] and E[dW2]\mathbb E[dW^2].

Solution

Since E[ξ]=0\mathbb E[\xi]=0,

E[dW]=dt E[ξ]=0.\mathbb E[dW] = \sqrt{dt}\,\mathbb E[\xi] = 0.

Since E[ξ2]=1\mathbb E[\xi^2]=1,

E[dW2]=dt E[ξ2]=dt.\mathbb E[dW^2] = dt\,\mathbb E[\xi^2] = dt.

This is the numerical version of the Itō rule dWt2=dtdW_t^2=dt.

For Lρ=κ(σzρσz−ρ)\mathcal L\rho=\kappa(\sigma_z\rho\sigma_z-\rho), show that ρ˙01=−2κρ01\dot\rho_{01}=-2\kappa\rho_{01}.

Solution

In the σz\sigma_z basis,

σzρσz=(ρ00−ρ01−ρ10ρ11).\sigma_z\rho\sigma_z = \begin{pmatrix} \rho_{00}&-\rho_{01}\\ -\rho_{10}&\rho_{11} \end{pmatrix}.

Therefore

σzρσz−ρ=(0−2ρ01−2ρ100).\sigma_z\rho\sigma_z-\rho = \begin{pmatrix} 0&-2\rho_{01}\\ -2\rho_{10}&0 \end{pmatrix}.

Thus

ρ˙01=−2κρ01,\dot\rho_{01} = -2\kappa\rho_{01},

so

ρ01(t)=e−2κtρ01(0).\rho_{01}(t) = e^{-2\kappa t}\rho_{01}(0).

Given the record increment

ΔYn=2ηκ ⟨σz⟩ndt+dWn,\Delta Y_n = 2\sqrt{\eta\kappa}\, \langle\sigma_z\rangle_n dt + dW_n,

write the innovation increment.

Solution

Subtract the predicted conditional signal:

ΔWn=ΔYn−2ηκ ⟨σz⟩ndt.\Delta W_n = \Delta Y_n - 2\sqrt{\eta\kappa}\, \langle\sigma_z\rangle_n dt.

Using the record equation, this gives

ΔWn=dWn.\Delta W_n=dW_n.

Thus the innovation is the unpredictable part of the observed record.

Why can individual monitored trajectories become more pure while the ensemble average remains mixed?

Solution

The monitored trajectory is conditioned on a specific record, so the observer gains information about which σz\sigma_z eigenstate is favored. That information updates the conditional density matrix and can increase its purity. If the record is ignored, different possible records are averaged together. The average state then represents a mixture over incompatible records and can remain mixed even though each conditioned state became more definite.

  • H. M. Wiseman and G. J. Milburn, Quantum Measurement and Control, Cambridge University Press, 2010.
  • K. Jacobs, Quantum Measurement Theory and its Applications, Cambridge University Press, 2014.
  • H. J. Carmichael, An Open Systems Approach to Quantum Optics, Springer, 1993.
  • H.-P. Breuer and F. Petruccione, The Theory of Open Quantum Systems, Oxford University Press, 2002.