Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alfranmu
Copy link

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.

…rgument) for generating Haar measure matrices, allowing reproducible results.

- Updated test suite to include reproducibility checks for Haar measure matrices.
Copy link

codecov bot commented May 24, 2025

Codecov Report

Attention: Patch coverage is 42.85714% with 8 lines in your changes missing coverage. Please review.

Project coverage is 39.82%. Comparing base (fc98f3b) to head (83029f4).

Files with missing lines Patch % Lines
src/Ginibre.jl 25.00% 6 Missing ⚠️
src/HaarMeasure.jl 66.66% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dlfivefifty
Copy link
Member

Can you get the codecov up?

@alfranmu
Copy link
Author

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rand(rng::AbstractRNG, W::Ginibre)
rand([rng::AbstractRNG,] W::Ginibre)

see https://docs.julialang.org/en/v1/manual/documentation/.

@@ -1,6 +1,6 @@
#TODO implement O(n^2) method
"""
rand(W::Haar, n::Int)
rand(rng::AbstractRNG, W::Haar, n::Int)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rand(rng::AbstractRNG, W::Haar, n::Int)
rand([rng::AbstractRNG,] W::Haar, n::Int)

same here.

end # testset


Copy link
Contributor

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)


Copy link
Contributor

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)

Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants