Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
aarontrowbridge committed Sep 25, 2023
1 parent e12e5df commit d3b3391
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/quantum_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ end
function iso_vec_to_operator(Ũ⃗::AbstractVector{R}) where R <: Real
Ũ⃗_dim = div(length(Ũ⃗), 2)
N = Int(sqrt(Ũ⃗_dim))
isodim = 2N
U = Matrix{Complex{R}}(undef, N, N)
for i=0:N-1
U[:, i+1] .= @view(Ũ⃗[i*2N .+ (1:N)]) +
U[:, i+1] .= @view(Ũ⃗[i*2N .+ (1:N)]) +
one(R) * im * @view(Ũ⃗[i*isodim .+ (N+1:2N)])
end
return U
Expand Down

0 comments on commit d3b3391

Please sign in to comment.