-
Notifications
You must be signed in to change notification settings - Fork 1
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 a local search function #99
Conversation
For the |
Sorry I found out there is a bug for the result when using |
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.
Please write the test for all the functionality
use ruff for format. Ex.
If you use ruff, please do not format all of the code for the Qamomile project in this Pull Request, as there will be too many changes and the PR will not be able to be reviewed. |
I have a confusion for writing a test. For example, the function of |
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.
@bluest93
Please write in the docstring of each method what the function of each method is and how it is intended to be used.
In addition to checking the type, when testing, make sure that it works properly as a local search.
@yuyamashiro For the test_local_search.py, I have added an assertion to check whether the energy after the local search has decreased or is equal to the original energy. |
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.
There is not enough testing and its reliability is still low, but since it is not used in core parts, we will merge it in as is for now.
Also, for local search, the algorithm itself can be improved, such as by efficiently updating it using second-order differences instead of recalculating the energy difference, but we will include these after merging as well.
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.
I left the comments.
Change
Implemented the simple local search algorithm
Description
under
core/post_process
local_search.py
IsingMatrix
that represents the Ising model in matrix form (np.array)IsingModel
into matrix form with quadratic and linear componentsLocalSearch
that perform local search algorithmsjijmodeling SampleSet
__inti__.py
local_search.ipynb
under
tests/core/post_process
test_local_search.py