# Recomputing the spin–lattice lifetimes (T1) — code and inputs

Everything needed to recompute the room-temperature Γ_II spin–lattice T1 of every salt in the paper, without the
El Agente framework: the versioned spin-relaxation code, and for each crystal model its DFT phonon force constants,
the ORCA (CASSCF/NEVPT2 + SOC) vibronic couplings, the displacement manifest, and the embedding point charges.
A tested parent–iodine example reproduces the reported numbers.

## Quick start
```bash
pip install numpy phonopy          # tested: python 3.12, numpy 2.4.6, phonopy 4.4.0 (ENVIRONMENT.txt)
python tests/test_parent_iodine.py  # seed + para-I: Gamma (seconds) and dense (~2 min) checks
python tests/check_all_gamma.py     # all 15 validated salts vs the validator's signed values (~1 min)
python code/t1_recompute.py gamma inputs/R5_pI/couplings_judged.json --sigmas 5 10 20
python code/t1_recompute.py dense inputs/R5_pI/couplings_judged.json inputs/R5_pI/displacement_manifest_judged.json \
       inputs/R5_pI/phonopy_params.yaml --sigmas 3 5 7
```
Expected output of the test (abridged):
```
gamma  R5_pI  sigma  5: 2.930809 us  (validator 2.930809)  rel diff 0.0e+00
dense  SEED   sigma 3: 2.4323 us  (paper 2.4323)  grid [2, 2, 2], 1552 modes
dense  R5_pI  sigma 3: 3.7218 us  (paper 3.7218)  grid [3, 2, 2], 1237 modes
dense  ratio para-I / seed: {'3': 1.53, '5': 1.443, '7': 1.219}
ALL CHECKS PASSED
```

## Layout
| Path | Content |
|---|---|
| `code/t1_gamma2_core.py` | The Γ_II rate code, extracted verbatim from El Agente commit `91594fcc44c90d2cde013c743d8a60d7794e4f45` (functions `ion_hamiltonian`, `coupling_operators`, `spin_flip_rates`, `gamma2_direction`, `gamma2_powder`, `lebedev14`, `bose`, `zero_point_q2`, `mode_mean_square_q`, `translations` and their constants). The header lists the sha256 of each source file; the only edit is dropping module prefixes. Needs numpy only. |
| `code/t1_recompute.py` | Driver: `gamma` mode (T1 from the stored Γ-mode couplings, as the campaign's T1 tool and validator) and `dense` mode (each salt's force constants on a q-grid of equivalent-supercell widths ≥ 21 Å, the paper's dense sampling; needs phonopy). |
| `code/source_at_commit_91594fcc/` | Unmodified source files the core was extracted from (`excited_state_raman.py`, `spin_relaxation.py`, `crystal_phonons.py`, `low_mode_hessian.py`, the validator `t1_loop.py`) and the campaign's dense-sampling analysis script. For reference; they import the full framework and do not run standalone. |
| `inputs/<salt>/` | One folder per crystal model (17), see below. |
| `expected/t1_vs_sigma_paper.csv` | The paper's T1 values for every salt, σ and sampling (Γ and dense). |
| `tests/` | `test_parent_iodine.py` (tested example), `check_all_gamma.py` (all validated salts). |
| `MANIFEST.csv` | sha256 of every file. |

## What is in `inputs/<salt>/`
`inputs.json` lists every file with its role, original path in the campaign folder and sha256.

| File | Role |
|---|---|
| `phonopy_params.yaml` | DFT (CP2K PBE-D3) phonon force constants of the relaxed crystal, phonopy format (one-sided 0.01 Å finite displacements; 1×1×1 cell unless the file says otherwise) |
| `couplings_judged.json` | Vibronic couplings used by the validator: reference NEVPT2 ligand-field matrix and SOC (`reference`), derivatives along each displacement direction (`direction_couplings`), the same projected on the Γ modes (`mode_couplings`, with `modes.frequencies_cm1`) |
| `couplings_judged_step2.json`, `couplings_judged_replicate1.json` | Validator checks: ±2Q step-test set; independent start-orbital replicate (seed) |
| `displacement_manifest_judged.json` | The anion cluster (positions in the metal frame, masses, mapping to the phonon cell), the mass-weighted displacement directions and step sizes |
| `couplings_dense.json`, `displacement_manifest_dense.json` | Only where the paper's dense analysis used a different coupling set (see below); otherwise the dense analysis used the judged files |
| `orca/embedding.pc` | Ewald-fitted point charges embedding the anion (formal charges, 10 Å explicit / 22 Å fit sphere) |
| `orca/start_orbitals.inp`, `orca/reference.inp`, `orca/sweep_template.inp` | ORCA inputs: start orbitals, SA-CASSCF(1,5)/SC-NEVPT2 + SOC reference, and the template every displaced member used |
| `reported/` | The campaign's T1 tool output and the validator's signed receipt for this salt |

Salts: `SEED` ((PPh₄)₂[VO(dmit)₂]); `R1_DMID_m1/m2`, `R1_C3S5_m1/m2`, `R1_C5H6S4` (ligand edits; m1/m2 = ordered
models, the validator judged m1 for DMID and C3S5); `HOST_MOO` (V diluted in the MoO host); `R2_NEt4`, `R2_AsPh4`;
`R3_F`, `R3_CN`, `R4_mF`, `R4_pCl`, `R4_pBr`, `R5_pI`, `R6_mBr`, `R6_4CCH` (cation substituents).

## Conventions
- T1 at 300 K and 0.345 T. Powder average: the rate is averaged over the 14-point Lebedev grid of field orientations
  (6 points weight 1/15, 8 points weight 3/40) and T1 = 1 / averaged rate (not the average of per-orientation T1).
- σ (cm⁻¹) is the standard deviation of the Gaussian applied to each phonon pair's energy mismatch.
- Modes up to 500 cm⁻¹ are used in `dense` mode; `gamma` mode uses the modes stored in the couplings file.

## Two coupling sets for five salts
For R3_CN, R4_pBr, R4_pCl and R6_mBr, the validator used couplings extended to modes up to 800 cm⁻¹
(`couplings_judged.json`), while the paper's dense σ-resolved analysis used the main set (`couplings_dense.json`).
Their Γ T1 differ by 0.23–0.45 %. For R6_4CCH both use the extended set; its Γ values differ from the validator's by
0.17 % because `dense` mode keeps modes ≤ 500 cm⁻¹. These differences change no ratio or conclusion in the paper.
