Deborah.Rahab.ZeroTemperatureScale

Deborah.Rahab.ZeroTemperatureScale.g0sqMethod
g0sq(
    beta; 
    Nc=3
) -> Float64

Compute the bare gauge coupling squared $g_0^2$ from $\beta$.

Definition

\[\beta = \frac{2N_c}{g_0^2} \;\;\;\Rightarrow\;\;\; g_0^2 = \frac{2N_c}{\beta}\]

Arguments

  • beta::Real : Gauge coupling parameter $\beta$.
  • Nc::Int=3 : Number of colors (default = $3$).

Returns

  • Float64 : The bare coupling squared $g_0^2$.
source
Deborah.Rahab.ZeroTemperatureScale.id_conversionsMethod
id_conversions(t0a; invt0) -> (ainv_GeV, a_fm)

Convert $\sqrt{t_0}/a$ at a given $\beta$ into lattice spacing quantities using the $\text{GeV}$ convention:

Definitions (user convention)

  • $a^{-1}$ in $[\text{GeV}]$

\[\texttt{ainv\_GeV} = \texttt{t0a} \times \texttt{invt0}\]

  • $a$ in $[\text{fm}]$ ($1000 \; \text{MeV} = 1 \; \text{GeV}$)

\[\texttt{a\_fm} = \frac{\hbar c \, [\text{MeV} \cdot \text{fm}]}{\texttt{ainv\_GeV} \times 1000}\]

Arguments

  • t0a::Real : Value of $\dfrac{\sqrt{t_0}}{a}$ (dimensionless).
  • invt0::Float64 : $\dfrac{1}{\sqrt{t_0}_{\text{phys}}}$ in $[\text{GeV}]$.

Returns

  • (ainv_GeV::Float64, a_fm::Float64) :
    • ainv_GeV : $a^{-1}$ in $[\text{GeV}]$.
    • a_fm : $a$ in $[\text{fm}]$.

Notes

  • If you instead keep invt0 in $[\text{fm}^{-1}]$, do not use this function; either convert to $\text{GeV}$ first (invt0_GeV = invt0_perfm * ħc_MeVfm / 1000) or write a dedicated per-fm variant to avoid mixed units.
source
Deborah.Rahab.ZeroTemperatureScale.kappa_cMethod
kappa_c(
    beta; 
    Nc=3
) -> Float64

Interpolation formula for the critical hopping parameter $\kappa_c$ at $N_{\text{f}} = 4$.

Polynomial form (provided by the user):

\[\kappa_c(g_0^2) \;=\; 0.125 + 0.003681192 \, g_0^2 + 0.000117 \,(g_0^2)^2 + 0.000048 \,(g_0^2)^3 - 0.000013 \,(g_0^2)^4\]

with $g_0^2 = \dfrac{2N_c}{\beta}$.

Arguments

  • beta::Real : Gauge coupling parameter $\beta$.
  • Nc::Int=3 : Number of colors (default = $3$).

Returns

  • Float64 : The critical hopping parameter $\kappa_c$.
source
Deborah.Rahab.ZeroTemperatureScale.mps_GeVMethod
mps_GeV(
    mpsa, 
    ainv_GeV
) -> Float64

Convert a dimensionless pseudoscalar mass $m_{\text{PS}} \, a$ to physical units $[\text{GeV}]$ using lattice inverse spacing in $[\text{GeV}]$:

\[ m_{PS}[\text{GeV}] = \texttt{mPSa} \times (a^{-1}[\text{GeV}])\]

Arguments

  • mpsa::Real : Dimensionless mass $m_{\text{PS}} \, a$.
  • ainv_GeV::Real : Lattice inverse spacing $a^{-1}$ in $[\text{GeV}]$.

Returns

  • Float64 : $m_{\text{PS}}$ in $[\text{GeV}]$.

Warning

  • Do not pass 1/a_fm here. If you only have a_fm in $\text{fm}$, either invert and multiply by $\dfrac{\hbar c}{1000}$ outside, or write a separate helper for the $[\text{fm}^{-1}]$ convention.
source
Deborah.Rahab.ZeroTemperatureScale.mqa_subMethod
mqa_sub(
    kappa, 
    beta; 
    Nc=3
) -> Float64

Compute the subtracted bare quark mass for Wilson fermions.

Definition

\[m_q a \;=\; \frac{1}{2} \left( \frac{1}{\kappa} - \frac{1}{\kappa_c(\beta)} \right)\]

