JuliaMath / JuliaMath/RandomMatrices.jl
The function ` rand(d::Wigner{2}, n::Int)` returns incorrect matrix???
- Dominant language
- Julia
- Stars
- 94
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
I think that the following code is missing a factor of 2 dividing when the function returns.
```
function rand(d::Wigner{2}, n::Int)
A = randn(n, n) + im*randn(n, n)
normalization = √(4*n)
return Hermitian((A + A') / normalization)
end
```
That is, replace this line `return Hermitian((A + A') / normalization)` with this other one `return Hermitian( (A + A') / 2 / normalization )`.
Thanks and regards
Pablo
Contributor guide
No contributing guide indexed for this repository
Research direction
Locate the `rand(d::Wigner{2}, n::Int)` entry point and inspect how the generated Hermitian matrix is normalized. Verify the expected scaling for the Wigner matrix and compare it with the reported factor-of-two change. Done means the function returns correctly normalized matrices and relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100