Skip to content
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

Ising cluster update code #22

Merged
merged 16 commits into from
Dec 4, 2021

Conversation

MoskalenkoRomanBorisovich
Copy link
Contributor

No description provided.

Copy link
Owner

@ev-br ev-br left a comment

Choose a reason for hiding this comment

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

Несколько комментариев. Прдправляйте и в ту же ветку коммит.

examples/cy_ising_cluster.pyx Show resolved Hide resolved
examples/cy_ising_cluster.pyx Outdated Show resolved Hide resolved
examples/cy_ising_cluster.pyx Show resolved Hide resolved
@ev-br ev-br mentioned this pull request Jul 4, 2021
5 tasks
@ev-br ev-br added the enhancement New feature or request label Jul 21, 2021
@ev-br
Copy link
Owner

ev-br commented Jul 26, 2021

Tried to run a simulation of a 4x4 lattice, and I cannot make sense of the results:

In [15]: neighb = tabulate_neighbors((4, 4, 1), 'sc')

In [16]: simulate(4, neighb, 1.0, num_sweeps=200, verbose=2)
beta =  1.0   T =  1.0
Conformation size = 4

----- sweep =  0 spins =  [1 1 1 1] beta =  1.0
  ene =  -17506370211986.125  (naive)
      =  -17506370211986.125 +/- 0.0
  mag^2 =  1.0 +/- 0.0
  mag^4 =  1.0 +/- 0.0

Final:
  ene =  -525191071711.79  (naive)
  ene =  -547074033033.0678 +/- 1237330116550.454
  mag^2 =  0.9505208333333334 +/- 0.015259024159068463
  mag^4 =  0.9446614583333334 +/- 0.01665360680811597
  • What is the conformation size, and why there are four spins --- does this simulate 16 spins on a 4x4 lattice with PBC, or 4 spins on a 4x4 lattice or something else?

  • Energy is dubious

Could you please explain / update the PR @MoskalenkoRomanBorisovich ?

@ev-br
Copy link
Owner

ev-br commented Jul 26, 2021

W.r.t. reading the structure, what you have here is nice but what's really needed is an example of building a lattice out of it. Maybe a simpler, shorter conformation where you can follow the site numbering and neighbors. THis is best left for a separate PR though.

@MoskalenkoRomanBorisovich
Copy link
Contributor Author

Tried to run a simulation of a 4x4 lattice, and I cannot make sense of the results:

In [15]: neighb = tabulate_neighbors((4, 4, 1), 'sc')

In [16]: simulate(4, neighb, 1.0, num_sweeps=200, verbose=2)
beta =  1.0   T =  1.0
Conformation size = 4

----- sweep =  0 spins =  [1 1 1 1] beta =  1.0
  ene =  -17506370211986.125  (naive)
      =  -17506370211986.125 +/- 0.0
  mag^2 =  1.0 +/- 0.0
  mag^4 =  1.0 +/- 0.0

Final:
  ene =  -525191071711.79  (naive)
  ene =  -547074033033.0678 +/- 1237330116550.454
  mag^2 =  0.9505208333333334 +/- 0.015259024159068463
  mag^4 =  0.9446614583333334 +/- 0.01665360680811597
  • What is the conformation size, and why there are four spins --- does this simulate 16 spins on a 4x4 lattice with PBC, or 4 spins on a 4x4 lattice or something else?
  • Energy is dubious

Could you please explain / update the PR @MoskalenkoRomanBorisovich ?

L is the number of spins, for a 4 * 4 grid this is 16, not 4. This is a rudiment left from cy_ising.pyx, I will remove it in the next commit

@ev-br
Copy link
Owner

ev-br commented Aug 5, 2021

Please add a usage example. Ideally, add a comparison to exact enumeration for a 4x4 lattice. Enumeration might live in a Jupyter notebook or a python script or a cython code, whichever is simpler for you.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@ev-br
Copy link
Owner

ev-br commented Nov 15, 2021

Несколько комментариев по коду, исправляйте и push пжлст @MoskalenkoRomanBorisovich

Дальше, точный пересчет произвольных решеток это зачетная попытка, но нужно убрать. Это плохой пример (экспоненциально малые значения в сумме; экспоненциально много членов в сумму). Нужно сделать проще пример, двумерную решетку 4-на-4, на питоне точный пересчет, прямо в ноутбуке. Как сделано для одномерия в https://github.com/ev-br/mc_lib/blob/master/examples/1DIsing.ipynb

Как сделаете, @-отметьте меня пожалуйста.

@ev-br
Copy link
Owner

ev-br commented Nov 15, 2021

Также посмотрел в ноутбук. Хорошо, но доделываем:

  • Кластерами делаете только одну решетку, 4х4, ее же сравниваете с точным пересчетом.
  • чтение конфигурации уносите в отдельный ноутбук, отдельным PR. Собираете решетку, на нее спиновую модель --- вот как у Вас. Но отдельный ноутбук, в отдельном PR.

@MoskalenkoRomanBorisovich
Copy link
Contributor Author

MoskalenkoRomanBorisovich commented Nov 18, 2021

@ev-br
вроде всё поправил:
оставил решётку 4*4 с простым пересчётом на питоне
поправил опечатки
поправил всё связанное с nDim в коде

@ev-br ev-br merged commit a1e5931 into ev-br:master Dec 4, 2021
@ev-br
Copy link
Owner

ev-br commented Dec 4, 2021

Okay, let's merge it. Thanks @MoskalenkoRomanBorisovich

Follow-ups in gh-53.

@MoskalenkoRomanBorisovich MoskalenkoRomanBorisovich deleted the ising_example branch December 23, 2021 18:54
@ev-br ev-br added examples and removed needs-work labels Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants