Skip to content

Commit 61461e8

Browse files
Add auto_tidyup to avoid extra allocations
1 parent b1eb8bd commit 61461e8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/time_evolution/brmesolve.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,13 @@ function _brterm(
112112
ac_term = (A_mat .* spectrum) * A_mat
113113
bd_term = A_mat * (A_mat .* trans(spectrum))
114114

115+
# Remove small values before passing in the Liouville space
116+
if settings.auto_tidyup
117+
tidyup!(A_mat)
118+
tidyup!(ac_term)
119+
tidyup!(bd_term)
120+
end
121+
115122
if sec_cutoff != -1
116123
m_cut = similar(skew)
117124
map!(x -> abs(x) < sec_cutoff, m_cut, skew)

0 commit comments

Comments
 (0)