where $\kappa_c(\beta)$ is obtained from the interpolation polynomial at given $\beta$.

Arguments

  • kappa::Real : Hopping parameter $\kappa$.
  • beta::Real : Gauge coupling parameter $\beta$.
  • Nc::Int=3 : Number of colors (default = 3).

Returns

  • Float64 : The subtracted bare quark mass (dimensionless).
source
Deborah.Rahab.ZeroTemperatureScale.plot_mps2_vs_mqa_sub!Method
plot_mps2_vs_mqa_sub!(
    x::AbstractVector{<:Real},
    y::AbstractVector{<:Real},
    σy::AbstractVector{<:Real},
    d0::Real,
    d1::Real;
    label_data::AbstractString = "raw T=0",
    label_fit::AbstractString = "fit f(x)",
    save_file::Union{Bool,AbstractString} = false
) -> Tuple{PyPlot.Figure, PyPlot.Axes}

Plot $(m_{\text{PS}} \, a)^2$ vs $m_q \, a$ with error bars and quadratic fit

\[(m_{\text{PS}} \, a)^2 = d_0 \, x + d_1 \, x^2\]

Arguments

  • x : Vector of $m_q \, a$ values.
  • y : Vector of $(m_{\text{PS}} \, a)^2$ values.
  • σy : Vector of uncertainties for $y$.
  • d0,d1: Fit coefficients for the quadratic model.

Keywords

  • label_data : Legend label for data points.
  • label_fit : Legend label for the fit curve.
  • save_file : false (no save), true (default name), or String (filename).

Returns

  • (fig, ax) : PyPlot.jl figure and axis objects.
source
Deborah.Rahab.ZeroTemperatureScale.plot_t0a_vs_mqa_sub!Method
plot_t0a_vs_mqa_sub!(
    x::AbstractVector{<:Real},
    y::AbstractVector{<:Real},
    σy::AbstractVector{<:Real},
    c0::Real,
    c1::Real;
    label_data::AbstractString = "raw T=0",
    label_fit::AbstractString = "fit f(x)",
    save_file::Union{Bool,AbstractString} = false
) -> Tuple{PyPlot.Figure, PyPlot.Axes}

Plot $\sqrt{t_0}/a$ vs $m_q \, a$ with error bars and linear fit

\[\frac{\sqrt{t_0}}{a} = c_0 + c_1 \, x \,.\]

Arguments

  • x : Vector of $m_q \, a$ values.
  • y : Vector of $\sqrt{t_0}/a$ values.
  • σy : Vector of uncertainties for $y$.
  • c0,c1: Fit coefficients for the linear model.

Keywords

  • label_data : Legend label for data points.
  • label_fit : Legend label for the fit line.
  • save_file : false (no save), true (default name), or String (filename).

Returns

  • (fig, ax) : PyPlot.jl figure and axis objects.
source
Deborah.Rahab.ZeroTemperatureScale.read_spectroscopy_tableMethod
read_spectroscopy_table(
    path::AbstractString
) -> NamedTuple

Read a spectroscopy table stored in a plain text file where data are arranged row-by-row and column-by-column in fixed order (cf. hspec.dat).

The expected header is:

# beta kappa L T sqrt(t0)/a err  mPSa err  mNa err  mqa err

Lines starting with # are ignored. Scientific notation with E/e is accepted. Malformed lines are skipped.

Arguments

  • path::AbstractString : Path to the data file.

Returns

  • NamedTuple with fields:
    • beta::Vector{Float64},
    • kappa::Vector{Float64},
    • L::Vector{Int},
    • Nt::Vector{Int},
    • t0a::Vector{Float64},
    • t0e::Vector{Float64},
    • mpsa::Vector{Float64},
    • mpse::Vector{Float64},
    • mna::Vector{Float64},
    • mne::Vector{Float64},
    • mqa::Vector{Float64},
    • mqae::Vector{Float64}.
source
Deborah.Rahab.ZeroTemperatureScale.run_zero_analysisMethod
run_zero_analysis(
    path::String,
    beta::String;
    Nc::Int = 3,
    invt0_GeV::Float64 = 1.347,
    target_kappas::Vector{Float64}
) -> NamedTuple{(:beta, :Nc, :invt0_GeV, :fit_mps2, :fit_t0a, :results)}

Run a zero-temperature $\beta$-slice analysis from an hspec-style table.

