-
Notifications
You must be signed in to change notification settings - Fork 3
Draft: Resolve "Proposal of updates with Langevin equation" #592
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
base: master
Are you sure you want to change the base?
Changes from all commits
a12ae38
0c3b65a
a2a4ba2
380815d
12227d0
f2db2d8
cf13f54
1bed453
b72cbca
6229b8e
227489d
dce7e11
49acb4d
b5962a7
86f8fdb
9019de4
f345af8
aebf65e
63693fc
87f98e6
e28ab3d
a103ab8
7a8a58f
69f6aef
08fe884
1cdbc91
eb7d66e
a180e0b
ca76770
4362739
680df87
9b196a3
27ead59
467053b
1cd8972
e8fd3e1
e4a9dbb
6a6d3f7
d6f1e9d
2c05d25
55a5ead
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| \indexentry{\texttt{Checkerboard}}{28} | ||
| \indexentry{\texttt{Symm}}{30} | ||
| \indexentry{\texttt{Symm}}{30} | ||
| \indexentry{\texttt{Symm}}{31} | ||
| \indexentry{\texttt{Precision Green} }{33} | ||
| \indexentry{\texttt{Precision Phase}}{33} | ||
| \indexentry{\path{NWrap}}{33} | ||
| \indexentry{\texttt{Square} }{83} | ||
| \indexentry{\path{Bilayer_square}}{84} | ||
| \indexentry{\path{N_leg_ladder}}{84} | ||
| \indexentry{\path{Honeycomb}}{84} | ||
| \indexentry{\texttt{Bilayer\_honeycomb}}{84} | ||
| \indexentry{\texttt{Triangular}}{85} | ||
| \indexentry{\texttt{Kagome}}{85} |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -149,13 +149,16 @@ Module Hamiltonian_main | |
| procedure, nopass :: Pr_obs => Pr_obs_base | ||
| procedure, nopass :: Init_obs => Init_obs_base | ||
| procedure, nopass :: Global_move_tau => Global_move_tau_base | ||
| procedure, nopass :: Global_MALA_move_tau => Global_MALA_move_tau_base | ||
| procedure, nopass :: Hamiltonian_set_nsigma => Hamiltonian_set_nsigma_base | ||
| procedure, nopass :: Overide_global_tau_sampling_parameters => Overide_global_tau_sampling_parameters_base | ||
| procedure, nopass :: Global_move => Global_move_base | ||
| procedure, nopass :: Global_MALA_move => Global_MALA_move_base | ||
| procedure, nopass :: Delta_S0_global => Delta_S0_global_base | ||
| procedure, nopass :: Get_Delta_S0_global => Get_Delta_S0_global_base | ||
| procedure, nopass :: S0 => S0_base | ||
| procedure, nopass :: Ham_Langevin_HMC_S0 => Ham_Langevin_HMC_S0_base | ||
| procedure, nopass :: Ham_Langevin_HMC_S0_single => Ham_Langevin_HMC_S0_single_base | ||
| procedure, nopass :: weight_reconstruction => weight_reconstruction_base | ||
| procedure, nopass :: GR_reconstruction => GR_reconstruction_base | ||
| procedure, nopass :: GRT_reconstruction => GRT_reconstruction_base | ||
|
|
@@ -626,6 +629,94 @@ Subroutine Global_move_tau_base(T0_Proposal_ratio, S0_ratio, & | |
| CALL Terminate_on_error(ERROR_HAMILTONIAN,__FILE__,__LINE__) | ||
| end Subroutine Global_move_tau_base | ||
|
|
||
| !-------------------------------------------------------------------- | ||
| !> @author | ||
| !> ALF Collaboration | ||
| !> | ||
| !> @brief | ||
| !> Specify a global langevin move on a given time slice tau. | ||
| !> | ||
| !> @details | ||
| !> @param[in] ntau Integer | ||
| !> \verbatim | ||
| !> Time slice | ||
| !> \endverbatim | ||
| !> @param[out] Flip_length Integer | ||
| !> \verbatim | ||
| !> Number of flips stored in the first Flip_length entries of the array Flip_values. | ||
| !> Has to be smaller than NDIM | ||
| !> \endverbatim | ||
| !> @param[out] Flip_list Integer(Ndim) | ||
| !> \verbatim | ||
| !> List of spins to be flipped: nsigma%f(Flip_list(1),ntau) ... nsigma%f(Flip_list(Flip_Length),ntau) | ||
| !> Note that Ndim = size(Op_V,1) | ||
| !> \endverbatim | ||
| !-------------------------------------------------------------------- | ||
| Subroutine Global_MALA_move_tau_base(Flip_list, Flip_length,ntau) | ||
|
|
||
| Implicit none | ||
| Integer , INTENT(OUT) :: Flip_list(:) | ||
| Integer, INTENT(OUT) :: Flip_length | ||
| Integer, INTENT(IN) :: ntau | ||
|
|
||
| Logical, save :: first_call=.True. | ||
| integer :: n | ||
|
|
||
| Flip_length = size(flip_list,1) | ||
| do n = 1, Flip_length | ||
| flip_list(n) = n | ||
| enddo | ||
|
|
||
| If (first_call) then | ||
| write(output_unit,*) | ||
| write(output_unit,*) "ATTENTION: Base implementation of Global_MALA_move_tau is being called!" | ||
| write(output_unit,*) "All fields of type 3 will be updated in the global tau MALA moves." | ||
| write(output_unit,*) "Suppressing further printouts of this message." | ||
| write(output_unit,*) | ||
| first_call=.false. | ||
| endif | ||
|
|
||
| end Subroutine Global_MALA_move_tau_base | ||
|
|
||
| !-------------------------------------------------------------------- | ||
| !> @author | ||
| !> ALF Collaboration | ||
| !> | ||
| !> @brief | ||
| !> Specify a global Metropolis-adjusted langevin move. | ||
| !> | ||
| !> @details | ||
| !> @param[out] Flip_length Integer | ||
| !> \verbatim | ||
| !> Number of flips stored in the first Flip_length entries of the array Flip_values. | ||
| !> Has to be smaller than NDIM*Ltrot | ||
| !> \endverbatim | ||
| !> @param[out] Flip_list Integer(Ndim,Ltrot) | ||
| !> \verbatim | ||
| !> List of spins to be flipped: nsigma%f(Flip_list(1,1),Flip_list(1,2)) ... nsigma%f(Flip_list(Flip_Length,1),Flip_list(Flip_Length,2)) | ||
| !> Note that Ndim = size(Op_V,1) | ||
| !> \endverbatim | ||
| !-------------------------------------------------------------------- | ||
| Subroutine Global_MALA_move_base(Flip_list) | ||
|
|
||
| Implicit none | ||
| Integer , INTENT(OUT) :: Flip_list(:,:) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
|
|
||
| Logical, save :: first_call=.True. | ||
|
|
||
| If (first_call) then | ||
| write(output_unit,*) | ||
| write(output_unit,*) "ATTENTION: Base implementation of Global_MALA_move is being called!" | ||
| write(output_unit,*) "All fields of type 3 will be updated in the global MALA moves." | ||
| write(output_unit,*) "Suppressing further printouts of this message." | ||
| write(output_unit,*) | ||
| first_call=.false. | ||
| endif | ||
|
|
||
| Flip_list = 1 | ||
|
|
||
| end Subroutine Global_MALA_move_base | ||
|
|
||
| !-------------------------------------------------------------------- | ||
| !> @author | ||
| !> ALF Collaboration | ||
|
|
@@ -665,10 +756,11 @@ end Subroutine Hamiltonian_set_nsigma_base | |
| !> @details | ||
| !> \endverbatim | ||
| !-------------------------------------------------------------------- | ||
| 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) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
||
| Implicit none | ||
| Integer, Intent(INOUT) :: Nt_sequential_start,Nt_sequential_end, N_Global_tau | ||
| Integer, Intent(INOUT) :: Nt_sequential_start,Nt_sequential_end, N_Global_tau, N_Global_tau_MALA | ||
|
|
||
| !!$ write(output_unit,*) | ||
| !!$ write(output_unit,*) "ATTENTION: Base implementation of Overide_global_tau_sampling_parameters is getting calling!" | ||
|
|
@@ -698,9 +790,9 @@ Subroutine Ham_Langevin_HMC_S0_base(Forces_0) | |
|
|
||
| if (first_call) then | ||
| write(output_unit,*) | ||
| write(output_unit,*) "ATTENTION: Base implementation of Ham_Langevin_HMC_S0 is getting calling!" | ||
| write(output_unit,*) "ATTENTION: Base implementation of Ham_Langevin_HMC_S0 is being called!" | ||
| write(output_unit,*) "This assumes trivial S0 action and is likely incorrect!" | ||
| write(output_unit,*) "Consider overwritting this routine according to the model in your Hamiltonian." | ||
| write(output_unit,*) "Consider overwriting this routine according to the model in your Hamiltonian." | ||
| write(output_unit,*) "Suppressing further printouts of this message." | ||
| write(output_unit,*) | ||
| first_call=.False. | ||
|
|
@@ -709,6 +801,43 @@ Subroutine Ham_Langevin_HMC_S0_base(Forces_0) | |
|
|
||
| end Subroutine Ham_Langevin_HMC_S0_base | ||
|
|
||
| !-------------------------------------------------------------------- | ||
| !> @author | ||
| !> ALF Collaboration | ||
| !> | ||
| !> @brief | ||
| !> Forces_0(n,nt) = \partial S_0 / \partial s(n,nt) are calculated and returned to main program. | ||
| !> | ||
| !------------------------------------------------------------------- | ||
| Subroutine Ham_Langevin_HMC_S0_single_base(Force_0,n,nt) | ||
|
|
||
| Implicit none | ||
|
|
||
| Real (Kind=Kind(0.d0)), Intent(inout) :: Force_0 | ||
| integer , intent(in) :: n, nt | ||
|
|
||
| logical, save :: first_call=.True. | ||
| real (kind=kind(0.d0)), allocatable :: forces_0(:,:) | ||
|
|
||
| allocate(forces_0(size(nsigma%f,1),size(nsigma%f,2))) | ||
| call ham%Ham_Langevin_HMC_S0(Forces_0) | ||
| force_0 = forces_0(n,nt) | ||
|
|
||
| if (first_call) then | ||
| write(output_unit,*) | ||
| write(output_unit,*) "ATTENTION: Base implementation of Ham_Langevin_HMC_S0_single is being called!" | ||
| write(output_unit,*) "This uses the subroutine Ham_Langevin_HMC_S0, which provides all bosonic forces." | ||
| write(output_unit,*) "Since Ham_Langevin_HMC_S0_single only requires one force this might be inefficient." | ||
| write(output_unit,*) "Consider overwriting this routine according to the model in your Hamiltonian." | ||
| write(output_unit,*) "Suppressing further printouts of this message." | ||
| write(output_unit,*) | ||
| first_call=.False. | ||
| endif | ||
|
|
||
| deallocate(forces_0) | ||
|
|
||
| end Subroutine Ham_Langevin_HMC_S0_single_base | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
||
| !-------------------------------------------------------------------- | ||
| !> @author | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,6 +142,9 @@ | |
| procedure, nopass :: S0 | ||
| procedure, nopass :: Ham_Langevin_HMC_S0 | ||
| procedure, nopass :: Get_Delta_S0_global | ||
| procedure, nopass :: Global_move_tau | ||
| procedure, nopass :: Overide_global_tau_sampling_parameters | ||
| procedure, nopass :: Global_move | ||
| #ifdef HDF5 | ||
| procedure, nopass :: write_parameters_hdf5 | ||
| #endif | ||
|
|
@@ -960,5 +963,130 @@ Real (Kind=kind(0.d0)) Function Get_Delta_S0_global(Nsigma_old) | |
| ! S0 = exp( (-Hs_new**2 + nsigma%f(n,nt)**2 ) /2.d0 ) | ||
|
|
||
| end Function Get_Delta_S0_global | ||
|
|
||
| end submodule ham_Hubbard_smod | ||
|
|
||
| !-------------------------------------------------------------------- | ||
| !> @author | ||
| !> ALF Collaboration | ||
| !> | ||
| !> @brief | ||
| !> Specify a global move on a given time slice tau. | ||
| !> | ||
| !> @details | ||
| !> @param[in] ntau Integer | ||
| !> \verbatim | ||
| !> Time slice | ||
| !> \endverbatim | ||
| !> @param[out] T0_Proposal_ratio, Real | ||
| !> \verbatim | ||
| !> T0_Proposal_ratio = T0( sigma_new -> sigma ) / T0( sigma -> sigma_new) | ||
| !> \endverbatim | ||
| !> @param[out] S0_ratio, Real | ||
| !> \verbatim | ||
| !> S0_ratio = e^( S_0(sigma_new) ) / e^( S_0(sigma) ) | ||
| !> \endverbatim | ||
| !> @param[out] Flip_length Integer | ||
| !> \verbatim | ||
| !> Number of flips stored in the first Flip_length entries of the array Flip_values. | ||
| !> Has to be smaller than NDIM | ||
| !> \endverbatim | ||
| !> @param[out] Flip_list Integer(Ndim) | ||
| !> \verbatim | ||
| !> List of spins to be flipped: nsigma%f(Flip_list(1),ntau) ... nsigma%f(Flip_list(Flip_Length),ntau) | ||
| !> Note that Ndim = size(Op_V,1) | ||
| !> \endverbatim | ||
| !> @param[out] Flip_value Real(Ndim) | ||
| !> \verbatim | ||
| !> Flip_value(:)= nsigma%flip(Flip_list(:),ntau) | ||
| !> Note that Ndim = size(Op_V,1) | ||
| !> \endverbatim | ||
| !-------------------------------------------------------------------- | ||
| Subroutine Global_move_tau(T0_Proposal_ratio, S0_ratio, & | ||
| & Flip_list, Flip_length,Flip_value,ntau) | ||
|
|
||
| Implicit none | ||
| Real (Kind = Kind(0.d0)), INTENT(OUT) :: T0_Proposal_ratio, S0_ratio | ||
| Integer , INTENT(OUT) :: Flip_list(:) | ||
| Complex (Kind = Kind(0.d0)),INTENT(OUT) :: Flip_value(:) | ||
| Integer, INTENT(OUT) :: Flip_length | ||
| Integer, INTENT(IN) :: ntau | ||
|
|
||
| If (.not.Continuous) then | ||
| Write(6,*) "Error: Global_move_tau_base is implemented only continuous HS fields. Please implement it or set Continuous = False in the input file. " | ||
| CALL Terminate_on_error(ERROR_HAMILTONIAN,__FILE__,__LINE__) | ||
| endif | ||
| Flip_length = 1 | ||
| Flip_list(1) = nranf(Size(Op_V,1)) | ||
| Flip_value(1) = nsigma%flip(Flip_list(1),ntau) | ||
| T0_Proposal_ratio = 1.d0 | ||
| S0_ratio = S0(Flip_list(1),ntau,Flip_value(1)) | ||
|
|
||
|
|
||
| end Subroutine Global_move_tau | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does this relate to MALA moves? |
||
|
|
||
| !-------------------------------------------------------------------- | ||
| !> @author | ||
| !> ALF Collaboration | ||
| !> | ||
| !> @brief | ||
| !> This routine allows to user to determine the global_tau sampling parameters at run time | ||
| !> It is especially usefull if these parameters are dependent on other parameters. | ||
| !> | ||
| !> @details | ||
| !> \endverbatim | ||
| !-------------------------------------------------------------------- | ||
| Subroutine Overide_global_tau_sampling_parameters(Nt_sequential_start,Nt_sequential_end, & | ||
| & N_Global_tau, N_Global_tau_MALA) | ||
|
|
||
| Implicit none | ||
| Integer, Intent(INOUT) :: Nt_sequential_start,Nt_sequential_end, N_Global_tau, N_Global_tau_MALA | ||
|
|
||
| N_Global_tau = Size(Op_V,1) | ||
|
|
||
| end Subroutine Overide_global_tau_sampling_parameters | ||
|
|
||
| !-------------------------------------------------------------------- | ||
| !> @author | ||
| !> ALF Collaboration | ||
| !> | ||
| !> @brief | ||
| !> Global moves | ||
| !> | ||
| !> @details | ||
| !> This routine generates a | ||
| !> global update and returns the propability T0_Proposal_ratio = T0( sigma_out-> sigma_in ) / T0( sigma_in -> sigma_out) | ||
| !> @param [IN] nsigma_old, Type(Fields) | ||
| !> \verbatim | ||
| !> Old configuration. The new configuration is stored in nsigma. | ||
| !> \endverbatim | ||
| !> @param [OUT] T0_Proposal_ratio Real | ||
| !> \verbatimam | ||
| !> T0_Proposal_ratio = T0( sigma_new -> sigma_old ) / T0( sigma_old -> sigma_new) | ||
| !> \endverbatim | ||
| !> @param [OUT] Size_clust Real | ||
| !> \verbatim | ||
| !> Size of cluster that will be flipped. | ||
| !> \endverbatim | ||
| !------------------------------------------------------------------- | ||
| Subroutine Global_move(T0_Proposal_ratio, nsigma_old, size_clust) | ||
|
|
||
| Implicit none | ||
| Real (Kind=Kind(0.d0)), intent(out) :: T0_Proposal_ratio, size_clust | ||
| Type (Fields), Intent(IN) :: nsigma_old | ||
|
|
||
| Integer :: nt, n | ||
|
|
||
| If (.not.Continuous) then | ||
| Write(6,*) "Error: Global_move_tau_base is implemented only continuous HS fields. Please implement it or set Continuous = False in the input file. " | ||
| CALL Terminate_on_error(ERROR_HAMILTONIAN,__FILE__,__LINE__) | ||
| endif | ||
| size_clust = Ltrot | ||
| n = nranf(Size(Op_V,1)) | ||
| do nt = 1,Ltrot | ||
| nsigma%f(n,nt) = -nsigma_old%f(n,nt) | ||
| enddo | ||
| T0_Proposal_ratio = 1 | ||
|
|
||
|
|
||
| End Subroutine Global_move | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the relation between those global moves and MALA updates? |
||
|
|
||
| end submodule ham_Hubbard_smod | ||
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.
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?