|
1 | | -export TimeDependentOperatorSum |
2 | 1 | export TimeEvolutionSol, TimeEvolutionMCSol, TimeEvolutionSSESol |
3 | 2 |
|
4 | 3 | export liouvillian, liouvillian_floquet, liouvillian_generalized |
@@ -166,45 +165,6 @@ struct DiscreteLindbladJumpCallback <: LindbladJumpCallbackType end |
166 | 165 |
|
167 | 166 | ContinuousLindbladJumpCallback(; interp_points::Int = 10) = ContinuousLindbladJumpCallback(interp_points) |
168 | 167 |
|
169 | | -## Time-dependent sum of operators |
170 | | - |
171 | | -struct TimeDependentOperatorSum{CFT,OST<:OperatorSum} |
172 | | - coefficient_functions::CFT |
173 | | - operator_sum::OST |
174 | | -end |
175 | | - |
176 | | -function TimeDependentOperatorSum( |
177 | | - coefficient_functions, |
178 | | - operators::Union{AbstractVector{<:QuantumObject},Tuple}; |
179 | | - params = nothing, |
180 | | - init_time = 0.0, |
181 | | -) |
182 | | - # promote the type of the coefficients and the operators. Remember that the coefficient_functions si a vector of functions and the operators is a vector of QuantumObjects |
183 | | - coefficients = [f(init_time, params) for f in coefficient_functions] |
184 | | - operator_sum = OperatorSum(coefficients, operators) |
185 | | - return TimeDependentOperatorSum(coefficient_functions, operator_sum) |
186 | | -end |
187 | | - |
188 | | -Base.size(A::TimeDependentOperatorSum) = size(A.operator_sum) |
189 | | -Base.size(A::TimeDependentOperatorSum, inds...) = size(A.operator_sum, inds...) |
190 | | -Base.length(A::TimeDependentOperatorSum) = length(A.operator_sum) |
191 | | - |
192 | | -function op_sum_update_coefficients!(A::TimeDependentOperatorSum, t, params) |
193 | | - @inbounds @simd for i in 1:length(A.coefficient_functions) |
194 | | - A.operator_sum.coefficients[i] = A.coefficient_functions[i](t, params) |
195 | | - end |
196 | | -end |
197 | | - |
198 | | -(A::TimeDependentOperatorSum)(t, params) = (op_sum_update_coefficients!(A, t, params); A) |
199 | | - |
200 | | -@inline function LinearAlgebra.mul!(y::AbstractVector, A::TimeDependentOperatorSum, x::AbstractVector, α, β) |
201 | | - return mul!(y, A.operator_sum, x, α, β) |
202 | | -end |
203 | | - |
204 | | -function liouvillian(A::TimeDependentOperatorSum, Id_cache = I(prod(A.operator_sum.operators[1].dims))) |
205 | | - return TimeDependentOperatorSum(A.coefficient_functions, liouvillian(A.operator_sum, Id_cache)) |
206 | | -end |
207 | | - |
208 | 168 | ####################################### |
209 | 169 |
|
210 | 170 | function liouvillian_floquet( |
|
0 commit comments