# Spin-Wave Phase Shifter Controlled by a Domain Wall Racetrack: simulation inputs and figure notebooks (version 2)

This dataset holds the MuMax3/amumax input scripts, the processed results and the Jupyter notebooks that make every figure of the paper *Spin-Wave Phase Shifter Controlled by a Domain Wall Racetrack* and of its Supplementary Material.

The system is a 50 nm thick YIG film with a 50 nm wide, 20 nm thick Permalloy (Py) racetrack 5 nm above it. Two notches pin two domain walls (DWs). The stray field of the DWs changes the internal field in the YIG under the racetrack and shifts the phase of Damon–Eshbach spin waves (SWs) that pass below it.

## Layout

One archive per figure, for example `fig_S4_S5.zip`. Each archive unpacks to a folder of the same name, which contains everything needed to make that figure: notebooks, processed data (`.npz`), inset pictures, the `.mx3` input scripts of the simulations it uses, and the final figure (`.pdf`, `.png`).

| Figure | Archive | Notebooks | Output |
| --- | --- | --- | --- |
| Fig. 1 | `fig_1.zip` | none (Blender + GIMP) | `figure_1.png` |
| Fig. 2 | `fig_2.zip` | `fig_2.ipynb` | `fig2.pdf` |
| Fig. 3 | `fig_3.zip` | `fig_3.ipynb` | `mag_field.pdf` |
| Fig. 4 | `fig_4.zip` | `calc_fig_4_phase_amplitude.ipynb`, `fig_4.ipynb` | `phase.pdf` |
| Fig. 5 | `fig_5.zip` | `calc_fig_5_phase_amplitude.ipynb`, `fig_5.ipynb` | `freq_depends_long.pdf` |
| Fig. 6 | `fig_6.zip` | `calc_fig_6_phase_amplitude.ipynb`, `fig_6.ipynb` | `phase_diffraction_grating.pdf` |
| Fig. S1 | `fig_S1.zip` | `fig_S1.ipynb` | `ABC.pdf` |
| Fig. S2 | `fig_S2.zip` | `fig_S2.ipynb` | `current_drive_010.pdf`, `current_drive_101.pdf` |
| Fig. S3 | `fig_S3.zip` | `calc_fig_S3_phase_amplitude.ipynb`, `fig_S3.ipynb` | `phase_lim.pdf` |
| Figs. S4, S5 | `fig_S4_S5.zip` | `calc_fig_S4_S5_phase_amplitude.ipynb`, `fig_S4_S5.ipynb` | `phase_length_freq.pdf`, `phase_length_beff.pdf` |
| Fig. S6 | `fig_S6.zip` | `fig_S6.ipynb` | `isofreq_4GHz.pdf` |

Each folder has a short `README.md` with the details.

## Workflow

1. **Inputs.** Every simulation folder (for example `freq_dependence_50nm/010/`) contains one `.mx3` script per run (`<f>GHz.mx3`) and the `gen.ipynb` notebook that wrote them. `gen.ipynb` takes the SW wavelength of the antenna for each frequency from the Kalinikos–Slavin dispersion relation.
2. **Simulations.** Run each `.mx3` file with [amumax](https://github.com/MathieuMoalic/amumax) (GPU with CUDA). The output `<f>GHz.zarr` is written next to the script. Each output is 7–15 GB, so the outputs are not part of this dataset.
3. **Phase shift and transmitted intensity.** A `calc_*_phase_amplitude.ipynb` notebook reads the `.zarr` outputs and writes the `.npz` file of its figure. These `.npz` files are included.
4. **Figures.** A `fig_*.ipynb` notebook makes the figure. Line plots read the `.npz` files. Maps and field profiles read the `.zarr` outputs directly; the header cell of each notebook lists which.

Run the notebooks from their own folder. They use paths relative to it.

## Phase shift and transmitted intensity

Both quantities follow Suppl. Sec. II. The same functions are used in every notebook, character for character:

- `download_data` and `load_data_for_frequencies` read m(t) − m₀ averaged over the thickness.
- `phase_at_f0` and `compute_phase_means` give Δφ. It is the mean over x of the unwrapped phase difference at the drive frequency, taken along one line of cells. Positive Δφ means that the SW leads the reference.
- `calc_intensity_ratio` gives the intensity ratio. It is the ratio of the summed |δm|² over all three components, all snapshots and all cells of the window; the figures show 10 log₁₀ of it in dB.

Values that differ between figures are arguments at the call site.

| Geometry | Δφ line | x-window | Reference |
| --- | --- | --- | --- |
| Channel (Figs. 4, 5, S3–S5) | y = 0.5 µm (cell 100) | 2.5–5.5 µm | `000` of the same width; bare YIG (`nort`) in Fig. S3 |
| Single aperture (Fig. 6) | y = 1.5 µm (cell 300) | 2.35–3.50 µm | `000` |
| Width sweep (Fig. 2c) | cell row y = 0 | 7.5–11.0 µm | bare YIG (`2.8Ghz/par/0nm`) |

Coordinates are those of MuMax3. The racetrack lies along MuMax3 *y*, which is the *z* axis of the paper.

## Naming

- `000`, `111`: uniform racetrack, magnetization parallel (`0`) or antiparallel (`1`) to the YIG.
- `010`, `101`: two DWs, central domain antiparallel (`010`) or parallel (`101`) to the YIG. `100`, `001`, `011`, `110`: one DW. `01`, `10`: one DW centred on the aperture (Fig. S6).
- `nort`: bare YIG, no racetrack.
- `_l<l>nm`: DW separation *l*. The runs without this suffix have *l* = 320 nm.
- `freq_dependence_<w>nm`: racetrack width *w* in the channel geometry. `freq_dependence_50nm_lim`: finite Py stripe (`0` = −0−, `1` = −1−). `freq_dependence_50nm_d`: single-aperture geometry.
- `2.8Ghz/par`, `2.8Ghz/apar`: uniformly magnetized Py stripe of width `<w>nm`, parallel or antiparallel to the YIG (Fig. 2c). `disp/v3_15mT`: dispersion runs (Fig. 2a, b).

## Notes on the input scripts

- Each `.mx3` file is the script that produced the run. Some original files had been overwritten or deleted after their runs; these were recovered from the amumax log of the run, which records every executed command. Recovered files start with a comment that says so.
- The `000` runs of `freq_dependence_30nm` started from `m = (1, 0, 0)` in the racetrack; `gen.ipynb` writes `(0, -1, 0)`. Both relax to the same uniform `000` state.
- The script of `freq_dependence_50nm_d/101/4.0GHz` was lost. `4.0GHz.mx3` is `3.9GHz.mx3` with the frequency and the antenna wavelength of all other 4.0 GHz runs (232 nm); its header says so.
- In `fig_S4_S5_phase_amplitude.npz`, the intensity ratio of `101`, *l* = 360 nm, at 3.5 GHz is not finite: one cell of that run holds |m − m₀| ≈ 10³². Fig. S4(b) leaves this point out.

## Requirements

- amumax (MuMax3 fork) and a CUDA GPU, to run the `.mx3` scripts.
- Python 3.10 with numpy 1.26, scipy 1.15, matplotlib 3.10, dask 2026.1, zarr 2.18, [pyzfn](https://github.com/MathieuMoalic/pyzfn) 0.1.10, cmocean 4.0 and tqdm 4.67. The figures use Arial; without it, matplotlib uses its default font.
- Blender and GIMP for Fig. 1 only.


## Citation

If you use this dataset, please cite the associated paper.