Pipeline:

  1. Filter rows at the specified $\beta$.
  2. Build $x \equiv m_q \, a$ via the $N_\text{f}=4$ $\kappa_c(g_0^2)$ interpolation and compute:
    • $(m_{\text{PS}} \, a)^2$ and $\sqrt{t_0}/a$.
  3. Perform weighted least-squares fits:
    • $(m_{\text{PS}} \, a)^2 = d_0 \, x + d_1 \, x^2$,
    • $\sqrt{t_0}/a = c_0 + c_1 \, x$.
  4. Print fit summaries with compact avg±err formatting.
  5. Predict ID-style quantities at target_kappas:
    • t0a, $a^{-1}\;\text{[GeV]}$, $a\;\text{[fm]}$, $m_{\text{PS}}\;\text{[GeV]}$.
  6. Plot $(m_{\text{PS}} \, a)^2$ vs $m_q \, a$ and $\sqrt{t_0}/a$ vs $m_q \, a$ (PDF saving handled inside each plotter).

Unit convention:

  • invt0_GeV is $1/\sqrt{t_0}_{\text{phys}}$ in $[\text{GeV}]$.
  • Then $a^{-1}\;\text{[GeV]}$ = $\sqrt{t_0}/a \times 1/\sqrt{t_0}_{\text{phys}}\;\text{[GeV]}$, and $m_{\text{PS}}\;\text{[GeV]}$ = $(m_{\text{PS}} \, a) \times a^{-1}\;\text{[GeV]}$.

Arguments

  • path::String : Input file path (e.g., "hspec.dat"), whitespace-delimited with the header # beta kappa L T sqrt(t0)/a err mPSa err mNa err mqa err.
  • beta::String : $\beta$ value selector (e.g., "1.60").

Keywords

  • Nc::Int=3 : Number of colors.
  • invt0_GeV::Float64=1.347 : $1/\sqrt{t_0}_{\text{phys}}$ in $[\text{GeV}]$ ($\text{GeV}$ convention).
  • target_kappas::Vector{Float64} : $\kappa$ list at which to make predictions (required).

Returns

  • NamedTuple with fields:
    • beta::Float64
    • Nc::Int
    • invt0_GeV::Float64
    • fit_mps2 : (d0, d1, d0err, d1err, chi2_dof)
    • fit_t0a : (c0, c1, c0err, c1err, chi2_dof)
    • results::Vector{NamedTuple} where each item has (kappa, mqa_sub, t0a, ainv_GeV, a_fm, mPS_GeV)

Notes

source
Deborah.Rahab.ZeroTemperatureScale.wls_linearMethod
wls_linear(
    x::AbstractVector, 
    y::AbstractVector, 
    σy::AbstractVector
) -> (c0, c1, cov, χ², dof)

Perform a weighted least-squares (WLS) linear regression of the form:

\[y = c_0 + c_1 \, x\]

using uncertainties $\sigma_y$ as weights.

Arguments

  • x::AbstractVector : Independent variable values.
  • y::AbstractVector : Dependent variable values.
  • σy::AbstractVector : Uncertainties for each $y$ value.

Returns

  • c0::Float64 : Intercept.
  • c1::Float64 : Slope.
  • cov::Matrix : $2 \times 2$ covariance matrix of the fit parameters.
  • χ²::Float64 : Chi-squared value of the fit.
  • dof::Int : Degrees of freedom (max(N-2,1)).
source
Deborah.Rahab.ZeroTemperatureScale.wls_quadraticMethod
wls_quadratic(
    x::AbstractVector, 
    y::AbstractVector, 
    σy::AbstractVector
) -> (d0, d1, cov, χ², dof)

Perform a weighted least-squares (WLS) quadratic regression of the form:

\[y = d_0 \, x + d_1 \, x^2\]

(no constant term), using uncertainties $\sigma_y$ as weights.

Arguments

  • x::AbstractVector : Independent variable values.
  • y::AbstractVector : Dependent variable values.
  • σy::AbstractVector : Uncertainties for each $y$ value.

Returns

  • d0::Float64 : Linear coefficient.
  • d1::Float64 : Quadratic coefficient.
  • cov::Matrix : $2 \times 2$ covariance matrix of the fit parameters.
  • χ²::Float64 : Chi-squared value of the fit.
  • dof::Int : Degrees of freedom (max(N-2,1)).
source