Expand description
KSG unweighted square lattice gadgets for resolving crossings.
This module contains all gadget implementations for the King’s SubGraph (KSG) unweighted mapping: KsgCross, KsgTurn, KsgWTurn, KsgBranch, KsgBranchFix, KsgTCon, KsgTrivialTurn, KsgEndTurn, KsgBranchFixB, KsgDanglingLeg, and their rotated/reflected variants.
Structs§
- KsgBranch
- Branch gadget for T-junctions.
- KsgBranch
Fix - Branch fix gadget for simplifying branches.
- KsgBranch
FixB - Alternate branch fix gadget.
- KsgCross
- Crossing gadget for resolving two crossing copy-lines.
- KsgDangling
Leg - Dangling leg simplifier pattern.
- KsgEnd
Turn - End turn gadget for line terminations.
- KsgReflected
Gadget - A reflected version of a gadget.
- KsgRotated
Gadget - A rotated version of a gadget.
- KsgTCon
- T-connection gadget.
- KsgTape
Entry - A tape entry recording a gadget application.
- KsgTrivial
Turn - Trivial turn gadget for simple diagonal turns.
- KsgTurn
- Turn gadget for 90-degree turns in copy-lines.
- KsgW
Turn - W-shaped turn gadget.
Enums§
- KsgPattern
- Enum wrapping all KSG square lattice patterns for dynamic dispatch during unapply.
- Mirror
- Mirror axis for reflection.
Traits§
- KsgPattern
Boxed - Trait for boxed pattern operations.
Functions§
- apply_
crossing_ gadgets - Apply all crossing gadgets to the grid. Follows Julia’s algorithm: iterate over all (i,j) pairs and try all patterns. Note: Unlike the previous version, we don’t skip based on crossat position because different (i,j) pairs with the same crossat can match different patterns at different positions (since each pattern has a different cross_location).
- apply_
simplifier_ gadgets - Apply simplifier gadgets (KsgDanglingLeg variants).
nrepeatspecifies the number of simplification passes. - apply_
weighted_ crossing_ gadgets - Apply crossing gadgets with proper weights for weighted mode. Uses apply_weighted_gadget which respects mapped_weights() for each gadget.
- apply_
weighted_ gadget - Apply a weighted gadget pattern at position (i, j) with proper weights. Uses mapped_graph locations and mapped_weights for each node.
- apply_
weighted_ simplifier_ gadgets - Apply weighted simplifier gadgets (KsgDanglingLeg variants with weight checking). For weighted mode, KsgDanglingLeg requires the center node to have weight 1. Julia’s WeightedGadget{DanglingLeg}: source_centers = [(2,2)] means node at (2,2) has weight 1.
- crossing_
ruleset_ indices - The default crossing ruleset for KSG square lattice.
- map_
config_ back_ pattern - Map configuration back through a single gadget.
- tape_
entry_ mis_ overhead - Calculate MIS overhead for a tape entry.
Type Aliases§
- Source
Graph - Type alias for source graph representation: (locations, pin_edges, source_pins).