Skip to content

Draft: Resolve "Proposal of updates with Langevin equation"#592

Open
ALF-Import-Bot wants to merge 41 commits into
masterfrom
305-proposal-of-updates-with-langevin-equation
Open

Draft: Resolve "Proposal of updates with Langevin equation"#592
ALF-Import-Bot wants to merge 41 commits into
masterfrom
305-proposal-of-updates-with-langevin-equation

Conversation

@ALF-Import-Bot

Copy link
Copy Markdown

In GitLab by @fassaad on Feb 5, 2026, 09:45 UTC:

Anika has done a great job here, and we should merge this into the master once tested by a third party.

Assignees: fassaad

Migrated from GitLab: https://git.physik.uni-wuerzburg.de/ALF/ALF/-/merge_requests/262

Anika Goetz and others added 30 commits January 15, 2025 16:59
@ALF-Import-Bot

Copy link
Copy Markdown
Author

In GitLab by @fassaad on Feb 5, 2026, 09:51 UTC:

added 39 commits

  • 680df87...957545b - 38 commits from branch master
  • 9b196a3 - Merge branch 'master' into 305-proposal-of-updates-with-langevin-equation

Compare with previous version

@ALF-Import-Bot

Copy link
Copy Markdown
Author

In GitLab by @fassaad on Feb 5, 2026, 09:58 UTC:

I tested

Propose_MALA        = .true.
Delta_t_MALA_sequential = 0.1
Max_Force_MALA_sequential = 5.0

And this works just fine!

For global_tau_MALA with:

Global_tau_MALA_moves   = .true.
N_Global_tau_MALA       = 1
Delta_t_MALA_global_tau =  0.1
Max_Force_MALA_global_tau = 5.0

I get an error, the issue being that Nt_sequential_end=-1

@ALF-Import-Bot

Copy link
Copy Markdown
Author

In GitLab by @fassaad on Feb 5, 2026, 15:00 UTC:

added 1 commit

  • 27ead59 - CLeaned up issue when only Mala_global_tau and no sequential moves are carried out.

Compare with previous version

@ALF-Import-Bot

Copy link
Copy Markdown
Author

In GitLab by @fassaad on Feb 8, 2026, 16:25 UTC:

added 1 commit

Compare with previous version

@ALF-Import-Bot

Copy link
Copy Markdown
Author

In GitLab by @fassaad on Feb 8, 2026, 17:03 UTC:

added 1 commit

Compare with previous version

@ALF-Import-Bot

Copy link
Copy Markdown
Author

In GitLab by @fassaad on Feb 8, 2026, 19:16 UTC:

added 1 commit

  • e8fd3e1 - Working on doc for Updating

Compare with previous version

@ALF-Import-Bot

Copy link
Copy Markdown
Author

In GitLab by @fassaad on Feb 9, 2026, 06:47 UTC:

added 1 commit

Compare with previous version

@ALF-Import-Bot

Copy link
Copy Markdown
Author

In GitLab by @fassaad on Feb 9, 2026, 07:50 UTC:

added 1 commit

  • 6a6d3f7 - Worked on the documentation.

Compare with previous version

@ALF-Import-Bot

Copy link
Copy Markdown
Author

In GitLab by @fassaad on Feb 9, 2026, 07:57 UTC:

@anika, All seems to be working now. I have also rewritten the documentation for the updating schemes. I have also modified the Hubbard model module such that one can test all the updating schemes (at the exception of the parallel tempering) out of the box, without having to program anything. I did that on the 6 sites lattice with open boundary conditions and consistently obtained the same results with different updating schemes. It would be great if you could go through the documentation. Thanks Fakher.

@joaogci

joaogci commented Feb 26, 2026

Copy link
Copy Markdown
Member

Looks good! I think that snippets of code/parameters for Langevin and HMC updates are missing. It would make it more clear on how to use/implement these methods.
Also, there is an issue if you just want to do global tau moves (either normal moves or MALA) and no sequential spin flips. For this, you have to set Nt_sequential_start = 0 and also Nt_sequential_end = 0, and then you can do your simulation with just global tau moves. In this case, the code will produce a warning: "Warning: Nt_sequential_end is smaller than Nt_sequential_start". Is this something that we want to keep?

@fassaad

fassaad commented Mar 25, 2026

Copy link
Copy Markdown
Member

Looks good! I think that snippets of code/parameters for Langevin and HMC updates are missing. It would make it more clear on how to use/implement these methods. Also, there is an issue if you just want to do global tau moves (either normal moves or MALA) and no sequential spin flips. For this, you have to set Nt_sequential_start = 0 and also Nt_sequential_end = 0, and then you can do your simulation with just global tau moves. In this case, the code will produce a warning: "Warning: Nt_sequential_end is smaller than Nt_sequential_start". Is this something that we want to keep?

Hi Joao, I have added the snippets of code/parameters for the Langevin and HMC. I think that it is always good if the code issues a warning, and I would keep it like that

deallocate(forces_0)

end Subroutine Ham_Langevin_HMC_S0_single_base

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I assumed S0(phi) = 1/2 phi^2, which is dangerous and likely incorrect as the warning message states. Now I'm thinking it would be better to flip the logic around, i.e., HMC_S0_base builds all forces_0 out of the single version, accompanied by an inefficiency warning asking the user to override it.
Here, it's probably best to terminate and given an error message instead of assuming the simplest gaussian form of S0.

!--------------------------------------------------------------------
Subroutine Overide_global_tau_sampling_parameters_base(Nt_sequential_start,Nt_sequential_end,N_Global_tau)
Subroutine Overide_global_tau_sampling_parameters_base(Nt_sequential_start,Nt_sequential_end, &
& N_Global_tau, N_Global_tau_MALA)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can probably remove this override sampling function now and use the new QMC variables functionality and set those variables according to the model parameters in the hamiltonian directly.

T0_Proposal_ratio = 1


End Subroutine Global_move

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is the relation between those global moves and MALA updates?

S0_ratio = S0(Flip_list(1),ntau,Flip_value(1))


end Subroutine Global_move_tau

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How does this relate to MALA moves?

Subroutine Global_MALA_move_base(Flip_list)

Implicit none
Integer , INTENT(OUT) :: Flip_list(:,:)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Flip list essentially tags a field to be updated via MALA moves if the entry is set to 1, correct? Wouldn't it be better turning this into a logical array? And change the name to something like perform_MALA or MALA_tag or enable_MALA?

Comment thread Prog/Langevin_HMC_mod.F90
do n = 1, n1
if (OP_V(n,1)%type == 3 ) then
do nt = 1, n2
if ( flip_list(n,nt) == 1 ) then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks like logical variable would be better here. I struggle reading the code atm.

Comment thread Prog/main.F90
Call Metropolis_Langevin%make(.False., .False., MALA, delta_t_MALA_global, MAX_Force_MALA_global, Leapfrog_steps)
else
Call Langevin_HMC%set_Update_scheme(Langevin, HMC )
Call Metropolis_Langevin%set_Update_scheme(.False., .False., MALA )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need to keep Langevin_HMC separate from Metropolis_Langevin? I'd understand the overall logic yet...

Comment thread Documentation/doc.pdf

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If I'm not mistaken, we planed to clean the doc.pdf outside of the repo and use artefacts of the pipeline on the website. @jonasschwab is this still the case?

@johanneshofmann87 johanneshofmann87 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@fassaad I would really appreciate more comments in the source code. I'm trying to read the code and it's not very easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants