qlat_scripts.v1.auto_check — Checker Routines for Propagator Validation¶
Source: qlat/qlat_scripts/v1/auto_check.py
Note: Update this document when updating the source file.
Outline¶
Overview¶
This module provides simplified checker routines for validating wall-source and point-source propagator computations. Unlike the full gen_data pipeline, these functions perform exact-accuracy inversions at all time slices or all lattice points without AMA multi-accuracy or importance sampling. They are intended for correctness checks and testing.
Key features:
Wall-source propagator generation at every time slice with exact accuracy
Point-source propagator generation at every lattice point with exact accuracy
Propagator loading from disk into a cache
A
get_prop(flavor, p_snk, p_src)lookup function that returns Wilson matrix elements for all source/sink combinations (point-point, point-wall, wall-point, wall-wall)
Wall-Source Checker¶
get_all_points(total_site)¶
Returns a plain Python list of all lattice points as q.Coordinate objects.
get_all_points_psel(total_site)¶
Returns a q.PointsSelection containing every point on the lattice (full selection).
run_get_inverter_checker(job_tag, traj, *, inv_type, get_gf, get_gt=None, get_eig=None)¶
Pre-computes and caches the exact-accuracy (inv_acc=2) inverter. Used internally by the checker routines.
compute_prop_wsrc_all_checker(job_tag, traj, *, inv_type, gf, gt, eig)¶
Runs wall-source inversions for all time slices. Saves outputs to:
{job_tag}/prop-wsrc-{flavor}/traj-{traj}/(selected-field data){job_tag}/psel-prop-wsrc-{flavor}/traj-{traj}/(point-selected data)
run_prop_wsrc_checker(job_tag, traj, *, inv_type, get_gf, get_eig, get_gt)¶
Top-level entry point for wall-source checker. Skips if output already exists. Uses file-based locking (q.obtain_lock) for mutual exclusion.
Point-Source Checker¶
compute_prop_psrc_all_checker(job_tag, traj, *, inv_type, gf, gt, eig)¶
Runs point-source inversions for all lattice points (from get_all_points). Saves output to {job_tag}/prop-psrc-{flavor}/traj-{traj}/.
run_prop_psrc_checker(job_tag, traj, *, inv_type, get_gf, get_eig, get_gt)¶
Top-level entry point for point-source checker. Skips if output already exists.
Propagator Loading¶
load_prop_psrc(job_tag, traj, inv_type)¶
Loads all point-source propagators from disk into the prop_cache under key "psnk-psrc". Each propagator is projected onto the full point selection via q.PselProp.
load_prop_wsrc(job_tag, traj, inv_type)¶
Loads all wall-source propagators from disk into the prop_cache under keys "psnk-wsrc" (point-sink) and "wsnk-wsrc" (wall-sink).
run_get_prop_checker(job_tag, traj, *, get_gf, get_gt)¶
Returns a lazy callable get_prop(flavor, p_snk, p_src) that performs all loading on first invocation. The lookup function supports:
Source |
Sink |
Lookup |
|---|---|---|
point |
point |
|
point |
wall |
|
wall |
point |
|
wall |
wall |
|
Propagator Lookup¶
The get_prop function returned by run_get_prop_checker uses the convention:
p_snkandp_srcare(type_tag, position)tuplestype_tagis"point"or"wall"For
"point", position is aq.Coordinate; for"wall", position is a time-slice integerFlavor is
"l"(light) or"s"(strange)
Examples¶
import qlat as q
q.begin_with_mpi([[1, 1, 1, 4]])
import qlat_scripts.v1 as qs
job_tag = "test-4nt8"
traj = 1000
get_gf = qs.run_gf(job_tag, traj)
get_gt = qs.run_gt(job_tag, traj, get_gf)
# Run wall-source checker for light quarks
qs.run_prop_wsrc_checker(job_tag, traj, inv_type=0,
get_gf=get_gf, get_eig=None, get_gt=get_gt)
# Run point-source checker for strange quarks
qs.run_prop_psrc_checker(job_tag, traj, inv_type=1,
get_gf=get_gf, get_eig=None, get_gt=get_gt)
# Load and use propagators
get_prop = qs.run_get_prop_checker(job_tag, traj, get_gf=get_gf, get_gt=get_gt)
# get_prop("l", ("point", xg_snk), ("wall", t_src)) after first call
q.end_with_mpi()