92 KiB
import numpy as np
import matplotlib.pyplot as plt
import pyerrors as pe
plt.style.use('./base_style.mplstyle')
plt.rc('text', usetex=True)
Primary observables¶
We can load data from preprocessed files which contains lists of pyerror
Obs
and convert them to Corr
objects. We use the parameters padding_front
and padding_back
to keep track of the fixed boundary conditions at both temporal ends of the lattice.
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_front=1, padding_back=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¶
For the PCAC mass 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.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.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.T
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.
pe.input.json.dump_to_json(pcac_plateau, "pcac_plateau_test_ensemble")