From e56ced7b1cfbabf7d7345262dff0a96b05063d42 Mon Sep 17 00:00:00 2001 From: Alberto Mercurio Date: Mon, 23 Oct 2023 21:50:49 +0200 Subject: [PATCH] Changed liouvillian_generalized and package vers --- Project.toml | 2 +- src/time_evolution/time_evolution.jl | 27 +++++++++++++-------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Project.toml b/Project.toml index b9c69b7c..7b9cb991 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "QuPhys" uuid = "6c2fb7c5-b903-41d2-bc5e-5a7c320b9fab" authors = ["Alberto Mercurio"] -version = "0.4.0" +version = "0.5.0" [deps] DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def" diff --git a/src/time_evolution/time_evolution.jl b/src/time_evolution/time_evolution.jl index 21531bc8..a85974b2 100644 --- a/src/time_evolution/time_evolution.jl +++ b/src/time_evolution/time_evolution.jl @@ -725,6 +725,19 @@ function liouvillian_generalized(H::QuantumObject{<:AbstractArray, OperatorQuant Ω = E' .- E Ωp = triu(dense_to_sparse(Ω, tol), 1) + # Filter in the Hilbert space + σ = isnothing(σ_filter) ? 500 * maximum([norm(field) / length(field) for field in fields]) : σ_filter + F1 = QuantumObject(gaussian.(Ω, 0, σ), dims=dims) + F1 = dense_to_sparse(F1, tol) + + # Filter in the Liouville space + M1 = ones(N_trunc, N_trunc) + Ω1 = kron(Ω, M1) + Ω2 = kron(M1, Ω) + Ωdiff = Ω1 .- Ω2 + F2 = QuantumObject(gaussian.(Ωdiff, 0, σ), SuperOperatorQuantumObject, dims) + F2 = dense_to_sparse(F2, tol) + L = liouvillian(H_d) for i in eachindex(fields) @@ -734,19 +747,6 @@ function liouvillian_generalized(H::QuantumObject{<:AbstractArray, OperatorQuant X_op = (X_op + X_op') / 2 # Make sure it's hermitian end - # Filter in the Hilbert space - σ = isnothing(σ_filter) ? 500 * norm(X_op) / length(X_op) : σ_filter - F1 = QuantumObject(gaussian.(Ω, 0, σ), dims=dims) - F1 = dense_to_sparse(F1, tol) - - # Filter in the Liouville space - M1 = ones(N_trunc, N_trunc) - Ω1 = kron(Ω, M1) - Ω2 = kron(M1, Ω) - Ωdiff = Ω1 .- Ω2 - F2 = QuantumObject(gaussian.(Ωdiff, 0, σ), SuperOperatorQuantumObject, dims) - F2 = dense_to_sparse(F2, tol) - # Ohmic reservoir N_th = n_th.(Ωp, T_list[i]) Sp₀ = QuantumObject( triu(X_op, 1), dims=dims ) @@ -756,7 +756,6 @@ function liouvillian_generalized(H::QuantumObject{<:AbstractArray, OperatorQuant L += 1 / 2 * ( F2 .* (sprepost(Sp₁', Sp₀) + sprepost(Sp₀', Sp₁)) - spre(F1 .* (Sp₀ * Sp₁')) - spost(F1 .* (Sp₁ * Sp₀')) ) L += 1 / 2 * ( F2 .* (sprepost(Sp₂, Sp₀') + sprepost(Sp₀, Sp₂')) - spre(F1 .* (Sp₀' * Sp₂)) - spost(F1 .* (Sp₂' * Sp₀)) ) - L += T_list[i] / 4 * ( 4 * sprepost(S0, S0) - 2 * spre(S0 * S0) - 2 * spost(S0 * S0) ) end return E, U, L