一键导入
theory-data-comparison
Compare theoretical predictions to experimental data — uncertainty bands, pull distributions, chi-squared goodness of fit
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Compare theoretical predictions to experimental data — uncertainty bands, pull distributions, chi-squared goodness of fit
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Numerically evaluate a FormCalc-reduced one-loop amplitude with LoopTools 2.16 (Passarino-Veltman integrals via the Wolfram/LoopTools MathLink) and emit a scattering/v1 JSON (σ_SI, σ_SD) for direct detection. Unblocks the 2HDM+a loop-only DD path. Self-heals via _shared/installs/looptools preflight.
Reduce a FeynArts amplitude list with FormCalc 9.10. Produces amp_reduced.m and amp_reduced.meta.json sidecar conforming to amp_reduced.meta/v1. Self-heals via _shared/installs/formcalc preflight.
Generate Feynman diagrams and amplitudes using FeynArts 3.11. Supports built-in models (SM, SMQCD, THDM, MSSM) and SARAH-generated models. Outputs FeynAmpList.m, diagrams.pdf, topologies.json, and metadata sidecar.
Compute direct-detection likelihoods and 90%-CL exclusion verdicts using DDCalc 2.2.0. Leaf consumer of scattering/v1 JSON from /micromegas or /formcalc.
MadDM — dark matter relic density, direct detection cross-sections, indirect detection rates, parameter scans with experimental limit comparison
Run HiggsBounds-5 + HiggsSignals-2 constraint checks on a model SLHA file. Computes hb_allowed (per-channel AND), hs_consistent (Δχ² < 6.18), p-values, and per-channel CSV. Supports single-point and scan-directory modes.
| name | theory-data-comparison |
| description | Compare theoretical predictions to experimental data — uncertainty bands, pull distributions, chi-squared goodness of fit |
Compare theoretical predictions to published experimental measurements with rigorous uncertainty treatment. Produces overlay plots with uncertainty bands, pull distributions, and goodness-of-fit metrics.
Gather the data:
Experimental data: Central values, statistical errors, systematic errors (correlated and uncorrelated).
Theory predictions: Central values with uncertainty breakdown.
Build the comparison plot:
Main panel:
ax.errorbar(x_data, y_data, yerr=[err_down, err_up], fmt="ko", label="Data")
ax.fill_between(x_th, y_th - unc_down, y_th + unc_up, alpha=0.3, label="NLO scale unc.")
Ratio panel: Theory/Data or Data/Theory
Pull panel (optional, below ratio):
Goodness of fit:
# Chi-squared (uncorrelated errors)
chi2 = np.sum(((data - theory) / total_error)**2)
ndof = len(data) - n_params
p_value = 1 - scipy.stats.chi2.cdf(chi2, ndof)
chi2 = (data - theory).T @ np.linalg.inv(cov) @ (data - theory)Multiple theory comparisons: Overlay several predictions to highlight differences:
Output:
| Uncertainty type | Visual encoding |
|---|---|
| Stat. error (data) | Error bars (thin lines with caps) |
| Total error (data) | Error bars (thicker or outer caps) |
| Scale uncertainty (theory) | Hatched or solid semi-transparent band |
| PDF uncertainty (theory) | Cross-hatched or different-color band |
| Combined theory | Outer envelope band |
| Stat. + syst. (data) | Inner/outer error bar convention |
Input: "Compare NNLO QCD predictions for the top quark pair production differential cross section (d sigma / d p_T^t) to CMS measurements at 13 TeV. Show scale and PDF uncertainties separately. Include a ratio panel and report chi^2/ndof."
Output: Three-panel figure (distribution + ratio + pull), with data points, NNLO scale band, PDF band, ratio to data, pull distribution, and chi^2/ndof = X.XX (p = 0.XX) annotation.
Reference:
docs/design-system.md— the canonical source of truth for all visual rules.
Palette: Cool Analytic (styles/hephaestus-analytic.mplstyle). Load with:
from styles.hep_ph_style import set_hep_context, make_ratio_panel, apply_direct_labels, add_uncertainty_band
palette = set_hep_context("analytic")
fig, (ax_main, ax_ratio) = make_ratio_panel()
Key rules:
#0284c7 (blue), 1.0pt solid curve. Data: #1a1a1a (black), points with 0.7pt error bars. Black data points have maximum contrast against any background.add_uncertainty_band(). Scale uncertainty and PDF uncertainty get distinct colors from the escalation ladder. 1-sigma at alpha 0.12-0.15, 2-sigma at alpha 0.06-0.08. Boundary lines 0.5pt dashed.apply_direct_labels() with collision avoidance.Mandatory overlap check — do not skip this step:
from styles.hep_ph_style import check_overlaps
issues = check_overlaps(fig)
if issues:
print(f"WARNING: {len(issues)} text overlaps detected:")
for iss in issues:
print(f" '{iss['text_a']}' vs '{iss['text_b']}' — {iss['overlap_pt']}pt")
If check_overlaps returns any issues, you must fix them before saving. Common fixes: reposition labels, reduce font size, abbreviate text, or increase figure size. Re-run the check after fixing until it returns an empty list.