Exported Functions
BackAction.monitoringoperator — Methodmonitoringoperator(t_given::Vector{Float64},
sys::System, Heff_par::Function, Ls_par, traj::Trajectory, psi0::Vector{ComplexF64}, theta::Vector{Float64},
dtheta::Vector{Float64})Given a trajectory traj and an initial state $|\psi_0\rangle$, calculate the monitoring state at the times in t_given. The result is returned in an array of dimensions (sys.NLEVELS, sys.NLEVELS, size(t_given)[1]), so to access it at the time t you would do monitoringoperator(t_given, sys, Heff_par, Ls_par, traj, psi0, theta, dtheta)[:, :, t].
BackAction.getheff_parametrized — Methodgetheff_parametrized(H_par::Function, Ls_par)From the function H_par, which is assumed to be the parametrization of the hamiltonian, and an array of functions Ls which are assumed to parametrize the jump operators, return a function that's the parametrization of the effective Hamiltonian.
The calculation of monitoring operator assumes that the arguments of H_par and the functions in Ls are the same and in the same order.
Internal Functions
BackAction.expheff_derivative — Methodexpheff_derivative(Heff_par::Function, tau::Float64, theta::Vector{Float64}, dtheta::Vector{Float64})Calculate the derivative $\partial_{i}e^{-i\tau H_e(\theta)}$, where $i$ is the $i-th$ component of the vector $\theta$.
Arguments
Heff_par::Function: the parametrization of the effective hamiltoniantau::Float64: the time in the exponentialtheta::Vector{Float64}: vector with the values of the parameters at which the derivative is calculateddtheta::Vector{Float64}: the displacement vector used to calculate the derivative, if you want the derivative respect to the $i-th$ parameterdthetamust have zero entries except fordtheta[i].
The derivative is calculate using the five-point stencil rule.
Preferably one in which $\partial_i H_e$ commutes with $H_e$, those are easier.
BackAction.jumpoperators_derivatives — Methodjumpoperators_derivatives(Ls_par, theta::Vector{Float64}, dtheta::Vector{Float64})Calculate the derivatives of the list of jump operators.
Arguments
Ls_par: array with the functions that represent the parametrization of the jump operatorstheta::Vector{Float64}: vector with the values of the parameters at which the derivative is calculateddtheta::Vector{Float64}: the displacement vector used to calculate the derivative, if you want the derivative respect to the $i-th$ parameterdthetamust have zero entries except fordtheta[i].
The derivative is calculate using the five-point stencil rule.
BackAction.writederivative! — Methodwritederivative!(dpsi::SubArray{ComplexF64, 1}, L::Matrix{ComplexF64},
dL::SubArray{ComplexF64, 2},
V::Matrix{ComplexF64}, dV::Matrix{ComplexF64},
psi0::Vector{ComplexF64})Writes the derivative of $|\psi\rangle = L(\theta)V(\theta)|\psi_0\rangle$ at $\theta$ in the subarray dpsi respect to the $i-th$ component of $theta$, following the same logic as expheff_derivative. The derivatives of $V$ and $L$ at must be provided via dL and dV.
This is intended to be used when $|\psi_0\rangle$ doesn't have dependeny on $\theta$.
BackAction.writederivative! — Methodwritederivative!(dpsi::SubArray{ComplexF64, 1},
L::Matrix{ComplexF64},
dL::SubArray{ComplexF64, 2},
V::Matrix{ComplexF64}, dV::Matrix{ComplexF64},
psi0::SubArray{ComplexF64, 1},
dpsi0::SubArray{ComplexF64, 1})Writes the derivative of $|\psi\rangle = L(\theta)V(\theta)|\psi_0\rangle$ at $\theta$ in the subarray dpsi respect to the $i-th$ component of $theta$, following the same logic as expheff_derivative. The derivatives of $V$ and $L$ at must be provided via dL and dV, and also that of $|\psi(0)\rangle$ as dpsi0.
BackAction.derivatives_atjumps — Methodderivatives_atjumps(sys::System, Heff_par::Function, Ls_par, traj::Trajectory, psi0::Vector{ComplexF64}, theta::Vector{Float64},
dtheta::Vector{Float64})
Given a trajectory traj calculate all the $\partial_i|\psi_n(\theta)\rangle$ where $|\psi_n(\theta)\rangle$ is the state just after the $n-th$ jump in the trajectory. They are returned as an array of dimensions (size(psi0)[1], size(traj)) so to access the derivative at the $k-th$ jump you would do derivatives_atjumps(sys, Heff_par, Ls_par, traj, psi0, theta, dtheta)[:, k].
Arguments
sys::System: the function to which the trajectory correspondsHeff_par::Function: the function that gives the parametrization of the effective hamiltonianLs_par: the array with the functions that give the parametrizatio of the jump operatorstheta::Vector{Float64}: vector with the values of the parameters at which the derivative is calculateddtheta::Vector{Float64}: the displacement vector used to calculate the derivative, if you want the derivative respect to the $i-th$ parameterdthetamust have zero entries except fordtheta[i].
The derivative is calculate using the five-point stencil rule.
BackAction.writexi! — Methodwritexi!(xi::SubArray{ComplexF64, 2}, dV::Matrix{ComplexF64},
psi::SubArray{ComplexF64, 1}, psi0::Vector{ComplexF64})Calculate the monitoring operator when $|\psi(\theta)\rangle = V|\psi_0\rangle$ and $|\psi_0\rangle$ doesn't depend on $\theta$, and write it at the SubArray xi. This is, calculate $d|\psi(\theta)\rangle = dV|\psi_0\rangle$.
BackAction.writexi! — Methodwritexi!(xi::SubArray{ComplexF64, 2}, V::Matrix{ComplexF64}, dV::Matrix{ComplexF64},
psijump::SubArray{ComplexF64, 1}, dpsijump::SubArray{ComplexF64, 1},
psi::SubArray{ComplexF64, 1})Calculate the monitoring operator when $|\psi(\theta)\rangle = V|\psi_N\rangle$ and $|\psi_N\rangle$ is a state that depends on $\theta$, the result is written at the SubArray xi. This is, calculate $d|\psi(\theta)\rangle = dV|\psi_N\rangle + Vd|\psi_N\rangle$.