photonic ¤
Photonic components for optical circuit simulation.
All wavelength parameters are in nanometres and power in watts.
Functions:
| Name | Description |
|---|---|
DirectionalCoupler | 4-port directional coupler (2×2 beamsplitter) with configurable power split ratio. |
Grating | Grating coupler with Gaussian wavelength-dependent insertion loss. |
OpticalSource | Ideal CW optical source for DC and small-signal AC analysis. |
OpticalSourcePulse | Time-dependent optical source with a sigmoid turn-on profile. |
OpticalWaveguide | Single-mode waveguide with first-order dispersion and propagation loss. |
Splitter | Lossless asymmetric optical splitter (Y-junction) with a configurable power split ratio. |
TunableBeamSplitter | Ideal lossless 2×2 directional coupler with a variable coupling angle. |
DirectionalCoupler ¤
4-port directional coupler (2×2 beamsplitter) with configurable power split ratio.
Ports p1/p2 are the input ports; p3/p4 are the output ports. Signal entering p1 exits at p3 (bar, amplitude t) and p4 (cross, amplitude jk). Signal entering p2 exits at p3 (cross, jk) and p4 (bar, t).
S-matrix::
S = [[0, 0, t, jk ],
[0, 0, jk, t ],
[t, jk, 0, 0 ],
[jk, t, 0, 0 ]]
where t = sqrt(1 - coupling), k = sqrt(coupling).
.. note:: coupling is clipped to (1e-6, 1−1e-6) to prevent I + S from becoming singular at the degenerate all-through (coupling=0) and all-cross (coupling=1) operating points where the S-matrix has an eigenvalue of −1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signals | Signals | Field amplitudes at all four ports. | required |
s | States | Unused. | required |
coupling | float | Power fraction routed to the cross port (p4 for p1 input, p3 for p2 input). Defaults to | 0.5 |
Source code in circulax/components/photonic.py
Grating ¤
Grating(
signals: Signals,
s: States,
center_wavelength_nm: float = 1310.0,
peak_loss_dB: float = 0.0,
bandwidth_1dB: float = 20.0,
wavelength_nm: float = 1310.0,
) -> PhysicsReturn
Grating coupler with Gaussian wavelength-dependent insertion loss.
Loss increases quadratically with detuning from center_wavelength_nm, approximating the Gaussian spectral response of a typical grating coupler. Transmission is clipped to 0.9999 to keep the Y-matrix well-conditioned.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signals | Signals | Field amplitudes at the grating ( | required |
s | States | Unused. | required |
center_wavelength_nm | float | Peak transmission wavelength in nm. Defaults to | 1310.0 |
peak_loss_dB | float | Insertion loss at peak wavelength in dB. Defaults to | 0.0 |
bandwidth_1dB | float | Full 1 dB bandwidth in nm. Defaults to | 20.0 |
wavelength_nm | float | Operating wavelength in nm. Defaults to | 1310.0 |
Source code in circulax/components/photonic.py
OpticalSource ¤
OpticalSource(
signals: Signals, s: States, power: float = 1.0, phase: float = 0.0
) -> PhysicsReturn
Ideal CW optical source for DC and small-signal AC analysis.
Enforces a fixed complex field amplitude sqrt(power) * exp(j * phase) across its ports, analogous to an ideal voltage source in electrical circuits.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signals | Signals | Field amplitudes at the positive ( | required |
s | States | Source current state variable | required |
power | float | Output optical power in watts. Defaults to | 1.0 |
phase | float | Output field phase in radians. Defaults to | 0.0 |
Source code in circulax/components/photonic.py
OpticalSourcePulse ¤
OpticalSourcePulse(
signals: Signals,
s: States,
t: float,
power: float = 1.0,
phase: float = 0.0,
delay: float = 2e-10,
rise: float = 5e-11,
) -> PhysicsReturn
Time-dependent optical source with a sigmoid turn-on profile.
Field amplitude ramps smoothly from zero to sqrt(power) around delay, with the steepness of the transition controlled by rise. Suitable for transient simulations of optical pulse propagation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signals | Signals | Field amplitudes at the positive ( | required |
s | States | Source current state variable | required |
t | float | Current simulation time in seconds. | required |
power | float | Peak output optical power in watts. Defaults to | 1.0 |
phase | float | Output field phase in radians. Defaults to | 0.0 |
delay | float | Turn-on delay in seconds. Defaults to | 2e-10 |
rise | float | Sigmoid rise time constant in seconds. Defaults to | 5e-11 |
Source code in circulax/components/photonic.py
OpticalWaveguide ¤
OpticalWaveguide(
signals: Signals,
s: States,
length_um: float = 100.0,
loss_dB_cm: float = 1.0,
neff: float = 2.4,
n_group: float = 4.0,
center_wavelength_nm: float = 1310.0,
wavelength_nm: float = 1310.0,
) -> PhysicsReturn
Single-mode waveguide with first-order dispersion and propagation loss.
The effective index is linearised around center_wavelength_nm using the group index to approximate dispersion. Phase and loss are combined into a complex transmission coefficient T, from which the 2×2 S-matrix and corresponding Y-matrix are derived.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signals | Signals | Field amplitudes at input ( | required |
s | States | Unused. | required |
length_um | float | Waveguide length in micrometres. Defaults to | 100.0 |
loss_dB_cm | float | Propagation loss in dB/cm. Defaults to | 1.0 |
neff | float | Effective refractive index at | 2.4 |
n_group | float | Group refractive index, used to compute the dispersion slope. Defaults to | 4.0 |
center_wavelength_nm | float | Reference wavelength for dispersion expansion in nm. Defaults to | 1310.0 |
wavelength_nm | float | Operating wavelength in nm. Defaults to | 1310.0 |
Source code in circulax/components/photonic.py
Splitter ¤
Lossless asymmetric optical splitter (Y-junction) with a configurable power split ratio.
The S-matrix is constructed to be unitary, with the cross-port coupling carrying a j phase shift to satisfy energy conservation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signals | Signals | Field amplitudes at the input ( | required |
s | States | Unused. | required |
split_ratio | float | Fraction of input power routed to | 0.5 |
Source code in circulax/components/photonic.py
TunableBeamSplitter ¤
Ideal lossless 2×2 directional coupler with a variable coupling angle.
Implements a tunable beam splitter using a Modified Nodal Analysis (MNA) voltage-controlled voltage source (VCVS) stamp, which avoids the near-singular (I + S) matrix that arises when applying s_to_y to a lossless transmission-only S-matrix.
The transmission relations enforced are::
E_p3 = cos(theta) * E_p1 + j * sin(theta) * E_p2
E_p4 = j * sin(theta) * E_p1 + cos(theta) * E_p2
Special cases:
theta = 0— bar state:p1 → p3,p2 → p4(no coupling).theta = pi/4— 50/50 beamsplitter (default).theta = pi/2— cross state:p1 → p4,p2 → p3(full coupling).
Two internal state variables i_top and i_bot carry the branch currents at the output ports p3 and p4 respectively. The input ports p1 and p2 contribute no self-stamp; they must be driven by connected sources or loads to avoid floating nodes.
Gradient flow is exact via jax.grad for all values of theta when using the "dense" solver backend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signals | Signals | Field amplitudes at all four ports. | required |
s | States | Branch current state variables | required |
theta | float | Coupling angle in radians. Controls the power split ratio: | pi / 4 |