Skip to content

Conversation

Drewniok
Copy link
Collaborator

@Drewniok Drewniok commented Mar 3, 2025

Description

This PR increases the tolerance used in groundstate_from_simulation_results to extract the ground states from simulation results. Previously, it failed to detect the degeneracy of the ground state in some cases, leading to "weird" operational domains. This should now be fixed.

Example:
This operational domain should be empty, which is only the case if the degeneracy of the ground state is correctly detected. As said, this should be fixed now.
perturber_distance_encoded_two_bdl_wire

Checklist:

  • The pull request only contains commits that are related to it.
  • I have added appropriate tests and documentation.
  • I have added a changelog entry.
  • I have created/adjusted the Python bindings for any new or updated functionality.
  • I have made sure that all CI jobs on GitHub pass.
  • The pull request introduces no new warnings and follows the project's style guidelines.

@Drewniok Drewniok added the bug Something isn't working label Mar 3, 2025
@Drewniok Drewniok self-assigned this Mar 3, 2025
@Drewniok Drewniok changed the title 🐛 Increased tolerance to avoid undetected degeneracy. 🐛 Increased tolerance to avoid undetected degeneracy Mar 3, 2025
@Drewniok Drewniok requested a review from marcelwa March 3, 2025 17:34
@marcelwa
Copy link
Collaborator

marcelwa commented Mar 3, 2025

Thanks for the fix! 🙏

Slightly off-topic, but thinking about the function, I wonder if we should refactor it into a member of sidb_simulation_result called groundstate for more intuitive usability. What do you think, @Drewniok and @wlambooy?

Copy link

codecov bot commented Mar 3, 2025

Codecov Report

Attention: Patch coverage is 97.08029% with 4 lines in your changes missing coverage. Please review.

Project coverage is 98.36%. Comparing base (bbb9a09) to head (4ae106b).
Report is 71 commits behind head on main.

Files with missing lines Patch % Lines
...on/algorithms/simulation/sidb/detect_bdl_wires.hpp 85.71% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #685      +/-   ##
==========================================
- Coverage   98.36%   98.36%   -0.01%     
==========================================
  Files         254      253       -1     
  Lines       41399    41485      +86     
  Branches     1878     1884       +6     
==========================================
+ Hits        40723    40806      +83     
- Misses        676      679       +3     
Files with missing lines Coverage Δ
...on/algorithms/simulation/sidb/defect_influence.hpp 96.51% <100.00%> (ø)
...ion/algorithms/simulation/sidb/is_ground_state.hpp 100.00% <100.00%> (ø)
...tion/algorithms/simulation/sidb/is_operational.hpp 92.02% <100.00%> (-0.03%) ⬇️
...orithms/simulation/sidb/sidb_simulation_result.hpp 100.00% <100.00%> (ø)
...est/algorithms/simulation/sidb/clustercomplete.cpp 99.68% <100.00%> (ø)
...lation/sidb/exhaustive_ground_state_simulation.cpp 100.00% <100.00%> (ø)
.../algorithms/simulation/sidb/operational_domain.cpp 100.00% <100.00%> (ø)
test/algorithms/simulation/sidb/quickexact.cpp 100.00% <ø> (ø)
test/algorithms/simulation/sidb/quicksim.cpp 100.00% <100.00%> (ø)
...orithms/simulation/sidb/sidb_simulation_result.cpp 100.00% <100.00%> (ø)
... and 2 more

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update abadc97...4ae106b. Read the comment docs.

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

Copy link
Contributor

github-actions bot commented Mar 3, 2025

clang-tidy review says "All clean, LGTM! 👍"

@Drewniok
Copy link
Collaborator Author

Drewniok commented Mar 3, 2025

Thanks for the fix! 🙏

Slightly off-topic, but thinking about the function, I wonder if we should refactor it into a member of sidb_simulation_result called groundstate for more intuitive usability. What do you think, @Drewniok and @wlambooy?

That's a great idea! I like it!

Drewniok and others added 3 commits March 4, 2025 07:41
Copy link
Contributor

github-actions bot commented Mar 4, 2025

clang-tidy review says "All clean, LGTM! 👍"

@Drewniok Drewniok changed the title 🐛 Increased tolerance to avoid undetected degeneracy 🐛 Increased tolerance to avoid undetected degeneracy and add forbidden BDL types in wire detection Mar 4, 2025
@Drewniok Drewniok changed the title 🐛 Increased tolerance to avoid undetected degeneracy and add forbidden BDL types in wire detection 🐛 Increased tolerance to avoid undetected degeneracy and added forbidden BDL types in wire detection Mar 4, 2025
Copy link
Contributor

github-actions bot commented Mar 4, 2025

clang-tidy review says "All clean, LGTM! 👍"

@wlambooy
Copy link
Collaborator

wlambooy commented Mar 4, 2025

Thanks for the fix! 🙏

Slightly off-topic, but thinking about the function, I wonder if we should refactor it into a member of sidb_simulation_result called groundstate for more intuitive usability. What do you think, @Drewniok and @wlambooy?

I think that is an excellent idea! Since there is always the possibility of getting degenerate groundstates, we should respect that in the function name, i.e.: groundstates.

@marcelwa
Copy link
Collaborator

marcelwa commented Mar 4, 2025

Thanks for the fix! 🙏

Slightly off-topic, but thinking about the function, I wonder if we should refactor it into a member of sidb_simulation_result called groundstate for more intuitive usability. What do you think, @Drewniok and @wlambooy?

I think that is an excellent idea! Since there is always the possibility of getting degenerate groundstates, we should respect that in the function name, i.e.: groundstates.

Good call! Would it make sense then to parameterize the function to allow degeneracy or not? Or have two separate functions for that? I'm also okay with having a single one simply called groundstates. I'm merely asking for your preference since you're going to use the API the most.

@Drewniok
Copy link
Collaborator Author

Drewniok commented Mar 5, 2025

Thanks for the fix! 🙏
Slightly off-topic, but thinking about the function, I wonder if we should refactor it into a member of sidb_simulation_result called groundstate for more intuitive usability. What do you think, @Drewniok and @wlambooy?

I think that is an excellent idea! Since there is always the possibility of getting degenerate groundstates, we should respect that in the function name, i.e.: groundstates.

Good call! Would it make sense then to parameterize the function to allow degeneracy or not? Or have two separate functions for that? I'm also okay with having a single one simply called groundstates. I'm merely asking for your preference since you're going to use the API the most.

Personally, I do not see a reason for parameterizing it.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Signed-off-by: GitHub Actions <actions@github.com>
@Drewniok Drewniok requested a review from marcelwa March 13, 2025 12:12
Drewniok and others added 4 commits March 16, 2025 19:47
…on_detected_degeneracy' into increase_error_margin_to_avoid_non_detected_degeneracy
Signed-off-by: GitHub Actions <actions@github.com>
@Drewniok Drewniok requested a review from marcelwa March 16, 2025 18:57
Copy link
Collaborator

@marcelwa marcelwa left a comment

Choose a reason for hiding this comment

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

Many thanks for the fix and the quick iterations!

@Drewniok Drewniok merged commit 4c27663 into cda-tum:main Mar 17, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants