# Stochastic Solver - Photocurrent¶

Photocurrent method, like monte-carlo method, allows for simulating an individual realization of the system evolution under continuous measurement.

## Closed system¶

Photocurrent evolution have the state evolve deterministically between quantum jumps. During the deterministic part, the system evolve by schrodinger equation with a non-hermitian, norm conserving effective Hamiltonian.

(1)$H_{\rm eff}=H_{\rm sys}+ \frac{i\hbar}{2}\left( -\sum_{n}C^{+}_{n}C_{n}+ |C_{n} \psi |^2\right).$

With $$C_{n}$$, the collapse operators. This effective Hamiltonian is equivalent to the monte-carlo effective Hamiltonian with an extra term to keep the state normalized. At each time step of $$\delta t$$, the wave function has a probability

(2)$\delta p_{n} = \left<\psi(t)|C_{n}^{+}C_{n}|\psi(t)\right> \delta t$

of making a quantum jump. $$\delta t$$ must be chosen small enough to keep that probability small $$\delta p << 1$$. If multiple jumps happen at the same time step, the state become unphysical. Each jump result in a sharp variation of the state by,

(3)$\delta \psi = \left( \frac{C_n \psi} {\left| C_n \psi \right|} - \psi \right)$

The basic photocurrent method directly integrates these equations to the first-order. Starting from a state $$\left|\psi(0)\right>$$, it evolves the state according to

(4)$\delta \psi(t) = - i H_{\rm sys} \psi(t) \delta t + \sum_n \left( -\frac{C_n^{+} C_n}{2} \psi(t) \delta t + \frac{ \left| C_n \psi \right| ^2}{2} \delta t + \delta N_n \left( \frac{C_n \psi} {\left| C_n \psi \right|} - \psi \right)\right),$

for each time-step. Here $$\delta N = 1$$ with a probability of $$\delta \omega$$ and $$\delta N_n = 0$$ with a probability of $$1-\delta \omega$$.

Trajectories obtained with this algorithm are equivalent to those obtained with monte-carlo evolution (up to $$O(\delta t^2)$$). In most cases, qutip.mcsolve is more efficient than qutip.photocurrent_sesolve.

## Open system¶

Photocurrent approach allows to obtain trajectories for a system with both measured and dissipative interaction with the bath. The system evolves according to the master equation between jumps with a modified liouvillian

(5)$L_{\rm eff}(\rho(t)) = L_{\rm sys}(\rho(t)) + \sum_{n}\left( \rm{tr} \left(C_{n}^{+}C_{n} \rho C_{n}^{+}C_{n} \right) - C_{n}^{+}C_{n} \rho C_{n}^{+}C_{n} \right),$

with the probability of jumps in a time step $$\delta t$$ given by

(6)$\delta p = \rm{tr} \left( C \rho C^{+} \right) \delta t.$

After a jump, the density matrix become

$\rho' = \frac{C \rho C^{+}}{\rm{tr} \left( C \rho C^{+} \right)}.$

The evolution of the system at each time step if thus given by

(7)$\rho(t + \delta t) = \rho(t) + L_{\rm eff}(\rho) \delta t + \delta N \left(\frac{C \rho C^{+}}{\rm{tr} \left( C \rho C^{+} \right)} - \rho \right).$