Skip to content

Lattice Surgery Mode & Frames

Entwine can generate a lattice-surgery operation schedule directly from your interactive edits.

  • Press s to enter Lattice Surgery mode (operation recording).

You will see the right panel change into Loom code.

Growing a rotated surface code patch

  • Operations are recorded in frames; each tuple of actions is one frame in the generated schedule.
  • Navigate frames while recording with:
    • Previous frame: q
    • Next frame: e

Rule of thumb: Use a new frame for each lattice surgery step.
Example: If you perform a Merge on frame n, press e to move to frame n+1 before performing the next operation.


An example

Playing with frames

Why frames matter

Frames give you temporal structure—what happens first, second, third, etc. Entwine’s generator emits a sequence of frames that mirrors your edits, so downstream simulators/executors can replay the surgery accurately.

  • Make sure to keep one lattice surgery operation per frame.

Overwriting behavior (important!)

If you perform a new lattice-surgery edit on an earlier frame, all following frames are regenerated from that point onward. This ensures the final schedule remains causally consistent with your edits.

Warning

Editing frame k will override frames k+1, k+2, …
If you only wanted to add a new step at the end, move to the last frame with e first.


Keyboard shortcuts

Action Key(s)
Enter/Exit Lattice Surgery Mode s
Previous frame q
Next frame e

Best practices

  • Advance a frame (e) after every Merge, Split, Grow, Shrink, or Measure step.
  • Syndrome measurement frames are automatiacally insrted between structural edits.