FLUE_SU2_heatbath
SU(2) heatbath update
Key points:
- No stdlib random routines are used.
- getLambda2() uses philox_uniform_oo on (0,1),
- getXVec() uses philox_uniform_co on [-1,1)
- The update is staged by direction and colour so the inner site loop can be expressed as do concurrent.
Source: src/gauge_SU2/heatbath.f90
Dependencies
Contents
Subroutines
SU2_updateLinks
Update all SU(2) links on the lattice.
The update is staged by:
- direction mu
- checkerboard parity colour
so that each do concurrent block updates an independent set of links.
Inputs: U : current lattice beta : gauge coupling master_key : user-provided Philox master key sweep_id : identifies the sweep so keys vary deterministically
Output: UUpdated : updated lattice
subroutine SU2_updateLinks(U, beta, UUpdated, master_key, sweep_id)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
U | complex(kind=WC) | in | dimension(:, :, :, :, :, :, 😃 | Gaugefield [2,2,4,nt,nx,ny,nz] |
beta | real(kind=WP) | in | beta-value | |
UUpdated | complex(kind=WC) | inout | dimension(:, :, :, :, :, :, 😃 | Output updated gaugefield [2,2,4,nt,nx,ny,nz] |
master_key | integer(kind=C64) | in | dimension(2) | Philox Key |
sweep_id | integer | in | A counter for Philox |
Call graph
stapleAt
Compute the standard Wilson-type staple for an SU(2) link.
The staple is evaluated at the link U_mu(coord), and is the sum of the forward and backward staples in all transverse directions nu != mu.
Attributes: pure
subroutine stapleAt(U, V, coord, mu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
U | complex(kind=WC) | in | dimension(:, :, :, :, :, :, 😃 | Input gaugefield [2,2,4,nt,nx,ny,nz] |
V | complex(kind=WC) | out | dimension(2, 2) | Output Wilson-type staple |
coord | integer | in | dimension(4) | Staple is at this coordinate |
mu | integer | in | Staple is in this direction |
Call graph
Functions
getLambda2
Sample lambda^2 for the SU(2) heatbath accept/reject step.
uses Philox draws directly.
Random-number conventions:
- ri(1:3) and rr are strictly in (0,1), so we use philox_fill_uniform_oo.
Counter usage: counter(1) = site id (passed in through counter0) counter(2) = subgroup id (set in constructXMatrix) counter(3) = attempt number (incremented here) counter(4) = phase id = 1 (lambda2 phase)
Attributes: pure
Returns: real(kind=WP)
function getLambda2(alpha, beta, key, counter0) result(lambda2)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
alpha | real(kind=WP) | in | alpha and beta parameters (beta is fixed for given sim.) | |
beta | real(kind=WP) | in | alpha and beta parameters (beta is fixed for given sim.) | |
key | integer(kind=C64) | in | dimension(2) | Philox keys |
counter0 | integer(kind=C64) | in | dimension(4) | Philox keys |
Call graph
getXVec
Sample a 3-vector uniformly from the unit ball, then rescale it so that ||xvec|| = sqrt(1 - x0^2).
Random-number convention:
- Each component is drawn from [-1,1), so we use philox_fill_uniform_co.
Counter usage: counter(1) = site id counter(2) = subgroup id counter(3) = attempt number counter(4) = phase id = 2 (x-vector phase)
Attributes: pure
Returns: real(kind=WP)
function getXVec(x0, key, counter0) result(xvec)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
x0 | real(kind=WP) | in | The zeroth random number that sets the condition on the 3-vec of random numbers | |
key | integer(kind=C64) | in | dimension(2) | Philox key |
counter0 | integer(kind=C64) | in | dimension(4) | Philox keys |
Call graph
constructXMatrix
Construct the SU(2) heatbath matrix X used in the update.
This wraps together:
- sampling lambda^2,
- constructing x0 = 1 - 2 lambda^2,
- sampling the spatial part x(1:3),
- building the corresponding SU(2) matrix.
subgroup_id is carried in counter(2) so the three SU(2) sub-updates inside an SU(3) heatbath update use disjoint Philox substreams.
Attributes: pure
Returns: complex(kind=WC)
function constructXMatrix(alpha, beta, key, counter0, subgroup_id) result(X)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
alpha | real(kind=WP) | in | alpha and beta parameters (beta fixed for given sim.) | |
beta | real(kind=WP) | in | alpha and beta parameters (beta fixed for given sim.) | |
key | integer(kind=C64) | in | dimension(2) | Philox keys |
counter0 | integer(kind=C64) | in | dimension(4) | Philox Keys |
subgroup_id | integer | in | Describes the SU2 subgroup |
Call graph
su2_updated_link
Compute the new SU(2) link at one site and one direction.
Steps:
- Compute the staple V.
- Compute alpha from det(V).
- Build the heatbath matrix X using Philox.
- Return the updated link: U' = X * (V / alpha)^dagger
If alpha is too small, the code falls back to a mild update with alpha=1.
Attributes: pure
Returns: complex(kind=WC)
function su2_updated_link(U, beta, coord, mu, key, dims) result(Unew)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
U | complex(kind=WC) | in | dimension(:, :, :, :, :, :, 😃 | Input gaugefield [2,2,4,nt,nx,ny,nz] |
beta | real(kind=WP) | in | beta-value | |
coord | integer | in | dimension(4) | Base coordinate of link to update [it,ix,iy,zi] |
mu | integer | in | Direction to update | |
key | integer(kind=C64) | in | dimension(2) | Philox key |
dims | integer | in | dimension(4) | Lattice dimensions [nt,nx,ny,nz] |
Call graph