Skip to content

New algorithm for get_conjugacy_class()#51

Merged
yaniccd merged 4 commits into
masterfrom
conjugacy
Mar 24, 2026
Merged

New algorithm for get_conjugacy_class()#51
yaniccd merged 4 commits into
masterfrom
conjugacy

Conversation

@yaniccd
Copy link
Copy Markdown
Collaborator

@yaniccd yaniccd commented Mar 23, 2026

get_conjugacy_class() was the primary bottleneck of haar_integral_unitary(). The algorithm has been drastically improved.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
haarpy/orthogonal.py 100.00% <ø> (ø)
haarpy/symmetric.py 100.00% <100.00%> (ø)
haarpy/symplectic.py 100.00% <ø> (ø)
haarpy/tests/test_symmetric.py 100.00% <100.00%> (ø)
haarpy/tests/test_unitary.py 100.00% <100.00%> (ø)
haarpy/unitary.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nquesada
Copy link
Copy Markdown
Contributor

Could you post some little code and a little benchmark showing how significant are the changes?
Something along the lines of

%timeit get_conjugacy_class() #running from the main branch
# Takes crazy long

and then

%timeit get_conjugacy_class() #running from this branch
# Blazingly fast?

@yaniccd
Copy link
Copy Markdown
Collaborator Author

yaniccd commented Mar 24, 2026

Could you post some little code and a little benchmark showing how significant are the changes? Something along the lines of

%timeit get_conjugacy_class() #running from the main branch
# Takes crazy long

and then

%timeit get_conjugacy_class() #running from this branch
# Blazingly fast?

The time difference has a major impact on haar_integral_unitary which has many calls to this function.

The old function :
Screenshot from 2026-03-24 11-01-27

The new one :
Screenshot from 2026-03-24 11-04-46

Copy link
Copy Markdown
Contributor

@nquesada nquesada left a comment

Choose a reason for hiding this comment

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

Some minor tweak in the changelog.

Comment thread .github/CHANGELOG.md Outdated
Co-authored-by: Nicolás Quesada <991946+nquesada@users.noreply.github.com>
@yaniccd yaniccd merged commit 29879ac into master Mar 24, 2026
2 checks passed
@yaniccd yaniccd deleted the conjugacy branch March 24, 2026 10:57
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