-
Notifications
You must be signed in to change notification settings - Fork 41
Add support for local RNG seed in Haar measure matrix generation and reproducibility tests #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…rgument) for generating Haar measure matrices, allowing reproducible results. - Updated test suite to include reproducibility checks for Haar measure matrices.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #92 +/- ##
==========================================
+ Coverage 39.80% 39.82% +0.02%
==========================================
Files 12 12
Lines 819 821 +2
==========================================
+ Hits 326 327 +1
- Misses 493 494 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Can you get the codecov up? |
Sure! I’ll work on adding some tests to increase coverage and push the changes soon. |
@@ -30,30 +31,38 @@ struct Ginibre <: ContinuousMatrixDistribution | |||
end | |||
|
|||
""" | |||
rand(W::Ginibre) | |||
rand(rng::AbstractRNG, W::Ginibre) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rand(rng::AbstractRNG, W::Ginibre) | |
rand([rng::AbstractRNG,] W::Ginibre) |
@@ -1,6 +1,6 @@ | |||
#TODO implement O(n^2) method | |||
""" | |||
rand(W::Haar, n::Int) | |||
rand(rng::AbstractRNG, W::Haar, n::Int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rand(rng::AbstractRNG, W::Haar, n::Int) | |
rand([rng::AbstractRNG,] W::Haar, n::Int) |
same here.
end # testset | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These extra lines below don't seem necessary.
@@ -54,6 +54,10 @@ function rand(W::Haar, n::Int, doCorrection::Int=1) | |||
end | |||
end | |||
|
|||
rand(W::Haar, n::Int, doCorrection::Int=1)= rand(GLOBAL_RNG,W,n,doCorrection) | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These extra lines don't seem necessary
[Q0+im*Q1 Q2+im*Q3;-Q2+im*Q3 Q0-im*Q1] | ||
else | ||
error(string("beta = ", beta, " not implemented")) | ||
end | ||
end | ||
|
||
|
||
rand(W::Ginibre)=rand(GLOBAL_RNG, W) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These extra lines don't seem necessary
This PR enables the use of a local random number generator (via the
rng
argument) for generating Haar measure matrices, allowing for reproducible results when a specific seed is provided.Additionally, a new test has been added to verify the reproducibility of Haar matrix generation when using local RNG seeds.