Skip to content

ice91/palatini-pt-spurion

Repository files navigation

palatini-pt-spurion

Reproducible codebase for Palatini × PT-even + spurion.
This repo accompanies the manuscript and reproduces all C1/C2/C3 results and figures end-to-end.

Highlights

  • Analytic claims (C1/C2/C3) organized as paper-checkable identities
  • One-command figure regeneration (make paper)
  • Full test suite (44 passed) and CI-ready
  • Notebooks for demonstrations + Colab viewing
  • Snakemake DAG of the figure pipeline (tex/snakemake_dag.pdf)
  • App. D: 2×2 mixing matrix artifact + locking checkmake mixing

TL;DR — One command

# Option A: conda (recommended)
conda env create -f environment.yml
conda activate palpt

# Option B: venv/pip
python -m venv .venv && source .venv/bin/activate
pip install -U pip
pip install -e .[dev]

# Reproduce all paper figures & data
make paper

# Run tests exactly as used for the paper
make paper-test

Expected output (abridged):

Generated:
  [pdfs] figs/pdf/fig1_c1_pure_trace.pdf
  ...
  [pdfs] figs/pdf/fig9_flux_ratio.pdf
  [data] figs/data/*.csv, *.npz
44 passed in ~5–6s

Installation

# conda
conda env create -f environment.yml
conda activate palpt

# or pip/venv
python -m venv .venv && source .venv/bin/activate
pip install -U pip
pip install -e .[dev]

Check tooling:

pre-commit install && pre-commit run -a
pytest -q
palpt --help

Reproducing the paper artifacts

Task Command Output
Generate all figures & data (paper grids) make paper figs/pdf/fig*.pdf, figs/data/*
Run the exact paper test suite make paper-test 44 passed
App. D mixing matrix + locking check make mixing figs/data/mixing_matrix.csvfigs/data/mixing_matrix_meta.json(含 .md5),並打印鎖定比 w*_ROD:w*_CM
Sync notebooks (Jupytext) make nb notebooks/*.py updated
Execute notebooks headless make nb-test notebooks executed in-place
Build the pipeline DAG make dag tex/snakemake_dag.pdf

Note (DAG dependencies). make dag 需要:

  • Python 套件:snakemake, graphviz(py binding 已在 .[dev]);

  • 系統層的 dot 可執行檔:如 sudo apt-get install graphvizbrew install graphviz


Google Colab (view/run the notebooks)

  • 00 — sanity checks
    Open In Colab

  • 10 — C2 symbolic demo (three-chain equivalence at quadratic order)
    Open In Colab

  • 20 — Flux-ratio visualization (finite domain)
    Open In Colab

  • 30 — NLO offsets and δcT2(k)\delta c_T^2(k) toy forecast
    Open In Colab

Colab 安裝小抄(每本筆記首格可用)

# Option 1: 安裝已公開的 GitHub 套件(最簡)
!pip -q install "git+https://github.com/ice91/palatini-pt-spurion.git"

# Option 2: clone + 本地 editable 安裝(便於開發)
!git clone https://github.com/ice91/palatini-pt-spurion.git
%cd palatini-pt-spurion
!pip -q install -e .

筆記僅依賴 numpy/sympy/matplotlib 等常見庫,Colab 原生可用;不需要 graphviz/snakemake
在 matplotlib 標題/標籤含 LaTeX 字串時請使用 raw string,例如:r"$\\mathcal R_{X/Y}$"


Command-line interface

palpt --help
palpt figs --which all --config configs/paper_grids.yaml   # 生成論文圖
palpt figs --which smoke                                    # 快速 smoke

Project layout

palatini-pt-spurion/
├─ palatini_pt/           # 核心邏輯(algebra / palatini / equivalence / gw / spurion / io)
├─ scripts/               # 產圖腳本(fig1–fig9 + make_all_figs + mixing_matrix_extract.py)
├─ configs/               # 掃描與係數設定(含 paper_grids.yaml,coeffs/*)
├─ figs/                  # 產出 PDF/PNG 與中間數據(含 .md5;含 mixing_matrix.csv)
├─ notebooks/             # Colab 友善展示 notebook
├─ tests/                 # 單元與整合測試(**44 tests**,含 test_mixing_matrix_extract.py)
├─ tex/                   # Snakemake DAG、TikZ 原檔
├─ Snakefile              # 圖片產製規則
├─ Makefile               # 一鍵:paper / tests / nb / dag / mixing
├─ environment.yml, pyproject.toml, CITATION.cff, LICENSE

Snakemake DAG

產製流程圖(需 snakemake 與系統 dot):

make dag
# 輸出:tex/snakemake_dag.pdf

Reproducibility checklist (for reviewers)

  • Figures regenerate with make paper under the pinned environment.

  • Tests pass with make paper-test (44 tests).

  • App. D: make mixing 生成 mixing_matrix.csv 與 meta,並檢查兩條混合條件的比例一致(C3 鎖定)。

  • Static artifacts provided in figs/ with .md5 sidecars.

  • No shell-escape required in LaTeX; figures are external PDFs.

  • DAG of the pipeline: tex/snakemake_dag.pdf.


How to cite

See CITATION.cff. If you use this repository, please cite both the companion paper and this software snapshot.


License

MIT (see LICENSE).


Acknowledgments

This repository separates paper-checkable identities (C1/C2/C3) from computational artifacts. We thank the community for reproducibility best practices that inspired this layout.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors