Skip to content

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 ​

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

fortran
subroutine SU2_updateLinks(U, beta, UUpdated, master_key, sweep_id)

Arguments

NameTypeIntentAttributesDescription
Ucomplex(kind=WC)indimension(:, :, :, :, :, :, 😃Gaugefield [2,2,4,nt,nx,ny,nz]
betareal(kind=WP)inbeta-value
UUpdatedcomplex(kind=WC)inoutdimension(:, :, :, :, :, :, 😃Output updated gaugefield [2,2,4,nt,nx,ny,nz]
master_keyinteger(kind=C64)indimension(2)Philox Key
sweep_idintegerinA 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

fortran
subroutine stapleAt(U, V, coord, mu)

Arguments

NameTypeIntentAttributesDescription
Ucomplex(kind=WC)indimension(:, :, :, :, :, :, 😃Input gaugefield [2,2,4,nt,nx,ny,nz]
Vcomplex(kind=WC)outdimension(2, 2)Output Wilson-type staple
coordintegerindimension(4)Staple is at this coordinate
muintegerinStaple 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)

fortran
function getLambda2(alpha, beta, key, counter0) result(lambda2)

Arguments

NameTypeIntentAttributesDescription
alphareal(kind=WP)inalpha and beta parameters (beta is fixed for given sim.)
betareal(kind=WP)inalpha and beta parameters (beta is fixed for given sim.)
keyinteger(kind=C64)indimension(2)Philox keys
counter0integer(kind=C64)indimension(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)

fortran
function getXVec(x0, key, counter0) result(xvec)

Arguments

NameTypeIntentAttributesDescription
x0real(kind=WP)inThe zeroth random number that sets the condition on the 3-vec of random numbers
keyinteger(kind=C64)indimension(2)Philox key
counter0integer(kind=C64)indimension(4)Philox keys

Call graph

constructXMatrix ​

Construct the SU(2) heatbath matrix X used in the update.

This wraps together:

  1. sampling lambda^2,
  2. constructing x0 = 1 - 2 lambda^2,
  3. sampling the spatial part x(1:3),
  4. 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)

fortran
function constructXMatrix(alpha, beta, key, counter0, subgroup_id) result(X)

Arguments

NameTypeIntentAttributesDescription
alphareal(kind=WP)inalpha and beta parameters (beta fixed for given sim.)
betareal(kind=WP)inalpha and beta parameters (beta fixed for given sim.)
keyinteger(kind=C64)indimension(2)Philox keys
counter0integer(kind=C64)indimension(4)Philox Keys
subgroup_idintegerinDescribes the SU2 subgroup

Call graph

Compute the new SU(2) link at one site and one direction.

Steps:

  1. Compute the staple V.
  2. Compute alpha from det(V).
  3. Build the heatbath matrix X using Philox.
  4. 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)

fortran
function su2_updated_link(U, beta, coord, mu, key, dims) result(Unew)

Arguments

NameTypeIntentAttributesDescription
Ucomplex(kind=WC)indimension(:, :, :, :, :, :, 😃Input gaugefield [2,2,4,nt,nx,ny,nz]
betareal(kind=WP)inbeta-value
coordintegerindimension(4)Base coordinate of link to update [it,ix,iy,zi]
muintegerinDirection to update
keyinteger(kind=C64)indimension(2)Philox key
dimsintegerindimension(4)Lattice dimensions [nt,nx,ny,nz]

Call graph