Skip to content

Commit 0dbf9cb

Browse files
Reset previous e_ops method for mesolve
1 parent 3b1f809 commit 0dbf9cb

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/time_evolution/callback_helpers/callback_helpers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ _get_e_ops_data(e_ops, ::Type{SaveFuncSESolve}) = get_data.(e_ops)
3434
_get_e_ops_data(e_ops, ::Type{SaveFuncMESolve}) = [_generate_mesolve_e_op(op) for op in e_ops] # Broadcasting generates type instabilities on Julia v1.10
3535
_get_e_ops_data(e_ops, ::Type{SaveFuncSSESolve}) = get_data.(e_ops)
3636

37-
_generate_mesolve_e_op(op) = mat2vec(get_data(op))
37+
_generate_mesolve_e_op(op) = mat2vec(adjoint(get_data(op)))
3838

3939
#=
4040
This function add the normalization callback to the kwargs. It is needed to stabilize the integration when using the ssesolve method.

src/time_evolution/callback_helpers/mesolve_callback_helpers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function _save_func_mesolve(integrator, e_ops, progr, iter, expvals)
2121
# to reshape u to make it a matrix, but we reshape the e_ops once.
2222

2323
ρ = integrator.u
24-
_expect = op -> dot(ρ, op)
24+
_expect = op -> dot(op, ρ)
2525
@. expvals[:, iter[]] = _expect(e_ops)
2626
iter[] += 1
2727

src/time_evolution/smesolve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function smesolveProblem(
103103
D_l = map(sc_ops_evo_data) do op
104104
# TODO: Implement the three-argument dot function for SciMLOperators.jl
105105
# Currently, we are assuming a time-independent MatrixOperator
106-
op_vec = mat2vec(op.A)
106+
op_vec = mat2vec(adjoint(op.A))
107107
return _spre(op, Id) + _spost(op', Id) + _smesolve_ScalarOperator(op_vec) * IdentityOperator(prod(dims)^2)
108108
end
109109
D = DiffusionOperator(D_l)

0 commit comments

Comments
 (0)