Skip to content

Add copy_spins!. Expose jitter argument in minimize_energy!#465

Merged
kbarros merged 29 commits into
mainfrom
jitter
Dec 21, 2025
Merged

Add copy_spins!. Expose jitter argument in minimize_energy!#465
kbarros merged 29 commits into
mainfrom
jitter

Conversation

@kbarros

@kbarros kbarros commented Dec 9, 2025

Copy link
Copy Markdown
Member
  1. Expose the jitter argument to minimize_energy! in the docs.
  2. Introduce a copy_spins! function.
  3. Update the minimize_energy! doc string. It now suggests this snippet to search for the ground state:
sys_min = clone_system(sys)
for i in 1:100
    randomize_spins!(sys)
    minimize_energy!(sys)
    if energy(sys) < energy(sys_min)
        copy_spins!(sys_min, sys)
    end
end
copy_spins!(sys, sys_min)

@kbarros kbarros requested a review from ddahlbom December 9, 2025 22:30

@ddahlbom ddahlbom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good to me. It will be nice to have this parameter exposed.

Comment thread src/Optimization.jl Outdated
@kbarros kbarros force-pushed the jitter branch 2 times, most recently from df931c7 to 376536c Compare December 13, 2025 17:54
@kbarros kbarros changed the title Expose jitter argument in minimize_energy! Add copy_spins!. Expose jitter argument in minimize_energy! Dec 21, 2025
@kbarros kbarros merged commit 6c80bc7 into main Dec 21, 2025
4 checks passed
@kbarros kbarros deleted the jitter branch December 21, 2025 15:10
@kbarros kbarros mentioned this pull request Jan 23, 2026
3 tasks
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