-
Notifications
You must be signed in to change notification settings - Fork 33
OPT_METROPOLISを4次項まで対応 #502
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
Conversation
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.
Pull Request Overview
This PR extends the optimal Metropolis updater (OPT_METROPOLIS) in the sample_huio function to handle polynomial terms up to 4th degree, expanding from the previous limitation of only quadratic (2nd degree) terms.
- Extended optimal transition capability from quadratic to quartic polynomial terms
- Added new polynomial minimum finding utility functions for cubic and quartic cases
- Refactored the variable degree tracking system to use a more efficient vector-based approach
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| include/openjij/utility/min_polynomial.hpp | New utility functions for finding minimum values of integer polynomials up to degree 4 |
| include/openjij/system/integer_polynomial_sa_system.hpp | Extended GetMinEnergyDifference to handle cubic and quartic coefficients using new utility functions |
| include/openjij/graph/integer_polynomial_model.hpp | Replaced set-based degree tracking with vector-based approach for better performance |
| include/openjij/updater/single_integer_move.hpp | Updated method names to reflect extended capability from quadratic to quartic |
| include/openjij/system/integer_quadratic_sa_system.hpp | Updated method names for consistency |
| tests/cxxtest/utility/min_polynomial.hpp | Comprehensive test cases for the new polynomial minimum finding functions |
| tests/cxxtest/graph/integer_polynomial_model.hpp | Updated tests to use new degree tracking API |
| tests/cxxtest/utility/all.hpp | Added include for new polynomial utility tests |
| tests/cxxtest/cxxtest.cpp | Added include for new polynomial utility header |
| openjij/declare.hpp | Updated Python bindings to use new degree tracking API |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
j-i-k-o
left a comment
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.
LGTM
変更
sample_huio関数において、updater=OPT_METROPOLISとすると、ある変数に対して最もエネルギーが下がるような最適遷移が行われます。現在のmainの実装ではこの最適遷移が行われるのはz^2のような2乗項だけでしたが、これを4乗項まで行うように変更しました。