PathLengthMatching

class photonforge.PathLengthMatching(nets=(), *, target=None, offsets=None, objective='length', index=None, frequency=None, tolerance=None, bends='free', min_gap=None, strict=False)

Path-length matching specification for one group of nets.

Nets in a group are matched to each other (or to explicit targets) by inserting displacement-neutral meanders in the routes. Groups are independent: each carries its own objective, targets, and contracts.

Parameters:
  • nets (Sequence[int]) – Net indices in this group. An empty sequence matches every net.

  • target (float | Sequence[float] | None) – None matches every net to the longest in the group. A single value is an absolute target shared by the group. A sequence sets one target per net (delay ladders, specified ΔL).

  • offsets (Sequence[float] | None) – Upstream length credit per net. Matching equalizes offset + routed length; with an absolute target, each route ends at target - offset.

  • objective (Literal["length", "phase", "group_delay"]) – Quantity to equalize: "length" (geometric), "phase" (∫n_eff·ds), or "group_delay" (∫n_g·ds, pulse arrival).

  • index (Interpolator | None) – Modal index over curvature, and over width and propagation angle where the geometry and the media call for it. One of index or frequency is required by the optical objectives: n_eff values for "phase", n_group values for "group_delay".

  • frequency (float | None) – Frequency at which to mode-solve the index for the routes’ own cross-section when index is not given.

  • tolerance (float | None) – Matching tolerance in μm of (effective) length. Defaults to 1e-3 for "length", 5e-3 for "phase", and 1e-2 for "group_delay", because the layout grid quantizes achievable optical length.

  • bends (Literal["free", "equal_added", "equal"]) – Constraint on the groups bends. "free" lets them differ; "equal_added" gives every net the same number of added bends, for process-corner tracking; "equal" leaves every net with the same bend counts, for a broadband match with equal bend loss.

  • min_gap (float | None) – Minimal edge-to-edge spacing between group members.

  • strict (bool) – Raise instead of reporting a refusal. Geometry is left untouched by a refusal either way.

Example

>>> m = pf.PathLengthMatching([0, 1, 2], bends="equal", min_gap=10)

Methods

copy()

Create a copy of this specification.

Attributes

bends

Bend contract: 'free', 'equal_added', or 'equal'.

frequency

Frequency at which to solve the index, when none is given.

index

Modal index for the optical objectives.

min_gap

Edge-to-edge spacing floor between group members, in μm.

nets

Net indices in the group; empty means every net.

objective

Quantity equalized: 'length', 'phase', or 'group_delay'.

offsets

Upstream length credit per net.

properties

Object properties.

strict

Raise instead of reporting a refusal.

target

Group target; None matches the longest net.

tolerance

Matching tolerance in μm; reports the objective default when unset.

bends

Bend contract: ‘free’, ‘equal_added’, or ‘equal’.

Type:

str

copy()

Create a copy of this specification.

Returns:

New copy.

Return type:

PathLengthMatching

frequency

Frequency at which to solve the index, when none is given.

Type:

float | None

index

Modal index for the optical objectives.

Type:

Interpolator | None

min_gap

Edge-to-edge spacing floor between group members, in μm.

Type:

float | None

nets

Net indices in the group; empty means every net.

Type:

tuple[int, …]

objective

Quantity equalized: ‘length’, ‘phase’, or ‘group_delay’.

Type:

str

offsets

Upstream length credit per net.

Type:

tuple[float, …] | None

properties

Object properties.

Type:

Properties

strict

Raise instead of reporting a refusal.

Type:

bool

target

Group target; None matches the longest net.

Type:

float | tuple[float, …] | None

tolerance

Matching tolerance in μm; reports the objective default when unset.

Type:

float