Skip to content
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

Add haar random states and unitaries #143

Merged
merged 2 commits into from
Sep 21, 2023
Merged

Conversation

akirakyle
Copy link
Member

Uses RandomMatrices.jl to create haar random states and unitaries. I had to blacklist some ambiguities pulled in from StatesBase.jl (there's already an issue about it here: JuliaStats/StatsBase.jl#861).

@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Merging #143 (80898c6) into master (4c6296c) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #143      +/-   ##
==========================================
- Coverage   93.55%   93.53%   -0.03%     
==========================================
  Files          24       24              
  Lines        3059     3061       +2     
==========================================
+ Hits         2862     2863       +1     
- Misses        197      198       +1     
Files Changed Coverage Δ
src/QuantumOpticsBase.jl 100.00% <ø> (ø)
src/state_definitions.jl 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Krastanov
Copy link
Collaborator

Another great contribution! Do you mind if I slightly change the naming convention in the merge commit (to match what is currently used elsewhere in the library, i.e. one less underscore)?

@akirakyle
Copy link
Member Author

Another great contribution! Do you mind if I slightly change the naming convention in the merge commit (to match what is currently used elsewhere in the library, i.e. one less underscore)?

That makes sense! While rebasing the branch, I just went ahead and did that rename so hopefully this is ready to merge

@Krastanov
Copy link
Collaborator

# master on julia 1.9.3
julia> @time @eval using QuantumOpticsBase
  0.618171 seconds (1.63 M allocations: 114.596 MiB, 11.59% gc time, 2.95% compilation time: 52% of which was recompilation)

# This PR on julia 1.9.3
julia> @time @eval using QuantumOpticsBase
  0.592814 seconds (1.63 M allocations: 113.105 MiB, 7.84% gc time, 3.09% compilation time: 52% of which was recompilation)

# This PR on julia nightly Sep 17 2023
julia> @time @eval using QuantumOpticsBase
  0.399588 seconds (673.71 k allocations: 47.520 MiB, 4.57% gc time, 4.99% compilation time: 52% of which was recompilation)

There are about 20 new invalidations (for a total of 500) so this is not remotely as bad as the numerical stability fix in #142 . It does not really affect load times. I am leaning towards merging it, but I will wait a few days in case anyone has objections.

@Krastanov Krastanov merged commit 3a63760 into qojulia:master Sep 21, 2023
@akirakyle akirakyle deleted the haar branch September 21, 2023 21:51
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.

2 participants