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:
At each step, with probability , collapse operator is applied (normalized jump). Otherwise, evolution continues. After 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 (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.
