Skip to content

Commit

Permalink
a bit more elegant
Browse files Browse the repository at this point in the history
  • Loading branch information
araujoms authored Dec 9, 2023
1 parent 237043d commit ea673d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/math_util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function partial_trace(ρ::AbstractMatrix, sys_dim::AbstractVector{<:Integer}, d
re_dim[dim_2_trace] .= 1
tr_dim = copy(sys_dim)
tr_dim[dim_2_keep] .= 1
res = zeros(typeof(first(ρ)), re_dim..., re_dim...)
res = zeros(eltype), re_dim..., re_dim...)
for I in CartesianIndices(size(res))
for k in CartesianIndices((tr_dim...,))
delta = CartesianIndex(k, k)
Expand Down

0 comments on commit ea673d4

Please sign in to comment.