Skip to content

Commit

Permalink
Avoid broadcasting over a Q matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarrasch authored Jul 29, 2022
1 parent 39f7496 commit 305e375
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/RandomQuantum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ end

function rand(dist::ClosedHaarEnsemble)
X = rand(GinibreEnsemble(dist.dim))
Q,_ = qr(X)
Q = qr(X).Q * I # yields dense square matrix
d = diag(Q)
d = d ./ abs.(d)
Q = Q ./ d
d ./= abs.(d)
Q ./= d
return Q
end

Expand Down

0 comments on commit 305e375

Please sign in to comment.