# Task: design a 1x2 MMI splitter with EMode

This is the brief the agent was given, word for word. The agent used the
EMode MCP server (`emode-mcp`) and nothing else to simulate.

## Specification

Design a 1x2 multimode interference (MMI) power splitter for TE light at
1550 nm that meets all of these:

- Excess loss below 0.3 dB over the whole band from 1520 to 1580 nm (60 nm).
  The excess loss is -10 log10 of the power the input waveguide's fundamental
  TE mode delivers to the fundamental TE modes of the two output waveguides.
- Equal power in the two outputs, which the symmetry of the device gives.

## Platform

- Silicon core 220 nm thick in silica (SiO2) above and below, fully etched.
- Input and output access waveguides 500 nm wide.
- The two output waveguides may not come closer than 200 nm to each other
  anywhere (the smallest gap the process resolves).

## What you may change

The six optimization variables are the width and length of the MMI body, the
width and length of the input taper, and the width and length of the output
tapers (both output tapers the same). Each taper widens linearly from a
500 nm access waveguide to its width where it meets the MMI body.

## How to work

1. Read the `emode://skill` resource first.
2. Build the device from labeled cross-sections (`emode_profile`): the input
   waveguide, the input taper's wide end, the MMI body, the output tapers'
   wide ends and the output waveguides, with straight and taper sections
   between them. Center the device on x = 0 and use `boundary_condition`
   'TE', which folds the window about every mirror plane of the device. A
   1x2 MMI is symmetric left to right about x = 0, and the fold keeps the
   modes that are even about it, the only ones the centered input excites.
   The fold mirrors about the window's center lines in x and in y, so place
   the core at the vertical center of the window too, with silica above and
   below it. A core that sits on the window's floor is mirrored into a slab
   twice as thick.
   The output pair's lowest mode is then the even combination of the two
   arms' TE modes, and its power is the power in both arms.
3. Run `emode_converge` (with `apply` true) before trusting any number, and
   say which settings you chose and why. Give it `max_time` 300 and
   `max_memory` 8 (GB). The machine has 16 GB, and a step that would not fit
   is not started. Ask for the accuracy the specification needs, not more:
   the excess loss to about 0.05 dB.
4. Search the design space with `emode_optimize`. Choose the method, the
   bounds and the objective. A coarser grid for the search is fine if you
   check the result at the converged settings afterward.
5. For every `emode_eme`, `emode_evaluate` or `emode_sweep`, keep each
   cross-section under 100,000 cells (the window width divided by
   `x_resolution`, times the window height divided by `y_resolution`) and use
   at most 8 modes. `emode_eme` has no memory limit of its own, and an EME
   solves every taper slice, so a finer grid or more modes can run the
   machine out of memory. If the converged grid is finer than that, use the
   finest grid within it for the checks below and say so in the report.
6. At those settings, run `emode_eme` on the final design. Then run an
   `emode_sweep` of the key `wavelength` with result `S_matrix` and
   solve_type `EME`, from 1500 to 1600 nm, that covers 1520 to 1580 nm, on a
   grid about twice as coarse in each direction (a sweep holds every
   wavelength's modes at once). Check that its 1550 nm point agrees with the
   fine-grid `emode_eme`, and say how closely.
7. Write a short report: the design, the excess loss at 1550 nm and its
   largest value over the band, whether the specification is met, and what
   limits the design. Then call `emode_close`.

Keep the whole session to about 40 minutes of solver time, because it is
replayed for the published example.
