95 KiB
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import pyerrors as pe
plt.style.use('./base_style.mplstyle')
import shutil
usetex = shutil.which('latex') not in ('', None)
plt.rc('text', usetex=usetex)
In this example we look at the analysis of the current quark mass (PCAC mass) on a test gauge field ensemble with fixed Schrödinger functional boundary conditions in the temporal direction.
Loading data¶
We can load data from preprocessed files which contains lists of pyerror
Obs
and convert them to Corr
objects as explained in the previous example. We use the parameter padding
to keep track of the fixed boundary conditions at both temporal ends of the lattice. This allows us to specify absolut temporal positions without having to keep track of any shifts in the data.
p_obs_names = [r'f_A', r'f_P']
p_obs = {}
for i, item in enumerate(p_obs_names):
tmp_data = pe.input.json.load_json("./data/" + item)
p_obs[item] = pe.Corr(tmp_data, padding=[1, 1])
p_obs[item].tag = item
We can now use the method Corr.show
to have a quick look at the data we just read in
p_obs['f_A'].show(comp=p_obs['f_P'], y_range=[-0.8, 8])
Constructing the PCAC mass¶
The PCAC mass is defined as \begin{align*} am(x_0)=\frac{a\tilde{\partial}_0 f_\mathrm{A}(x_0)+a^2c_\mathrm{A}\partial_0^{\ast}\partial_0^{}f_\mathrm{P}(x_0)}{2f_\mathrm{P}(x_0)}+\mathrm{O}(a^2)\,. \end{align*}
We now need to obtain the first derivative of f_A and the second derivative of f_P
first_deriv_fA = p_obs['f_A'].deriv()
first_deriv_fA.tag = r"First derivative of f_A"
second_deriv_fP = p_obs['f_P'].second_deriv()
second_deriv_fP.tag = r"Second derivative of f_P"
We can use these to obtain the unimproved PCAC mass:
am_pcac = first_deriv_fA / 2 / p_obs['f_P']
am_pcac.gamma_method()
am_pcac.tag = "Unimproved PCAC mass"
And with the inclusion of the improvement coefficient $c_\mathrm{A}$ also the $\mathrm{O}(a)$ improved PCAC mass:
cA = -0.03888694628624465
am_pcac_impr = (first_deriv_fA + cA * second_deriv_fP) / 2 / p_obs['f_P']
am_pcac_impr.gamma_method()
am_pcac_impr.tag = "Improved PCAC mass"
We can take a look at the time dependence of the PCAC mass with the method Corr.show
:
am_pcac_impr.show(comp=am_pcac)
Plateau values¶
We can now construct a plateau as a derived observable from the masses.
pcac_plateau = am_pcac_impr.plateau([7, 16]) # We manually specify the plateau range here
pcac_plateau.gamma_method()
pcac_plateau.details()
We can now plot the data with the two plateaus
am_pcac_impr.show(comp=am_pcac, plateau=pcac_plateau)
The Monte Carlo history of the observable can be accessed with plot_history
to identify possible outliers or have a look at the shape of the distribution
pcac_plateau.plot_history()
If everything is satisfactory we can save the Obs
in a file for future use. The Obs
pcac_plateau
conatains all relevant information for any follow up analyses.
pcac_plateau.tag = "O(a) improved PCAC mass extracted on the test ensemble"
pcac_plateau.dump("pcac_plateau_test_ensemble", datatype="json.gz")