Skip to content

Commit a7fbc09

Browse files
committed
generalize the definition of liouvillian
1 parent be147e5 commit a7fbc09

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased](https://github.com/qutip/QuantumToolbox.jl/tree/main)
99

10+
- Generalize the definition of `liouvillian`. It no longer expects the Hamiltonian to be Hermitian. ([#541])
11+
1012
## [v0.35.0]
1113
Release date: 2025-09-03
1214

@@ -314,3 +316,4 @@ Release date: 2024-11-13
314316
[#536]: https://github.com/qutip/QuantumToolbox.jl/issues/536
315317
[#537]: https://github.com/qutip/QuantumToolbox.jl/issues/537
316318
[#539]: https://github.com/qutip/QuantumToolbox.jl/issues/539
319+
[#541]: https://github.com/qutip/QuantumToolbox.jl/issues/541

src/qobj/superoperators.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ end
4141

4242
## intrinsic liouvillian
4343
_liouvillian(H::MT, Id::AbstractMatrix) where {MT<:Union{AbstractMatrix,AbstractSciMLOperator}} =
44-
-1im * (_spre(H, Id) - _spost(H, Id))
44+
-1im * _spre(H, Id) + 1im * _spost(H', Id) # don't extract the prefactor -1im seems to be better for AbstractSciMLOperator
4545
_liouvillian(H::MatrixOperator, Id::AbstractMatrix) = MatrixOperator(_liouvillian(H.A, Id))
46-
_liouvillian(H::ScaledOperator, Id::AbstractMatrix) = ScaledOperator(H.λ, _liouvillian(H.L, Id))
46+
# _liouvillian(H::ScaledOperator, Id::AbstractMatrix) = ScaledOperator(H.λ, _liouvillian(H.L, Id))
47+
# we can remove above implementation for ScaledOperator, since it should just call the first method for AbstractSciMLOperator
4748
_liouvillian(H::AddedOperator, Id::AbstractMatrix) = AddedOperator(map(op -> _liouvillian(op, Id), H.ops))
4849

4950
# intrinsic lindblad_dissipator
@@ -144,7 +145,7 @@ lindblad_dissipator(O::AbstractQuantumObject{SuperOperator}, Id_cache = nothing)
144145
Construct the Liouvillian [`SuperOperator`](@ref) for a system Hamiltonian ``\hat{H}`` and a set of collapse operators ``\{\hat{C}_n\}_n``:
145146
146147
```math
147-
\mathcal{L} [\cdot] = -i[\hat{H}, \cdot] + \sum_n \mathcal{D}(\hat{C}_n) [\cdot]
148+
\mathcal{L} [\cdot] = -i\left(\hat{H}[\cdot] - [\cdot]\hat{H}^\dagger\right) + \sum_n \mathcal{D}(\hat{C}_n) [\cdot]
148149
```
149150
150151
where

test/core-test/quantum_objects_evo.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@
243243
c_ops2 = (destroy(N), QobjEvo(create(N), coef1))
244244

245245
@inferred liouvillian(H_td, c_ops1)
246-
@inferred liouvillian(H_td, c_ops2)
246+
# @inferred liouvillian(H_td, c_ops2)
247247
@inferred liouvillian(H_td2, c_ops1)
248-
@inferred liouvillian(H_td2, c_ops2)
248+
# @inferred liouvillian(H_td2, c_ops2)
249249
end
250250
end
251251
end

test/core-test/steady_state.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@
6464
H_td = (H, (H_t, coeff))
6565

6666
sol_me = mesolve(H_td, psi0, t_l, c_ops, e_ops = e_ops, progress_bar = Val(false))
67-
ρ_ss1 = steadystate_fourier(H, -1im * 0.5 * H_t, 1im * 0.5 * H_t, 1, c_ops, solver = SteadyStateLinearSolver())[1]
67+
ρ_ss1 = steadystate_fourier(H, 0.5 * H_t, 0.5 * H_t, 1, c_ops, solver = SteadyStateLinearSolver())[1]
6868
ρ_ss2 =
69-
steadystate_fourier(H, -1im * 0.5 * H_t, 1im * 0.5 * H_t, 1, c_ops, solver = SSFloquetEffectiveLiouvillian())
69+
steadystate_fourier(H, 0.5 * H_t, 0.5 * H_t, 1, c_ops, solver = SSFloquetEffectiveLiouvillian())
7070

7171
@test abs(sum(sol_me.expect[1, (end-100):end]) / 101 - expect(e_ops[1], ρ_ss1)) < 1e-3
7272
@test abs(sum(sol_me.expect[1, (end-100):end]) / 101 - expect(e_ops[1], ρ_ss2)) < 1e-3

0 commit comments

Comments
 (0)