Skip to content

Commit

Permalink
Changed liouvillian_generalized and package vers
Browse files Browse the repository at this point in the history
  • Loading branch information
albertomercurio committed Oct 23, 2023
1 parent 4e49866 commit e56ced7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
27 changes: 13 additions & 14 deletions src/time_evolution/time_evolution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 )
Expand All @@ -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
Expand Down

0 comments on commit e56ced7

Please sign in to comment.