Skip to content

quarkquartet/LeWRON

Repository files navigation

LeWRON avatar

LeWRON

pronounced like LeBron

Learning ElectroWeak phase tRansitiON with agentic architecture

From the Lagrangian to gravitational waves, the GOAT runs the full court.

License Python 3.11+ v1.0 status


LeBron is famous for handling every role on the court. LeWRON does the same — from Lagrangian to gravitational waves, one agent handles it all.

LeWRON turns a BSM model description or a reproduction target into a structured run: symbolic setup, effective-potential artifacts, finite-temperature machinery, generated model code, a scientific report, and an interactive exploration session. It keeps both machine-readable artifacts and human-readable notes, so a run can be resumed, audited, revised, and shared.

Currently only electroweak phase transitions are supported. More BSM phase transitions — dark-sector PT, high-scale PT from GUT-like theories — are deferred to future work.

The physics method is fixed too: LeWRON builds the perturbative one-loop, daisy-resummed finite-temperature effective potential with the full thermal functions (Parwani, Arnold–Espinosa, Improved Parwani, Partial Dressing, or no resummation; on-shell counterterm or direct-solve renormalization). Methods outside this construction — the Hartree approximation and other self-consistent or mean-field resummations, two-loop or dimensional-reduction effective potentials, and high-temperature-expanded thermal potentials — are out of scope; bootstrap declines or narrows a request that needs them. See Concepts → Scope for the full statement.

LeWRON works in two modes:

  • Reproduction mode — start from a paper plus a target figure or table. LeWRON infers the paper's conventions up front, asks for approval, then follows them through the run.
  • Discovery mode — start from a new Lagrangian and analysis request. LeWRON pauses at the physics decision points so you can steer.

Workflow

LeWRON workflow architecture

The toolbox pipeline derives the model, then an interactive Explorer uses it to find the physics you asked for:

Stage Name Role
Bootstrap Setup Classify mode, infer build depth, initialize state.json
Symmetry analysis 1a Identify fields, charges, backgrounds, and VEV structure
Tree-level derivation 1b Derive the tree-level potential, masses, VEV conditions, parametrization
Renormalization 2a Derive counterterm conditions (when one-loop corrections are included)
Zero-temperature potential 2b Generate the CosmoTransitions-compatible (T=0) potential class
Finite-temperature potential 3 Derive thermal masses and generate the finite-T potential code

Build depth is inferred from the requested deliverable (tree, T0_loop, tree_thermal, or full); there is no build-mode flag. After a thermal build, LeWRON opens the Explorer — an interactive agentic session for screening points, running generated code, and producing the final report and deliverables. See the documentation for the full picture.

Installation

LeWRON is a pure-Python package (Python 3.11+); any environment manager works. With a virtualenv:

git clone https://github.com/quarkquartet/LeWRON
cd LeWRON
python -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate
pip install .

Prefer conda? conda create -n lewron python=3.11 && conda activate lewron, then pip install . (or conda env create -f environment.yml).

pip install . puts the lewron command in the active environment, so it works whenever that environment is activated (use pip install -e . for development). LeWRON's toolbox stages use the Anthropic API (export ANTHROPIC_API_KEY=..., or a gitignored .env); the Explorer uses your local claude CLI subscription. The CosmoTransitions backend is installed by the agent at runtime. Your first run drops an editable copy of the physics priors at an OS-native path, and lewron install-skill makes them available in plain Claude Code too. Full details: Installation.

Quickstart

# Discovery: hand it a model description.
lewron run --input examples/ALP.md --run-dir examples/alp

# Reproduction: point it at a paper and a target.
lewron run --input "Reproduce Table 1 of 2009.14295, neglecting the wall velocity."

# Resume a run (re-enters the Explorer if the toolbox is built).
lewron run --run-dir examples/alp

From Python:

from lewron import (
    run_pipeline, run_stage, revise_stage,
    reset_stage, reset_substep, regenerate_report, run_explorer,
)

run_pipeline("examples/Z2ssb.md", run_dir="examples/z2ssb")

Walkthrough: Quickstart.

Documentation

Full documentation lives in docs/:

Worked examples (inputs and their run folders) are under examples/.

Current Status

