Skip to content

Commit

Permalink
Fix: cumulant time evolution used too much memory.
Browse files Browse the repository at this point in the history
  • Loading branch information
bastikr committed Apr 29, 2016
1 parent cf76229 commit db7f10c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cumulantexpansion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ end
dims(rho::ProductDensityOperator) = [length(op.basis_l)*length(op.basis_r) for op in rho.operators]

function as_vector(rho::ProductDensityOperator, x::Vector{Complex128})
@assert length(x) == prod(dims(rho))
@assert length(x) == sum(dims(rho))
i = 0
for op in rho.operators
N = length(op.basis_l)*length(op.basis_r)
Expand All @@ -144,7 +144,7 @@ function as_vector(rho::ProductDensityOperator, x::Vector{Complex128})
end

function as_operator(x::Vector{Complex128}, rho::ProductDensityOperator)
@assert length(x) == prod(dims(rho))
@assert length(x) == sum(dims(rho))
i = 0
for op in rho.operators
N = length(op.basis_l)*length(op.basis_r)
Expand All @@ -156,7 +156,7 @@ end

function integrate_master(dmaster::Function, tspan, rho0::ProductDensityOperator;
fout::Union{Function,Void}=nothing, kwargs...)
x0 = as_vector(rho0, zeros(Complex128, prod(dims(rho0))))
x0 = as_vector(rho0, zeros(Complex128, sum(dims(rho0))))
f = (x->x)
if fout==nothing
tout = Float64[]
Expand Down

0 comments on commit db7f10c

Please sign in to comment.