models
¶
SAX Models.
Modules:
Name | Description |
---|---|
bends |
SAX Bend Models. |
couplers |
SAX Coupler Models. |
crossings |
SAX Crossing Models. |
factories |
SAX Default Models. |
mmis |
SAX MMI Models. |
splitters |
SAX Default Models. |
straight |
SAX Default Models. |
Functions:
Name | Description |
---|---|
attenuator |
Simple optical attenuator model. |
bend |
Simple waveguide bend model. |
copier |
Copy 100% of the power at the input ports to all output ports. |
coupler |
Dispersive directional coupler model. |
coupler_ideal |
Ideal 2x2 directional coupler model. |
crossing_ideal |
Ideal waveguide crossing model. |
grating_coupler |
Grating coupler model for fiber-chip coupling. |
mmi1x2 |
Realistic 1x2 MMI splitter model with dispersion and loss. |
mmi1x2_ideal |
Ideal 1x2 multimode interference (MMI) splitter model. |
mmi2x2 |
Realistic 2x2 MMI coupler model with dispersion and asymmetry. |
mmi2x2_ideal |
Ideal 2x2 multimode interference (MMI) coupler model. |
model_2port |
Generate a general 2-port model with 100% transmission. |
model_3port |
Generate a general 3-port model (1x2 splitter). |
model_4port |
Generate a general 4-port model (2x2 coupler). |
passthru |
Copy 100% of the power at each input port to its corresponding output port. |
phase_shifter |
Simple voltage-controlled phase shifter model. |
splitter_ideal |
Ideal 1x2 power splitter model. |
unitary |
Generate a unitary N×M optical device model. |
attenuator
¶
attenuator(*, wl: FloatArrayLike = WL_C, loss: FloatArrayLike = 0.0) -> SDict
Simple optical attenuator model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wl
|
FloatArrayLike
|
The wavelength in micrometers. |
WL_C
|
loss
|
FloatArrayLike
|
Attenuation in decibels (dB). |
0.0
|
Returns:
Type | Description |
---|---|
SDict
|
S-matrix dictionary containing the complex transmission coefficient. |
Examples:
Attenuator:
# mkdocs: render
import matplotlib.pyplot as plt
import numpy as np
import sax
sax.set_port_naming_strategy("optical")
wl = sax.wl_c()
s = sax.models.attenuator(wl=wl, loss=3.0)
thru = np.abs(s[("o1", "o2")]) ** 2
plt.figure()
plt.plot(wl, thru, label="thru")
plt.xlabel("Wavelength [μm]")
plt.ylabel("Power")
plt.legend()
Source code in src/sax/models/straight.py
bend
¶
bend(
wl: FloatArrayLike = WL_C,
wl0: FloatArrayLike = WL_C,
neff: FloatArrayLike = 2.34,
ng: FloatArrayLike = 3.4,
length: FloatArrayLike = 10.0,
loss_dB_cm: FloatArrayLike = 0.1,
) -> SDict
Simple waveguide bend model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wl
|
FloatArrayLike
|
Operating wavelength in micrometers. Can be a scalar or array for multi-wavelength simulations. Defaults to 1.55 μm. |
WL_C
|
wl0
|
FloatArrayLike
|
Reference wavelength in micrometers used for dispersion calculation. This is typically the design wavelength where neff is specified. Defaults to 1.55 μm. |
WL_C
|
neff
|
FloatArrayLike
|
Effective refractive index at the reference wavelength. This value represents the fundamental mode effective index and determines the phase velocity. Defaults to 2.34 (typical for silicon). |
2.34
|
ng
|
FloatArrayLike
|
Group refractive index at the reference wavelength. Used to calculate chromatic dispersion: ng = neff - lambda * d(neff)/d(lambda). Typically ng > neff for normal dispersion. Defaults to 3.4. |
3.4
|
length
|
FloatArrayLike
|
Physical length of the waveguide in micrometers. Determines both the total phase accumulation and loss. Defaults to 10.0 μm. |
10.0
|
loss_dB_cm
|
FloatArrayLike
|
Propagation loss in dB/cm. Includes material absorption, scattering losses, and other loss mechanisms. Set to 0.0 for lossless modeling. Defaults to 0.0 dB/cm. |
0.1
|
Returns:
Type | Description |
---|---|
SDict
|
The bend s-matrix |
Examples:
Basic bend simulation:
# mkdocs: render
import matplotlib.pyplot as plt
import numpy as np
import sax
sax.set_port_naming_strategy("optical")
wl = sax.wl_c()
s = sax.models.bend(wl=wl, length=50.0, loss_dB_cm=0.1, neff=2.35, ng=3.5)
thru = np.abs(s[("o1", "o2")]) ** 2
plt.plot(wl, thru)
plt.xlabel("Wavelength (μm)")
plt.ylabel("thru")
Note
This model treats the bend as an equivalent straight waveguide and does not account for:
- Mode coupling between bend eigenmodes
- Radiation losses due to bending
- Polarization effects in bends
- Non-linear dispersion effects
For more accurate bend modeling, consider using dedicated bend models that account for these physical effects.
Source code in src/sax/models/bends.py
copier
¶
copier(
num_inputs: int,
num_outputs: int,
*,
reciprocal: bool = True,
diagonal: bool = False,
) -> SCooModel
Copy 100% of the power at the input ports to all output ports.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_inputs
|
int
|
Number of input ports for the device. |
required |
num_outputs
|
int
|
Number of output ports for the device. |
required |
reciprocal
|
bool
|
If True, the device exhibits reciprocal behavior where forward and reverse transmissions are equal. Defaults to True. |
True
|
diagonal
|
bool
|
If True, creates diagonal coupling (each input couples to only one output). If False, creates full coupling between all input-output pairs. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
SCooModel
|
A copier model |
Examples:
A 1×4 optical amplifier/splitter:
import sax
amp_splitter = sax.models.copier(1, 4, reciprocal=False)
Si, Sj, Sx, port_map = amp_splitter(wl=1.55)
# Single input amplified and split to 4 outputs
Source code in src/sax/models/factories.py
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
|
coupler
¶
coupler(
*,
wl: FloatArrayLike = WL_C,
wl0: FloatArrayLike = WL_C,
length: FloatArrayLike = 0.0,
coupling0: FloatArrayLike = 0.2,
dk1: FloatArrayLike = 1.2435,
dk2: FloatArrayLike = 5.3022,
dn: FloatArrayLike = 0.02,
dn1: FloatArrayLike = 0.1169,
dn2: FloatArrayLike = 0.4821,
) -> SDict
Dispersive directional coupler model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wl
|
FloatArrayLike
|
Operating wavelength in micrometers. Can be a scalar or array for multi-wavelength simulations. Defaults to 1.55 μm. |
WL_C
|
wl0
|
FloatArrayLike
|
Reference wavelength in micrometers for dispersion expansion. Typically the center design wavelength. Defaults to 1.55 μm. |
WL_C
|
length
|
FloatArrayLike
|
Coupling length in micrometers. This is the length over which the two waveguides are in close proximity. Defaults to 0.0 μm. |
0.0
|
coupling0
|
FloatArrayLike
|
Base coupling coefficient at the reference wavelength from bend regions or other coupling mechanisms. Obtained from FDTD simulations or measurements. Defaults to 0.2. |
0.2
|
dk1
|
FloatArrayLike
|
First-order derivative of coupling coefficient with respect to wavelength (∂κ/∂λ). Units: μm⁻¹. Defaults to 1.2435. |
1.2435
|
dk2
|
FloatArrayLike
|
Second-order derivative of coupling coefficient with respect to wavelength (∂²κ/∂λ²). Units: μm⁻². Defaults to 5.3022. |
5.3022
|
dn
|
FloatArrayLike
|
Effective index difference between even and odd supermodes at the reference wavelength. Determines beating length. Defaults to 0.02. |
0.02
|
dn1
|
FloatArrayLike
|
First-order derivative of effective index difference with respect to wavelength (∂Δn/∂λ). Units: μm⁻¹. Defaults to 0.1169. |
0.1169
|
dn2
|
FloatArrayLike
|
Second-order derivative of effective index difference with respect to wavelength (∂²Δn/∂λ²). Units: μm⁻². Defaults to 0.4821. |
0.4821
|
Returns:
Type | Description |
---|---|
SDict
|
The coupler s-matrix |
Examples:
Basic dispersive coupler:
# mkdocs: render
import matplotlib.pyplot as plt
import numpy as np
import sax
sax.set_port_naming_strategy("optical")
wl = sax.wl_c()
s = sax.models.coupler(
wl=wl,
length=15.7,
coupling0=0.0,
dn=0.02,
)
thru = np.abs(s[("o1", "o4")]) ** 2
cross = np.abs(s[("o1", "o3")]) ** 2
plt.figure()
plt.plot(wl, thru, label="thru")
plt.plot(wl, cross, label="cross")
plt.xlabel("Wavelength [μm]")
plt.ylabel("Power")
plt.legend()
Note
The coupling strength follows the formula:
κ_total = κ₀ + κ₁ + κ_length
Where:
- κ₀ = coupling0 + dk1(λ-λ₀) + 0.5dk2*(λ-λ₀)²
- κ₁ = π*Δn(λ)/λ
- κ_length represents the distributed coupling over the interaction length
Source code in src/sax/models/couplers.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
|
coupler_ideal
¶
coupler_ideal(*, wl: FloatArrayLike = WL_C, coupling: FloatArrayLike = 0.5) -> SDict
Ideal 2x2 directional coupler model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wl
|
FloatArrayLike
|
the wavelength of the simulation in micrometers. |
WL_C
|
coupling
|
FloatArrayLike
|
Power coupling coefficient between 0 and 1. Defaults to 0.5. |
0.5
|
Returns:
Type | Description |
---|---|
SDict
|
The coupler s-matrix |
Examples:
Ideal coupler:
# mkdocs: render
import matplotlib.pyplot as plt
import numpy as np
import sax
sax.set_port_naming_strategy("optical")
wl = sax.wl_c()
s = sax.models.coupler_ideal(
wl=wl,
coupling=0.3,
)
thru = np.abs(s[("o1", "o4")]) ** 2
cross = np.abs(s[("o1", "o3")]) ** 2
plt.figure()
plt.plot(wl, thru, label="thru")
plt.plot(wl, cross, label="cross")
plt.xlabel("Wavelength [μm]")
plt.ylabel("Power")
plt.legend()
Source code in src/sax/models/couplers.py
crossing_ideal
¶
crossing_ideal(wl: FloatArrayLike = WL_C) -> SDict
Ideal waveguide crossing model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wl
|
FloatArrayLike
|
Wavelength in micrometers. |
WL_C
|
Returns:
Type | Description |
---|---|
SDict
|
The crossing s-matrix |
Examples:
Ideal crossing:
# mkdocs: render
import matplotlib.pyplot as plt
import numpy as np
import jax.numpy as jnp
import sax
sax.set_port_naming_strategy("optical")
wl = sax.wl_c()
s = sax.models.crossing_ideal(wl=wl)
thru = np.abs(s[("o1", "o3")]) ** 2
cross = np.abs(s.get(("o1", "o2"), jnp.zeros_like(wl))) ** 2
plt.figure()
plt.plot(wl, thru, label="thru")
plt.plot(wl, cross, label="cross")
plt.xlabel("Wavelength [μm]")
plt.ylabel("Power")
plt.legend()
Source code in src/sax/models/crossings.py
grating_coupler
¶
grating_coupler(
*,
wl: FloatArrayLike = WL_C,
wl0: FloatArrayLike = WL_C,
loss: FloatArrayLike = 0.0,
reflection: FloatArrayLike = 0.0,
reflection_fiber: FloatArrayLike = 0.0,
bandwidth: FloatArrayLike = 0.04,
) -> SDict
Grating coupler model for fiber-chip coupling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wl
|
FloatArrayLike
|
Operating wavelength in micrometers. Can be a scalar or array for spectral analysis. Defaults to 1.55 μm. |
WL_C
|
wl0
|
FloatArrayLike
|
Center wavelength in micrometers where peak transmission occurs. This is the design wavelength of the grating. Defaults to 1.55 μm. |
WL_C
|
loss
|
FloatArrayLike
|
Insertion loss in dB at the center wavelength. Includes coupling efficiency losses, scattering, and mode mismatch. Defaults to 0.0 dB. |
0.0
|
reflection
|
FloatArrayLike
|
Reflection coefficient from the waveguide side (chip interface). Represents reflections back into the waveguide from grating discontinuities. Range: 0 to 1. Defaults to 0.0. |
0.0
|
reflection_fiber
|
FloatArrayLike
|
Reflection coefficient from the fiber side (top interface). Represents reflections back toward the fiber from the grating surface. Range: 0 to 1. Defaults to 0.0. |
0.0
|
bandwidth
|
FloatArrayLike
|
3dB bandwidth in micrometers. Determines the spectral width of the Gaussian transmission profile. Typical values: 20-50 nm. Defaults to 40e-3 μm (40 nm). |
0.04
|
Returns:
Type | Description |
---|---|
SDict
|
The grating coupler s-matrix |
Examples:
Basic grating coupler:
# mkdocs: render
import matplotlib.pyplot as plt
import numpy as np
import sax
sax.set_port_naming_strategy("optical")
wl = np.linspace(1.5, 1.6, 101)
s = sax.models.grating_coupler(
wl=wl,
loss=3.0,
bandwidth=0.035,
)
plt.figure()
plt.plot(wl, np.abs(s[("o1", "o2")]) ** 2, label="Transmission")
plt.xlabel("Wavelength (μm)")
plt.ylabel("Power")
plt.legend()
Note
The transmission profile follows a Gaussian shape: T(λ) = T₀ * exp(-((λ-λ₀)/σ)²)
Where σ = bandwidth / (2√(2ln(2))) converts FWHM to Gaussian width.
This model assumes:
- Gaussian spectral response (typical for uniform gratings)
- Wavelength-independent loss coefficient
- Linear polarization (TE or TM)
- Single-mode fiber coupling
- No higher-order diffraction effects
Source code in src/sax/models/couplers.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 |
|
mmi1x2
¶
mmi1x2(
wl: FloatArrayLike = WL_C,
wl0: FloatArrayLike = WL_C,
fwhm: FloatArrayLike = 0.2,
loss_dB: FloatArrayLike = 0.3,
) -> SDict
Realistic 1x2 MMI splitter model with dispersion and loss.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wl
|
FloatArrayLike
|
The wavelength in micrometers. |
WL_C
|
wl0
|
FloatArrayLike
|
The Center wavelength of the MMI |
WL_C
|
fwhm
|
FloatArrayLike
|
The Full width at half maximum or the MMI. |
0.2
|
loss_dB
|
FloatArrayLike
|
Insertion loss in dB at the center wavelength. |
0.3
|
Returns:
Type | Description |
---|---|
SDict
|
S-matrix dictionary representing the dispersive MMI splitter behavior. |
Examples:
Basic 1x2 MMI:
# mkdocs: render
import matplotlib.pyplot as plt
import numpy as np
import sax
sax.set_port_naming_strategy("optical")
wl = sax.wl_c()
s = sax.models.mmi1x2(wl=wl)
thru = np.abs(s[("o1", "o3")]) ** 2
cross = np.abs(s[("o1", "o2")]) ** 2
plt.figure()
plt.plot(wl, thru, label="thru")
plt.plot(wl, cross, label="cross")
plt.xlabel("Wavelength [μm]")
plt.ylabel("Power")
plt.legend()
Source code in src/sax/models/mmis.py
mmi1x2_ideal
¶
mmi1x2_ideal(wl: FloatArrayLike = WL_C) -> SDict
Ideal 1x2 multimode interference (MMI) splitter model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wl
|
FloatArrayLike
|
The wavelength in micrometers. |
WL_C
|
Returns:
Type | Description |
---|---|
SDict
|
S-matrix dictionary representing the ideal MMI splitter behavior. |
Examples:
Ideal 1x2 MMI:
# mkdocs: render
import matplotlib.pyplot as plt
import numpy as np
import sax
sax.set_port_naming_strategy("optical")
wl = sax.wl_c()
s = sax.models.mmi1x2_ideal(wl=wl)
thru = np.abs(s[("o1", "o3")]) ** 2
cross = np.abs(s[("o1", "o2")]) ** 2
plt.figure()
plt.plot(wl, thru, label="thru")
plt.plot(wl, cross, label="cross")
plt.xlabel("Wavelength [μm]")
plt.ylabel("Power")
plt.legend()
Source code in src/sax/models/mmis.py
mmi2x2
¶
mmi2x2(
wl: FloatArrayLike = WL_C,
wl0: FloatArrayLike = WL_C,
fwhm: FloatArrayLike = 0.2,
loss_dB: FloatArrayLike = 0.3,
shift: FloatArrayLike = 0.0,
loss_dB_cross: FloatArrayLike | None = None,
loss_dB_thru: FloatArrayLike | None = None,
splitting_ratio_cross: FloatArrayLike = 0.5,
splitting_ratio_thru: FloatArrayLike = 0.5,
) -> SDict
Realistic 2x2 MMI coupler model with dispersion and asymmetry.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wl
|
FloatArrayLike
|
wavelength in micrometers. |
WL_C
|
wl0
|
FloatArrayLike
|
Center wavelength of the MMI in micrometers. |
WL_C
|
fwhm
|
FloatArrayLike
|
Full width at half maximum bandwidth in micrometers. |
0.2
|
loss_dB
|
FloatArrayLike
|
Insertion loss of the MMI at center wavelength. |
0.3
|
shift
|
FloatArrayLike
|
The peak shift of the cross-transmission in micrometers. |
0.0
|
loss_dB_cross
|
FloatArrayLike | None
|
Optional separate insertion loss in dB for cross ports. If None, uses loss_dB. Allows modeling of asymmetric loss. |
None
|
loss_dB_thru
|
FloatArrayLike | None
|
Optional separate insertion loss in dB for bar (through) ports. If None, uses loss_dB. Allows modeling of asymmetric loss. |
None
|
splitting_ratio_cross
|
FloatArrayLike
|
Power splitting ratio for cross ports (0 to 1). Allows modeling of imbalanced coupling. Defaults to 0.5. |
0.5
|
splitting_ratio_thru
|
FloatArrayLike
|
Power splitting ratio for bar ports (0 to 1). Allows modeling of imbalanced transmission. Defaults to 0.5. |
0.5
|
Returns:
Type | Description |
---|---|
SDict
|
S-matrix dictionary representing the realistic MMI coupler behavior. |
Examples:
Basic 2x2 MMI:
# mkdocs: render
import matplotlib.pyplot as plt
import numpy as np
import sax
sax.set_port_naming_strategy("optical")
wl = sax.wl_c()
s = sax.models.mmi2x2(wl=wl, shift=0.001)
thru = np.abs(s[("o1", "o4")]) ** 2
cross = np.abs(s[("o1", "o3")]) ** 2
plt.figure()
plt.plot(wl, thru, label="thru")
plt.plot(wl, cross, label="cross")
plt.xlabel("Wavelength [μm]")
plt.ylabel("Power")
plt.legend()
```
Source code in src/sax/models/mmis.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|
mmi2x2_ideal
¶
mmi2x2_ideal(*, wl: FloatArrayLike = WL_C) -> SDict
Ideal 2x2 multimode interference (MMI) coupler model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wl
|
FloatArrayLike
|
The wavelength in micrometers. |
WL_C
|
Returns:
Type | Description |
---|---|
SDict
|
S-matrix dictionary representing the ideal MMI coupler behavior. |
Examples:
Ideal 2x2 MMI:
# mkdocs: render
import matplotlib.pyplot as plt
import numpy as np
import sax
sax.set_port_naming_strategy("optical")
wl = sax.wl_c()
s = sax.models.mmi2x2_ideal(wl=wl)
thru = np.abs(s[("o1", "o4")]) ** 2
cross = np.abs(s[("o1", "o3")]) ** 2
plt.figure()
plt.plot(wl, thru, label="thru")
plt.plot(wl, cross, label="cross")
plt.xlabel("Wavelength [μm]")
plt.ylabel("Power")
plt.legend()
Source code in src/sax/models/mmis.py
model_2port
¶
model_2port(p1: Name, p2: Name) -> SDictModel
Generate a general 2-port model with 100% transmission.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p1
|
Name
|
Name of the first port (typically in0 or o1). |
required |
p2
|
Name
|
Name of the second port (typically out0 or o2). |
required |
Returns:
Type | Description |
---|---|
SDictModel
|
A 2-port model |
Source code in src/sax/models/factories.py
model_3port
¶
model_3port(p1: Name, p2: Name, p3: Name) -> SDictModel
Generate a general 3-port model (1x2 splitter).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p1
|
Name
|
Name of the input port (typically o1 or in0). |
required |
p2
|
Name
|
Name of the first output port (typically o2 or out1). |
required |
p3
|
Name
|
Name of the second output port (typically o3 or out0). |
required |
Returns:
Type | Description |
---|---|
SDictModel
|
A 3-port model |
Source code in src/sax/models/factories.py
model_4port
¶
model_4port(p1: Name, p2: Name, p3: Name, p4: Name) -> SDictModel
Generate a general 4-port model (2x2 coupler).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p1
|
Name
|
Name of the first input port (typically o1 or in0). |
required |
p2
|
Name
|
Name of the second input port (typically o2 or in1). |
required |
p3
|
Name
|
Name of the first output port (typically o3 or out1). |
required |
p4
|
Name
|
Name of the second output port (typicall o4 or out0). |
required |
Returns:
Type | Description |
---|---|
SDictModel
|
A 4-port model |
Source code in src/sax/models/factories.py
passthru
¶
Copy 100% of the power at each input port to its corresponding output port.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_links
|
int
|
Number of independent pass-through links (input-output pairs). This creates a device with num_links inputs and num_links outputs. |
required |
reciprocal
|
bool
|
If True, the device exhibits reciprocal behavior where transmission is identical in both directions. This is typical for passive devices like fibers and waveguides. Defaults to True. |
True
|
Returns:
Type | Description |
---|---|
SCooModel
|
A passthru model |
Examples:
Create an 8×8 optical switch (straight-through state):
switch_thru = sax.models.passthru(8, reciprocal=True)
Si, Sj, Sx, port_map = switch_thru(wl=1.55)
# Each input passes straight to corresponding output
Source code in src/sax/models/factories.py
phase_shifter
¶
phase_shifter(
wl: FloatArrayLike = WL_C,
neff: FloatArrayLike = 2.34,
voltage: FloatArrayLike = 0,
length: FloatArrayLike = 10,
loss: FloatArrayLike = 0.0,
) -> SDict
Simple voltage-controlled phase shifter model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wl
|
FloatArrayLike
|
The wavelength in micrometers. |
WL_C
|
neff
|
FloatArrayLike
|
The Effective index of the unperturbed waveguide mode. |
2.34
|
voltage
|
FloatArrayLike
|
The Applied voltage in volts. The phase shift is assumed to be linearly proportional to voltage with a coefficient of π rad/V. Positive voltage increases the phase. Defaults to 0 V. |
0
|
length
|
FloatArrayLike
|
The length of the phase shifter in micrometers. |
10
|
loss
|
FloatArrayLike
|
Additional loss in dB introduced by the active region. |
0.0
|
Returns:
Type | Description |
---|---|
SDict
|
S-matrix dictionary containing the complex-valued transmission coefficient. |
Examples:
Phase shifter:
# mkdocs: render
import matplotlib.pyplot as plt
import numpy as np
import sax
sax.set_port_naming_strategy("optical")
wl = sax.wl_c()
s = sax.models.phase_shifter(wl=wl, loss=3.0)
thru = np.abs(s[("o1", "o2")]) ** 2
plt.figure()
plt.plot(wl, thru, label="thru")
plt.xlabel("Wavelength [μm]")
plt.ylabel("Power")
plt.legend()
Source code in src/sax/models/straight.py
splitter_ideal
¶
splitter_ideal(*, wl: FloatArrayLike = WL_C, coupling: FloatArrayLike = 0.5) -> SDict
Ideal 1x2 power splitter model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wl
|
FloatArrayLike
|
Wavelength in micrometers. |
WL_C
|
coupling
|
FloatArrayLike
|
Power coupling ratio between 0 and 1. |
0.5
|
Returns:
Type | Description |
---|---|
SDict
|
S-matrix dictionary containing the complex-valued cross/thru coefficients. |
Examples:
Ideal 1x2 splitter:
# mkdocs: render
import matplotlib.pyplot as plt
import numpy as np
import sax
sax.set_port_naming_strategy("optical")
wl = sax.wl_c()
s = sax.models.splitter_ideal(wl=wl, coupling=0.3)
thru = np.abs(s[("o1", "o3")]) ** 2
cross = np.abs(s[("o1", "o2")]) ** 2
plt.figure()
plt.plot(wl, thru, label="thru")
plt.plot(wl, cross, label="cross")
plt.xlabel("Wavelength [μm]")
plt.ylabel("Power")
plt.legend()
Source code in src/sax/models/splitters.py
unitary
¶
unitary(
num_inputs: int,
num_outputs: int,
*,
reciprocal: bool = True,
diagonal: bool = False,
) -> SCooModel
Generate a unitary N×M optical device model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_inputs
|
int
|
Number of input ports for the device. |
required |
num_outputs
|
int
|
Number of output ports for the device. |
required |
reciprocal
|
bool
|
If True, the device exhibits reciprocal behavior (S = S^T). This is typical for passive optical devices. Defaults to True. |
True
|
diagonal
|
bool
|
If True, creates a diagonal coupling matrix (each input couples to only one output). If False, creates full coupling between all input-output pairs. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
SCooModel
|
A unitary model |
Source code in src/sax/models/factories.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|