Implemented:

  • CLI commands for run, stage, revise, reset, and report, plus the Python API.
  • Bootstrap mode/build inference and resumable state.json.
  • Toolbox stages for symmetry analysis, tree-level derivation, renormalization, the zero-temperature potential, and the finite-temperature potential.
  • Auditor passes for the tree-level, renormalization, and thermal-mass steps.
  • Interactive checkpoint, revise, rescue, and escalation handling.
  • The Explorer: an interactive Claude Agent SDK session for numerical work.

Still evolving:

  • Public examples are being curated for release quality.
  • Broader coverage of BSM phase-transition models.

Repository Layout

The repository root holds the installable lewron/ package plus supporting directories (there is no nested lewron/lewron/):

lewron/                          # installable package (import as `lewron`)
├── api.py                       # public entry points: run_pipeline, run_stage, revise_stage, reset_stage, reset_substep, regenerate_report, run_explorer
├── cli.py                       # `lewron` console script
├── __main__.py                  # enables `python -m lewron`
├── orchestrator.py              # toolbox stage sequencing + checkpoint/escalation flow
├── bootstrap.py                 # stage 0 — mode + build-depth inference
├── state.py                     # run state (written to state.json)
├── note.py                      # LLM-driven run-report writer (notes/report.md)
├── llm.py                       # model roles + ModelConfig
├── io.py / io_utils.py          # checkpoint handlers; artifact read/write
├── prompt_input.py              # multi-line terminal input for interactive prompts
├── install.py                   # runtime backend (CosmoTransitions) install
├── exceptions.py                # PhysicsFailure, MechanicalRepairExhausted, AuditFailure
├── reset.py                     # reset a stage and its downstream outputs
├── dof_identify.py              # stage 1a — symmetry analysis
├── tree_level.py                # stage 1b — tree-level derivation (substep pipeline)
├── tree_level_canonicalize.py   #   ·· stage-1b sidecar canonicalization helpers
├── schema_repair.py             #   ·· shape-only repair of a stage-1b substep sidecar
├── renormalization.py           # stage 2a — counterterm derivation
├── potential_t0.py              # stage 2b — T=0 potential class code generation
├── potential_finiteT.py         # stage 3 — thermal masses + finite-T potential code
├── audit.py                     # auditor dispatcher + shared helpers
├── audit_stage1b.py / audit_stage2a.py / audit_stage3.py   # per-stage auditors
├── theory/                      # deterministic SymPy CAS helpers for generated stage-1b scripts
├── code_assets/                 # static runtime assets copied into a run's code/ (finite-T tables, basis translator)
├── explorer/                    # interactive Claude Agent SDK session + experience library
├── prompts/                     # stage system prompts
├── skills/                      # per-stage convention specs + CosmoTransitions failure catalog
└── types/                       # Pydantic artifact models (state, model_spec, thermal_masses, …)

# repo-root siblings of the package:
schemas/                         # JSON Schemas exported from lewron/types/
scripts/                         # maintenance scripts (export_schemas.py, …)
examples/                        # example inputs and their run folders
docs/                            # user documentation
tests/                           # pytest suite
pyproject.toml                   # packaging + `lewron` console-script entry point
environment.yml                  # conda environment

Citation

If you use LeWRON in research, please cite the companion paper, arXiv:2606.19425.

Contributing

LeWRON is an early public release, and contributions are welcome. The directions we most hope to integrate in the future:

  1. The Explorer module. Contributions to the interactive exploration layer — new physics priors, search strategies, and deliverable types — are especially welcome.
  2. A Mathematica symbolic backend. The toolbox derivations currently run on SymPy; a Mathematica backend validated against the same stages would broaden and cross-check the symbolic engine.
  3. Broader model coverage. Generalizing the pipeline to more BSM models — most demanding for the tree-level derivation (stage 1b).
  4. Other LLM providers. Testing the API-key path and the Explorer with models from other vendors (e.g. OpenAI / Codex), not only Claude.
  5. Integration with agentic coding environments. Wiring the first half of the pipeline — the audited symbolic toolbox — into Claude Code or Codex alongside the current framework.

LeWRON takes the W: for Weak scale, and for Win.

About

An agent to analyze electroweak phase transition

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages