Path

Overview

A Path label identifies the spatial or logical channel associated with an optical mode.

Examples of paths include different waveguides, fibers, interferometer arms, or abstract routing labels used in a simulation.

In the library, path labels are discrete and orthonormal.

Physical meaning

For two path labels \(p_1\) and \(p_2\), the overlap is

\[\begin{split}\langle p_1, p_2 \rangle = \begin{cases} 1, & p_1 = p_2, \\ 0, & p_1 \neq p_2. \end{cases}\end{split}\]

This means that two modes on different paths are treated as fully distinguishable at the path level.

Examples

Constructing path labels

from symop.modes.labels.path import Path

a = Path("A")
b = Path("B")

print(a)
print(b)
print(a.signature)
print(b.signature)
Path(name='A')
Path(name='B')
('path', 'A')
('path', 'B')

Path overlaps

from symop.modes.labels.path import Path

a1 = Path("A")
a2 = Path("A")
b = Path("B")

print("⟨A|A⟩ =", a1.overlap(a2))
print("⟨A|B⟩ =", a1.overlap(b))
⟨A|A⟩ = (1+0j)
⟨A|B⟩ = 0j

Expected behavior:

  • identical names give overlap 1

  • different names give overlap 0

Role in composite mode labels

Path labels form one component of a composite ModeLabel.

\[m = (p, \pi, \zeta),\]

together with Polarization \(\pi\) and an envelope (typically a BaseEnvelope) \(\zeta\).

The total mode overlap factorizes as

\[\langle m_1, m_2 \rangle = \langle p_1, p_2 \rangle \langle \pi_1, \pi_2 \rangle \langle \zeta_1, \zeta_2 \rangle.\]

This allows routing changes and device actions to modify path labels independently of polarization or envelope structure.

Design notes

  • Path labels are discrete and orthonormal.

  • They distinguish spatial or logical channels.

  • They contribute multiplicatively to composite mode overlap.

  • They provide stable signatures for comparison and caching.