---
jupytext:
  encoding: '# -*- coding: utf-8 -*-'
  formats: md:myst,ipynb
  text_representation:
    extension: .md
    format_name: myst
    format_version: 0.13
    jupytext_version: 1.16.4
kernelspec:
  display_name: Python 3 (ipykernel)
  language: python
  name: python3
---

```{code-cell}
:tags: [hide-input]
import mmf_setup; mmf_setup.nbinit()
import os, sys
from pathlib import Path
FIG_DIR = Path(mmf_setup.ROOT) / '../Docs/_build/figures/'
os.makedirs(FIG_DIR, exist_ok=True)
import logging; logging.getLogger("matplotlib").setLevel(logging.CRITICAL)
%matplotlib inline
import numpy as np, matplotlib.pyplot as plt
try: from myst_nb import glue
except: glue = None

from matplotlib.animation import FuncAnimation
from phys_581.contexts import FPS
```


(sec:StochasticProcesses)=
# Stochastic Processes

Stochastic processes and stochastic differential equations play a key role in extending
classical and quantum mean-field models to include thermal and/or quantum fluctuations.
The general strategy is to include a stochastic (noise) term with specific statistical
properties.

## References
These notes are currently just a stub, and will be fleshed out in future versions of
this course, but here are some references to get you started:

* {cite}`Higham:2001`: A fantastic short and practical introduction to the numerical
  simulation of stochastic differential equations.
* {cite}`Evans:2013`: A very short but quite complete mathematical introduction.
* {cite}`Kampen:2007`: A longer but more gentle introduction to the theory.

## Example: Brownian Motion

To whet your appetite, consider the problem of Brownian motion, starting in 1D.  The
discretized process can be described by stochastic difference equation (using the
notation from {cite}`Higham:2001`):
\begin{gather*}
  W_{j} - W_{j-1} = \d{W}_{j} = \sqrt{\delta t} \eta, \qquad
  \eta \sim N(0, 1).
\end{gather*}
Here $\eta \sim N(\mu=0, \sigma=1)$ is a normally distributed random variable with mean
$\mu = 0$ and standard deviation $\sigma = 1$.

Consider now the limit of $\delta t \rightarrow 0$. Does the this limit exist?  If so,
we might write this as a stochastic differential equation:
\begin{gather*}
  \dot{W} = \xi.
\end{gather*}
What type of random variable is $\xi$?





