4
4
getheff_parametrized(H_par::Function, Ls_par)
5
5
```
6
6
7
- TODO: write this documentation
7
+ From the function `H_par`, which is assumed to be the parametrization of the hamiltonian, and
8
+ an array of functions `Ls` which are assumed to parametrize the jump operators, return a function
9
+ that's the parametrization of the effective Hamiltonian.
10
+
11
+ !!! note "About the Arguments"
12
+ The calculation of monitoring operator assumes that the arguments of `H_par` and the functions in
13
+ `Ls` are the same and in the same order.
14
+
8
15
"""
9
16
function getheff_parametrized (H_par:: Function , Ls_par):: Function
10
17
# here theta is expected to be a vector
22
29
expheff_derivative(Heff_par::Function, tau::Float64, theta::Vector{Float64}, dtheta::Vector{Float64})
23
30
```
24
31
25
- TODO: write this documentation
32
+ Calculate the derivative ``\\ partial_{i}e^{-i\\ tau H_e(\\ theta)}``, where ``i`` is the ``i-th`` component
33
+ of the vector ``\\ theta``.
34
+
35
+ # Arguments
36
+ - `Heff_par::Function`: the parametrization of the effective hamiltonian
37
+ - `tau::Float64`: the time in the exponential
38
+ - `theta::Vector{Float64}`: vector with the values of the parameters at which the derivative is calculated
39
+ - `dtheta::Vector{Float64}`: the displacement vector used to calculate the derivative, if you want the derivative
40
+ respect to the ``i-th`` parameter `dtheta` must have zero entries except for `dtheta[i]`.
41
+
42
+ !!! note "Derivative order "
43
+ The derivative is calculate using the five-point stencil rule.
44
+
45
+ !!! todo "TODO: add an example"
46
+ Preferably one in which ``\\ partial_i H_e`` commutes with ``H_e``, those are easier.
26
47
"""
27
48
function expheff_derivative (Heff_par:: Function , tau:: Float64 , theta:: Vector{Float64} , dtheta:: Vector{Float64} )
28
49
f1 = exp (- 1im * tau* Heff_par ((theta + 2 * dtheta). .. ))
36
57
"""
37
58
38
59
```
39
- jumpoperators_derivatives(Ls_par, theta, dtheta)
60
+ jumpoperators_derivatives(Ls_par, theta::Vector{Float64} , dtheta::Vector{Float64} )
40
61
```
41
62
42
- TODO: write this documentation
63
+ Calculate the derivatives of the list of jump operators, the logic is the same as
64
+ for `expheff_derivative`.
65
+
43
66
"""
44
- function jumpoperators_derivatives (Ls_par, theta, dtheta)
67
+ function jumpoperators_derivatives (Ls_par, theta:: Vector{Float64} , dtheta:: Vector{Float64} )
45
68
nchannels = size (Ls_par)[1 ]
46
69
nlevels = size (Ls_par[1 ](theta... ))[1 ]
47
70
dLs = zeros (ComplexF64, nlevels, nlevels, nchannels)
@@ -55,6 +78,7 @@ function jumpoperators_derivatives(Ls_par, theta, dtheta)
55
78
return dLs
56
79
end
57
80
81
+
58
82
"""
59
83
60
84
```
@@ -64,7 +88,13 @@ writederivative!(dpsi::SubArray{ComplexF64, 1}, L::Matrix{ComplexF64},
64
88
psi0::Vector{ComplexF64})
65
89
```
66
90
67
- TODO: write this documentation
91
+ Writes the derivative of ``|\\ psi\\ rangle = L(\\ theta)V(\\ theta)|\\ psi_0\\ rangle ``
92
+ at ``\\ theta`` in the subarray `dpsi` respect to the ``i-th`` component of ``theta``,
93
+ following the same logic as `expheff_derivative`. The derivatives of ``V`` and ``L`` at
94
+ must be provided via `dL` and `dV`.
95
+
96
+ !!! note "Initial State dependency"
97
+ This is intended to be used when ``|\\ psi_0\\ rangle`` doesn't have dependeny on ``\\ theta``.
68
98
"""
69
99
function writederivative! (dpsi:: SubArray{ComplexF64, 1} ,
70
100
L:: Matrix{ComplexF64} ,
@@ -85,7 +115,12 @@ writederivative!(dpsi::SubArray{ComplexF64, 1},
85
115
dpsi0::SubArray{ComplexF64, 1})
86
116
```
87
117
88
- TODO: write this documentation
118
+ Writes the derivative of ``|\\ psi\\ rangle = L(\\ theta)V(\\ theta)|\\ psi_0\\ rangle ``
119
+ at ``\\ theta`` in the subarray `dpsi` respect to the ``i-th`` component of ``theta``,
120
+ following the same logic as `expheff_derivative`. The derivatives of ``V`` and ``L`` at
121
+ must be provided via `dL` and `dV`, and also that of ``|\\ psi0\\ rangle`` as `dpsi0`.
122
+
123
+
89
124
"""
90
125
function writederivative! (dpsi:: SubArray{ComplexF64, 1} ,
91
126
L:: Matrix{ComplexF64} ,
0 commit comments