Contractions and other extras

The extras package adds the contraction, smearing and output routines that a production measurement needs and that would be too slow written in Lua. Everything here is three colors and four dimensions, and t_axis always names the time direction as a number in [0, #L).

General contractions

qcd.contract_

qcd.contract_(what, data [, options])             --> table of L:Complex

The general contraction entry point. what names the contraction:

whatdata
qbarq_g_F_B, qbarq_g_F_aB, qbarq_g_F_hB{P1, P2}
meson_F_B, meson_F_aB, meson_F_hB{P1, P2}
qbarq_g_vD_vD, qbarq_g_vD_avD, qbarq_g_vD_hvD{{D1,...}, {D2,...}}
qpdf_g_F_B, tmd_g_F_B{P1, P2, U, lpath_spec}
baryon_sigma_UUS{P1, P2, P3, S2, S1}
baryon_pdecayA_UDQ, baryon_pdecayB_UDQ{P1, P2, P3}

The options:

KeyMeaning
resultreturn the complex fields; true by default unless save or momproj is given
save{file = writer, kpath = path, mkey = "", fkey = "_", aff_flat = false}
momproj{csrc = {...}, mom_list = {...}, t_axis = n, bc_t = 1, tlen = -1, ft_sign = 1}

save.file is an AFF or an HDF5 writer; kpath is where in it the records go. mkey prefixes the momentum part of a generated key — "", "P" or "q" — and fkey prefixes the field part. With aff_flat = true the data goes into one flat AFF record with the metadata as sub-keys rather than into a key tree.

momproj.csrc is the source position, the reference point for the momentum phase; mom_list is the list of spatial momenta, with the time component left out; bc_t is the time boundary condition used for the wrap-around; tlen restricts the time slices to [x_4, x_4 + tlen); ft_sign is the sign of the exponent.

qcd.csave_

qcd.csave_(fields, {save = {...}, momproj = {...}})  --> nothing

Momentum-projects a table of lattice Complex fields and writes the result, using exactly qcd.contract_'s save and momproj option tables. Both are required.

qcd.save_momproj

qcd.save_momproj(writer, kpath, fields, csrc, mom_list, t_axis, bc_t
                 [, {tlen = -1, ft_sign = 1, mkey = "", fkey = "_",
                     aff_flat = false}])          --> nothing

The older, positional form of qcd.csave_. Kept for scripts that already use it; new code should prefer qcd.csave_.

qcd.contract_state

qcd.contract_state(what, {F, B, U} [, options])   --> contract state

A contraction held open across several link paths, so that the propagators are imported once and stepped along a path rather than re-imported for every displacement. what is one of the qpdf_g_F_B, bb_g_F_B and tmd_g_F_B contractions.

MethodMeaning
s:step(b_lpath [, v_lpath])advances along one link path and contracts
s.lattice, s.F, s.B, s.Uthe objects it was built from

step takes one link-path string for qpdf and bb, and two — the b and v paths — for tmd.

Baryon and meson building blocks

qcd.save_bb

qcd.save_bb(writer, kpath, frw_prop, bkw_prop, csrc, tsnk,
            qext4d_list, time_rev, t_axis, bc_baryon)  --> nothing

Computes and writes the baryon building blocks. frw_prop is the forward propagator, bkw_prop the backward one — already adjoined — csrc the source coordinate used as the momentum reference, tsnk the sink time slice, qext4d_list the list of four-momenta, time_rev whether time runs backwards, and bc_baryon the time boundary condition.

qcd.save_bb_fast

qcd.save_bb_fast(writer, kpath, frw_prop, bkw_prop, csrc, tlen,
                 qext4d_list, time_rev, t_axis, bc_baryon)  --> nothing

The same, with tlen — the length of the time extent to cover — in place of a single sink time slice.

qcd.baryon_duu

qcd.baryon_duu(Pd, Pu11, Pu12, Pu21, Pu22, Sf, Si_bar, RTR)  --> L:Complex

A d-plus-two-u baryon contraction. The five propagators are lattice DiracPropagators over three colors; Sf, Si_bar and RTR are spin matrices, each a gamma or a 4×4 matrix.complex. Present only in a build with GSL.

NPR

qcd.save_npr_prop

qcd.save_npr_prop(aff_writer, kpath, prop, ft_mom, ft_x0)  --> nothing

Writes the momentum projection Σ_x prop(x) · exp(-i·ft_mom·(x − ft_x0)).

qcd.save_npr_2qvertex

qcd.save_npr_2qvertex(aff_writer, kpath, frw_prop, bkw_prop,
                      ft_mom, ft_x0)              --> nothing

The two-quark vertex, projected the same way.

LapH

qcd.save_q2pt

qcd.save_q2pt(h5_file, h5_path, t_src, j_vec, j_spin, sol,
              vec_list, t_axis)                   --> nothing

One LapH two-point function. t_src, j_vec and j_spin identify the source; sol is the solution vector; vec_list the LapH eigenvectors. Present only in a build with HDF5.

qcd.save_q2pt_list

qcd.save_q2pt_list(h5_file, h5_path, sol_list, vec_list, t_axis)  --> nothing

Several at once. sol_list is a list of {tsrc, jvec, jspin, sol}.

qcd.save_q3pt_selectspin

qcd.save_q3pt_selectspin(h5_file, h5_path, max_vec, src_list, snk_list,
                         t_axis, c0, qmom_list,
                         t12op_list, i_t12op, max_t12op)  --> nothing

LapH three-point functions. src_list and snk_list are lists of {t, jvec, jspin, sol}, each with a single common time; c0 is the reference coordinate for the Fourier transform; qmom_list the insertion momenta; i_t12op either a starting index or a list of indices.

qcd.save_laph_wf_baryon_pwave

qcd.save_laph_wf_baryon_pwave(h5_file, h5_path, v1, v2, v3,
                              ft_mom, t_axis, ft_x0)  --> nothing

The p-wave baryon wave function from three LapH eigenvectors.

Smearing kernels

qcd.laplacian

qcd.laplacian(a, b, gauge_u, x [, {iter = 1, skip_axis = -1}])  --> field

Applies (a + b·Δ) to x, where Δ is the gauge-covariant Laplacian built from gauge_u. x is any colored lattice field. iter repeats the application; skip_axis leaves one axis out, which is how a three-dimensional Laplacian is asked for on a four-dimensional lattice.

qcd.laplacian_opt is the same function under another name; qcd.laplacian_std is the older, unoptimized implementation, kept so that the two can be compared.

qcd.laplacian_bcderiv1

qcd.laplacian_bcderiv1(a, b, mu, gauge_u, x, dx
                       [, {iter = 1, skip_axis = -1}])  --> field

The first derivative of (a + b·Δ) with respect to the boundary condition in direction mu, applied to (x, dx).

qcd.xwilson

qcd.xwilson(a, b, U, F [, {dag = false}])         --> field

Applies (a + b·X_w) to F, where X_w is the Wilson–Dirac hopping term. F is a lattice DiracFermion or DiracPropagator. The ordinary Wilson–Dirac operator is a = M_w, b = -1. With dag = true the conjugate term is used.

qcd.xwilson_bcderiv1

qcd.xwilson_bcderiv1(mu, U, F [, {dag = false}])  --> field

The first derivative of the hopping term with respect to the boundary condition in direction mu.

qcd.xwilson_bcderiv2

qcd.xwilson_bcderiv2(mu, U, F [, {dag = false}])  --> field

The second derivative.

qcd.su3_dexp

qcd.su3_dexp(q, a)                                --> exp_iq, dexp_iq

For a traceless anti-Hermitian q and a direction a, both lattice ColorMatrix fields over three colors, returns exp(i q) and its derivative along a. The kernel behind a stout-smearing force.

Fourier transforms

qcd.fourier_transf

qcd.fourier_transf(x, sign [, dir])               --> L:Complex

The discrete Fourier transform of a lattice Complex field, on the same lattice. sign is +1 for y_k = Σ_x exp(+ikx) x_x and -1 for the other sign. dir is the axis to transform, or nil for all of them.

qcd.fourier_transf_array

qcd.fourier_transf_array(fields, sign
                         [, {ft_twist = 0, ft_inverse = false}])  --> table

Transforms along the index of a list of fields rather than along a lattice axis:

B_k = Σ_x exp(+sign·i·(2π/L)·x·(k + ft_twist)) A_x

and, with ft_inverse = true, the inverse with the opposite sign. The result is a list of the same length.

Diagnostics

qcd.test_qopt

qcd.test_qopt(...)                                --> varies

The built-in self-test of the option-table parser. A development hook; it has no use in a measurement.