Table of Contents
Mcsolve (Monte Carlo Trajectories)
Mcsolve runs stochastic trajectories of quantum evolution, applying collapse operators at random times. Each trajectory is a possible quantum history; averaging over many trajectories gives the ensemble result (matching mesolve).
Monte Carlo simulations are useful for understanding how noise manifests at the individual-event level and for systems where many collapse operators dominate.
from qutip import * import numpy as np # Simple decay H = 0.5 * sigmaz() c_ops = [0.1 * sigmam()] times = np.linspace(0, 10, 50) psi0 = basis(2, 1) # Run 1000 trajectories result = mcsolve(H, psi0, times, c_ops, [sigmaz()], ntraj=1000) # result.expect: ensemble average (matches mesolve) # result.trajectories: individual runs (if stored)
How It Works
Each trajectory evolves via an effective non-Hermitian Hamiltonian:
$$H_{\text{eff}} = H - \frac{i\hbar}{2} \sum_k L_k^\dagger L_k$$
At each step, with probability $p_k(dt)$, collapse operator $L_k$ is applied (normalized jump). Otherwise, evolution continues. After $N$ trajectories, expectations average to the master equation solution.
Advantages and Trade-offs
Advantages:
- Natural interpretation of quantum jumps
- Efficient for many collapse operators
- Can track individual quantum events
Trade-offs:
- Slower than mesolve for small $N_{\text{traj}}$ (needs many runs for good statistics)
- More memory if storing trajectories
- Statistical noise in results
Use mcsolve when you need trajectory-level understanding or when many dissipation channels dominate.
