Skip to content

Commit 38beb4a

Browse files
committed
implement comments by @ytdHuang
1 parent 17e0936 commit 38beb4a

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ 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-
- Add functions for `brmesolve`
10+
- Add Bloch-Redfield master equation solver. ([#473])
1111

1212
## [v0.31.1]
1313
Release date: 2025-05-16

src/time_evolution/brmesolve.jl

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,7 @@ function bloch_redfield_tensor(
4242

4343
# set fock_basis=Val(false) and change basis together at the end
4444
R1 = 0
45-
if !isempty(a_ops)
46-
R1 += mapreduce(x -> _brterm(rst, x[1], x[2], sec_cutoff, Val(false)), +, a_ops)
47-
48-
# do (a_op, spectra)
49-
# _brterm(rst, a_op, spectra, sec_cutoff, Val(false))
50-
# end
51-
end
45+
isempty(a_ops) || (R1 += mapreduce(x -> _brterm(rst, x[1], x[2], sec_cutoff, Val(false)), +, a_ops))
5246

5347
SU = sprepost(U, U') # transformation matrix from eigen basis back to fock basis
5448
if getVal(fock_basis)
@@ -109,8 +103,8 @@ function _brterm(
109103
) where {T<:QuantumObject{Operator},F<:Function}
110104
_check_br_spectra(spectra)
111105

112-
U, N = rst.vectors, prod(rst.dimensions)
113-
Id = I(N)
106+
U = rst.vectors
107+
Id = I(prod(rst.dimensions))
114108

115109
skew = @. rst.values - rst.values' |> real
116110
spectrum = spectra.(skew)

0 commit comments

Comments
 (0)