# Reproducing "Can soot alone make dilute sumi ink bluish?"

Repository: https://github.com/tomo3141592653/self-driving-ai-prototype , folder `ayumu-lab/research/sumi-color/`.
Commit fa7119b39980aa3e855681b8275371dd4cf1d6ed holds the scripts and outputs used for this version. Package versions are in `paper/environment.txt` (Python 3.13.5, miepython 2.5.5, colour-science 0.4.6, NumPy 2.2.6, SciPy 1.17.0, Matplotlib 3.11.2, SMUTHI 2.2.4). Python 3.13 with `uv`. Each script prints a plain-text table; the outputs used in the paper are committed in `outputs/`.

## Sections 3.1–3.3 (spheres, RDG aggregates, packing, distributions, medium, paper, additives, Monte Carlo)

```bash
cd ayumu-lab/research/sumi-color
bash run_all.sh          # about one minute; writes outputs/*.log and outputs/RUN_INFO.txt
```

`run_all.sh` runs each script as
`uv run --with miepython==2.5.5 --with colour-science==0.4.6 python <script>.py`.

| Result | Script | Output |
|---|---|---|
| Compact spheres, b* vs diameter | `sumi_km.py`, `sumi_km_m.py <m>` | `sumi_km.log`, `sumi_km_m_*.log` |
| RDG-FA loose aggregates | `sumi_rdg.py` | `sumi_rdg.log` |
| Maxwell–Garnett packing | `sumi_mg.py` | `sumi_mg.log` |
| Size distributions | `sumi_dist.py` | `sumi_dist.log` |
| Medium and dispersion | `sumi_check.py`, `sumi_chang_table.py` | `sumi_check.log`, `sumi_chang_table.log` |
| Yellowish paper, CAT02 | `sumi_paper.py` | `sumi_paper.log` |
| Non-absorbing scatterers | `sumi_white.py` | `sumi_white.log` |
| Ink amount and paper tint | `sumi_sweep.py` | `sumi_sweep.log` |
| Photon Monte Carlo check | `sumi_mc.py` | `sumi_mc.log` |
| 380–780 nm range check | `sumi_range.py` (run separately) | `sumi_range.log` |

## Section 3.4 (T-matrix aggregates)

Needs SMUTHI 2.2.4 and several hours. `aggregate.py` builds the aggregates (tunable particle–cluster, k_f = 1.3, seed 1); `tm_run.py` solves them (orientation seed 2) into `tm_results.jsonl`; `tm_extra.py` adds orientations (seeds 3, 4) and the multipole-order split into `tm_extra.jsonl`; `tm_color.py`, `tm_extra_color.py` and `tm_mgcompare.py` turn the cross-sections into colours and the Maxwell–Garnett comparison. `tm_test.py` checks a single sphere against Mie (five digits).

## Section 3.6 (dilute to opaque)

```bash
uv run --no-project --with miepython==2.5.5 --with colour-science==0.4.6 --with numpy python sumi_crossover.py
```

Output: `outputs/sumi_crossover.log` (three cases: air; medium 1.5; medium 1.5 with Saunderson correction).

## Figures

```bash
uv run --no-project --with miepython==2.5.5 --with colour-science==0.4.6 --with numpy --with matplotlib python paper/fig_bstar.py
uv run --no-project --with miepython==2.5.5 --with colour-science==0.4.6 --with numpy --with matplotlib python paper/fig_crossover.py
```

`fig_crossover.py` also prints the estimate X_c = ln(2K R_g/S)/(2K) at 550 nm for each diameter.

## Lightness matched by Y, and the Monte Carlo from dilute to opaque

```bash
uv run --no-project --with miepython==2.5.5 --with colour-science==0.4.6 --with numpy python sumi_Ymatch.py
uv run --no-project --with miepython==2.5.5 --with colour-science==0.4.6 --with numpy python sumi_mc_crossover.py   # about 10 minutes
```

`sumi_mc_crossover.py`: calibration seed 10, seeds 1–3 for each amount, 60 000 photons per wavelength below X/X_0 = 8 and 200 000 above, Russian roulette below weight 10⁻³.
