Skip to content

Commit

Permalink
Update liouvillian_floquet
Browse files Browse the repository at this point in the history
  • Loading branch information
albertomercurio committed Oct 8, 2023
1 parent 2f06909 commit 4e49866
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
{
"julia.environmentPath": "/home/alberto/.julia/dev/QuPhys"
}
19 changes: 10 additions & 9 deletions src/time_evolution/time_evolution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct TimeEvolutionMCSol{TT<:Vector{<:Vector{<:Real}}, TS<:AbstractVector, TE<:
jump_which::TJW
end

LiouvillianDirectSolver(;tol=1e-8) = LiouvillianDirectSolver(tol)
LiouvillianDirectSolver(;tol=1e-16) = LiouvillianDirectSolver(tol)

function _save_func_sesolve(integrator)
internal_params = integrator.p
Expand Down Expand Up @@ -735,7 +735,7 @@ function liouvillian_generalized(H::QuantumObject{<:AbstractArray, OperatorQuant
end

# Filter in the Hilbert space
σ = σ_filter == nothing ? 10 * sum(abs2, X_op) / length(X_op) : σ_filter
σ = isnothing(σ_filter) ? 500 * norm(X_op) / length(X_op) : σ_filter
F1 = QuantumObject(gaussian.(Ω, 0, σ), dims=dims)
F1 = dense_to_sparse(F1, tol)

Expand Down Expand Up @@ -768,16 +768,17 @@ function _liouvillian_floquet(L₀::QuantumObject{<:AbstractArray{T1},SuperOpera
ω::Real, solver::LiouvillianDirectSolver; n_max::Int=4) where {T1,T2,T3}

L_0 = L₀.data
L_p = sparse_to_dense(Lₚ.data)
L_m = sparse_to_dense(Lₘ.data)
L_p = Lₚ.data
L_m = Lₘ.data
L_p_dense = sparse_to_dense(Lₚ.data)
L_m_dense = sparse_to_dense(Lₘ.data)

n_i = n_max
S = -(L_0 - 1im * n_i * ω * I) \ L_p
T = -(L_0 + 1im * n_i * ω * I) \ L_m
S = -(L_0 - 1im * n_max * ω * I) \ L_p_dense
T = -(L_0 + 1im * n_max * ω * I) \ L_m_dense

for n_i in n_max-1:-1:1
S = -(L_0 - 1im * n_i * ω * I + L_m * S) \ L_p
T = -(L_0 + 1im * n_i * ω * I + L_p * T) \ L_m
S = -(L_0 - 1im * n_i * ω * I + L_m * S) \ L_p_dense
T = -(L_0 + 1im * n_i * ω * I + L_p * T) \ L_m_dense
end

solver.tol == 0 && return QuantumObject(L_0 + L_m * S + L_p * T, SuperOperatorQuantumObject, L₀.dims)
Expand Down

0 comments on commit 4e49866

Please sign in to comment.