components ¤
Reusable electronic, photonic and fitted circuit models.
Modules:
| Name | Description |
|---|---|
base_component | Base class and decorators for defining JAX-compatible circuit components. |
characteristic_line | Uniform transmission lines realized by their characteristic admittance and exact delay. |
electronic | Electronic components. |
filters | Buffered continuous-time voltage filters for driver and behavioral models. |
hybrid_laser | Netlist assemblies for reconfigurable gain and passive-feedback laser cavities. |
laser_mirrors | Passive single-pole spectral reflection and electrically loaded thermal tuning. |
laser_modes | Longitudinal threshold conditions for the native thermally tuned laser. |
laser_sections | Composable bidirectional sections for reconfigurable semiconductor laser circuits. |
phase_shifter | Electro-optic phase shifters built from designer-supplied physics. |
photonic | Photonic components for optical circuit simulation. |
rational | Factory functions for creating Circulax components from rational fitting models. |
soa | Forward diode coupled to a single-pass, integrated optical gain state. |
transmission_line | Passive, causal RLC transmission-line factories from sampled RLGC data. |
traveling_wave_laser | Electrically pumped, bidirectional delayed-gain laser circuit component. |
va_component | Backward-compatibility shim — re-exports |
Classes:
| Name | Description |
|---|---|
HybridSettings | Passive-feedback settings: comb spacings Hz, lengths m, phase rad/K, loss dB. |
JunctionModel | Electrical junction model per metre of length, usable on its own. |
RLGCTransmissionLine | Reusable fitted line; call with a length in metres to create a Circuit. |
Functions:
| Name | Description |
|---|---|
Bessel3 | Unity-DC-gain third-order Bessel low-pass, normalized at -3 dB. |
BidirectionalWaveguide | Reflection-free reciprocal propagation with real flight time and loss. |
Biquad | Unity-DC-gain second-order low-pass with -3 dB frequency and quality factor. |
CoupledInductors | Two magnetically coupled inductors with |
DifferentialAdapter | Lossless bidirectional differential/common to conductor adapter. |
IdealTransformer | Ideal transformer with turns ratio |
LowPass1 | Unity-DC-gain first-order low-pass; |
MatchedOpticalLoad | Absorb a wave at unit reference impedance; no incident optical field. |
MatchedOpticalPulse | Matched coherent pulse source: prescribed incoming wave, absorbs return. |
OpticalDelayLine | Waveguide modelled as an explicit time-of-flight delay line (real group delay). |
OpticalDirectionalCoupler | Reciprocal unitary four-port coupler, suitable for connecting ring loops. |
OpticalInterface | Reciprocal optical interface; r=i*rho, t=sqrt(1-rho²), common excess loss. |
SemiconductorOpticalAmplifier | Diode injection, gain depletion/recovery, and carrier-induced phase. |
ThermoOpticPhaseShifter | Reciprocal delayed phase section, uniform arrival-time temperature. |
TransmissionLine | Matched bidirectional transmission line with exact fixed delay. |
TravelingWaveGainCell | One retarded-gain cell; both delayed incident powers share one reservoir. |
add_drop_ring | Bidirectional add/drop ring assembled from two couplers and two arms. |
characteristic_rlgc_transmission_line | Create a fast uniform line from RLGC versus Hz, with its delay de-embedded. |
charge_from_capacitance_table | Integrate a C(V) table, in F/m, into a junction charge function in C/m. |
delay_line_fdomain | Frequency-domain delay line for AC and harmonic-balance analysis. |
delta_neff_from_vpil | Integrate a small-signal VπL table into |
depletion_charge | Depletion charge per metre with SPICE forward-bias linearisation. |
diode_current | Diode current per metre: Shockley equation plus a dark-current shunt. |
hybrid_laser_netlist | Editable cavity netlist and model map, without drives or terminations. |
junction_model | Build a junction model from functions of voltage, per metre of length. |
mode_transmission_line | Generate a passive RLC line factory from uniform-mode propagation data. |
phase_shifter_factory | Build an electro-optic phase shifter component from functions of voltage. |
pn_diode | PN diode per metre: :func: |
reduced_rlgc_transmission_line | Create a compact, transient-capable uniform line from RLGC versus Hz. |
ring_reflector | Ring drop port followed by a mirror: a replaceable spectral reflector. |
rlgc_transmission_line | Fit frequency-dependent RLGC per metre and return a line factory. |
sampled_bragg_grating | Lossless thin-patch sampled-grating approximation with causal gap delays. |
tabulated | Return a piecewise-linear function of voltage from a sampled table. |
HybridSettings ¤
Bases: NamedTuple
Passive-feedback settings: comb spacings Hz, lengths m, phase rad/K, loss dB.
samples is a physical number of identical thin grating patches. Each grating's length is (samples-1)c/(2n_g*FSR). Loss is per optical interface.
JunctionModel ¤
JunctionModel(
current_fn: VoltageFunction | None,
current_params: list[Parameter],
charge_fn: VoltageFunction | None,
charge_params: list[Parameter],
)
Electrical junction model per metre of length, usable on its own.
Create one with :func:junction_model or :func:pn_diode. Evaluate it directly with :meth:current, :meth:charge and :meth:capacitance (arrays and parameter overrides are accepted), build a two-terminal circuit component with :meth:component, or pass it to :func:phase_shifter_factory as junction.
Methods:
| Name | Description |
|---|---|
capacitance | Small-signal capacitance per metre, |
charge | Stored charge per metre in C/m, zero at 0 V for the built-in models. |
charge_per_m | Junction charge in C/m for already-resolved parameters (traced use). |
component | Return a two-terminal component with ports |
current | DC current per metre, anode to cathode, in A/m. |
current_per_m | Junction current in A/m for already-resolved parameters (traced use). |
Attributes:
| Name | Type | Description |
|---|---|---|
defaults | dict[str, float] | Default value of every runtime parameter. |
Source code in circulax/components/phase_shifter.py
capacitance ¤
Small-signal capacitance per metre, d charge / dv, in F/m.
Source code in circulax/components/phase_shifter.py
charge ¤
Stored charge per metre in C/m, zero at 0 V for the built-in models.
Source code in circulax/components/phase_shifter.py
charge_per_m ¤
Junction charge in C/m for already-resolved parameters (traced use).
Source code in circulax/components/phase_shifter.py
component ¤
component(name: str = 'Junction') -> type[CircuitComponent]
Return a two-terminal component with ports anode and cathode.
Its runtime parameters are length_um plus :attr:defaults; the component carries length * current(v) and stores length * charge(v).
Source code in circulax/components/phase_shifter.py
current ¤
DC current per metre, anode to cathode, in A/m.
current_per_m ¤
Junction current in A/m for already-resolved parameters (traced use).
Source code in circulax/components/phase_shifter.py
RLGCTransmissionLine dataclass ¤
Reusable fitted line; call with a length in metres to create a Circuit.
Both fits use nonnegative RLC values, ensuring a passive, causal finite ladder. This does not certify that the supplied sampled data is causal, nor that the approximation is accurate outside frequency_range.
Methods:
| Name | Description |
|---|---|
netlist | Build an unterminated symmetric-T ladder from R, L and C primitives. |
netlist ¤
Build an unterminated symmetric-T ladder from R, L and C primitives.
Ports p1 and p2 are single-ended relative to the internal common ground. tap_0 ... tap_{n_sections-1} expose section midpoints for junction loading. No source, termination, optical model or delay is added. Increasing n_sections reduces the spatial discretization error.
Source code in circulax/components/transmission_line.py
Bessel3 ¤
Unity-DC-gain third-order Bessel low-pass, normalized at -3 dB.
The delay-normalized prototype is 15/(p**3+6*p**2+15*p+15). Its -3 dB angular frequency is 1.7556723686812106; scaling by it makes f3db the voltage magnitude cutoff. The DC group delay is 1.7556723686812106/(2*pi*f3db). This buffered block includes that filter delay; add physical flight time separately when needed.
Source code in circulax/components/filters.py
BidirectionalWaveguide ¤
BidirectionalWaveguide(
signals: Signals,
length_m: float = 5e-05,
group_index: float = 4.0,
loss_m1: float = 0.0,
phase_rad: float = 0.0,
frame_offset_rad_s: float = 0.0,
) -> PhysicsReturn
Reflection-free reciprocal propagation with real flight time and loss.
phase_rad is the phase at the fixed optical reference, not a recomputed carrier phase when changing envelope coordinates. loss_m1 is power loss.
Source code in circulax/components/laser_sections.py
Biquad ¤
Unity-DC-gain second-order low-pass with -3 dB frequency and quality factor.
H(s)=w0**2/(s**2+w0*s/Q+w0**2). w0 is computed so the magnitude is 1/sqrt(2) at f3db for every positive Q. For Q>1/sqrt(2), the response has peaking. This is an ideal buffered voltage block.
Source code in circulax/components/filters.py
CoupledInductors ¤
CoupledInductors(
signals: Signals, L1: float = 1e-09, L2: float = 1e-09, k: float = 0.5
) -> PhysicsReturn
Two magnetically coupled inductors with M = k * sqrt(L1 * L2).
Dots are on p1 and s1; currents are positive into the dotted terminals. The parameters should satisfy L1, L2 > 0 and |k| <= 1. At k = 0 the windings are independent. For |k| = 1 the inductance matrix is singular.
Source code in circulax/components/electronic.py
DifferentialAdapter ¤
DifferentialAdapter(signals: Signals) -> PhysicsReturn
Lossless bidirectional differential/common to conductor adapter.
Va=Vc+Vd/2, Vb=Vc-Vd/2. Currents are positive into this component at all four ports, so Id=-(Ia-Ib)/2 and Ic=-(Ia+Ib). The resulting instantaneous sum of port powers is zero. Modal impedances use the full differential/common convention (2*Zodd and Zeven/2).
Source code in circulax/components/electronic.py
IdealTransformer ¤
Ideal transformer with turns ratio n = N1 / N2 (n > 0).
Dots are on p1 and s1. It passes DC; add a magnetizing inductor across the primary to model low-frequency roll-off.
Source code in circulax/components/electronic.py
LowPass1 ¤
Unity-DC-gain first-order low-pass; f3db is the -3 dB frequency.
H(s)=1/(1+s*tau), tau=1/(2*pi*f3db). Input current is zero; the output voltage is independent of the connected load.
Source code in circulax/components/filters.py
MatchedOpticalLoad ¤
MatchedOpticalLoad(signals: Signals) -> PhysicsReturn
Absorb a wave at unit reference impedance; no incident optical field.
MatchedOpticalPulse ¤
MatchedOpticalPulse(
signals: Signals,
t: float,
power_w: float = 1e-12,
start_s: float = 1e-11,
duration_s: float = 3e-11,
) -> PhysicsReturn
Matched coherent pulse source: prescribed incoming wave, absorbs return.
Compact sin² FIELD, sin⁴ power; exactly zero outside its support. This is deterministic startup, not spontaneous emission. p2 is optical reference.
Source code in circulax/components/laser_sections.py
OpticalDelayLine ¤
OpticalDelayLine(
signals: Signals,
length_um: float = 100.0,
loss_dB_cm: float = 1.0,
neff: float = 2.4,
n_group: float = 4.0,
wavelength_nm: float = 1310.0,
) -> PhysicsReturn
Waveguide modelled as an explicit time-of-flight delay line (real group delay).
Unlike :func:OpticalWaveguide -- which is a steady-state S-matrix stamp only valid for CW/frequency-domain analysis -- this component enforces the actual transient envelope delay: the output field at p2 is the input field at p1 from tau = length_um * n_group / c seconds ago, attenuated and phase-shifted, via a VCVS-style constraint (same pattern as :func:TunableBeamSplitter). p1 carries no self-stamp and must be driven by a connected source/component, matching that same convention.
See circulax.solvers.assembly for how the delayed local state is computed -- a fixed-size accepted-step history buffer read via jnp.interp, vmapped per-instance since tau may vary across instances of different length. Adaptive and fixed step-size controllers may take steps longer than tau; interpolation against the current Newton trial supplies the required delay Jacobian in that regime.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signals | Signals | Current and delayed component-local fields and branch state. | 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, used for the carrier phase shift over the delay. Defaults to | 2.4 |
n_group | float | Group refractive index; sets the propagation delay via | 4.0 |
wavelength_nm | float | Operating wavelength in nm. Defaults to | 1310.0 |
Source code in circulax/components/photonic.py
OpticalDirectionalCoupler ¤
Reciprocal unitary four-port coupler, suitable for connecting ring loops.
Forward inputs p1,p2 exit at p3,p4; reverse paths follow reciprocity. Cross coupling has +i phase. The physical ring delay belongs in waveguides.
Source code in circulax/components/laser_sections.py
OpticalInterface ¤
OpticalInterface(
signals: Signals, amplitude_reflection: float = 0.0, power_loss_db: float = 0.0
) -> PhysicsReturn
Reciprocal optical interface; r=i*rho, t=sqrt(1-rho²), common excess loss.
rho is a real amplitude magnitude in [-1,1], not power reflectance. This also supplies a frequency-flat mirror when excess loss is zero.
Source code in circulax/components/laser_sections.py
SemiconductorOpticalAmplifier ¤
SemiconductorOpticalAmplifier(
signals: Signals,
length_um: float = 600.0,
width_um: float = 2.0,
thickness_um: float = 0.1,
lifetime_s: float = 2.8e-10,
confinement: float = 0.3,
differential_gain_m2: float = 6e-20,
transparency_m3: float = 5.5e23,
injection_efficiency: float = 0.8,
wavelength_nm: float = 1540.0,
alpha_h: float = 3.5,
loss_db_per_cm: float = 0.0,
saturation: float = 1.0,
saturation_current_a: float = 1e-12,
ideality: float = 1.8,
thermal_voltage_v: float = 0.02585,
resistance_ohm: float = 5.0,
capacitance_f: float = 1.5e-13,
) -> PhysicsReturn
Diode injection, gain depletion/recovery, and carrier-induced phase.
h is the integral of modal gain over length. Its storage term yields taudh/dt = h0(I_D)-h-saturationPin*expm1(h)/Psat for zero passive loss. Set saturation=0 for a linear amplifier, and alpha_h=0 for no chirp. The junction's displacement current is excluded from carrier injection. Diode Is and C scale with contact area; vertical series R scales inversely. ASE is sampled separately with :func:ase_field, never inside Newton. Uniform passive loss is approximated with constant gain per segment. Subdivide the device to resolve loss with longitudinal depletion. The model neglects thermal effects and ASE depletion. Time follows the optical envelope; propagation delay is not included.
Source code in circulax/components/soa.py
ThermoOpticPhaseShifter ¤
ThermoOpticPhaseShifter(
signals: Signals,
length_m: float = 0.0001,
group_index: float = 4.0,
loss_m1: float = 0.0,
phase_rad: float = 0.0,
phase_per_k: float = 0.15,
frame_offset_rad_s: float = 0.0,
heater_resistance_ohm: float = 100.0,
thermal_resistance_k_per_w: float = 200.0,
thermal_tau_s: float = 1e-06,
) -> PhysicsReturn
Reciprocal delayed phase section, uniform arrival-time temperature.
temperature is the rise above ambient (K); phase_per_k is one-pass rad/K. Thermal variation during a flight is neglected (flight << thermal time).
Source code in circulax/components/laser_sections.py
TransmissionLine ¤
TransmissionLine(
signals: Signals, tau: float = 1e-09, z0: float = 50.0, attenuation: float = 1.0
) -> PhysicsReturn
Matched bidirectional transmission line with exact fixed delay.
a1 and a2 are the incident power-wave amplitudes at the two reference planes. The outgoing waves are the delayed incident wave from the opposite end. This stamp stays finite for an exactly lossless line and therefore avoids the singular S -> Y conversion of an ideal through connection.
The same equations are interpreted by DC, transient, AC, and HB.
Source code in circulax/components/electronic.py
TravelingWaveGainCell ¤
TravelingWaveGainCell(
signals: Signals,
length_m: float = 7.5e-05,
width_m: float = 2e-06,
thickness_m: float = 1e-07,
group_index: float = 3.6,
lifetime_s: float = 2.8e-10,
confinement: float = 0.3,
differential_gain_m2: float = 6e-20,
transparency_m3: float = 5.5e23,
injection_efficiency: float = 0.8,
wavelength_m: float = 1.54e-06,
alpha_h: float = 3.5,
loss_m1: float = 1000.0,
detuning_rad_s: float = 0.0,
frame_offset_rad_s: float = 0.0,
saturation: float = 1.0,
saturation_current_a: float = 1e-12,
ideality: float = 1.8,
thermal_voltage_v: float = 0.02585,
resistance_ohm: float = 5.0,
capacitance_f: float = 1.5e-13,
) -> PhysicsReturn
One retarded-gain cell; both delayed incident powers share one reservoir.
Connect cells in optical series and their diode terminals in electrical parallel for a uniformly contacted gain region. Diode area scales with cell length. Frozen arrival-time gain is first order in cell length. Interference is averaged; carrier gratings, gain dispersion and spontaneous noise omitted.
Source code in circulax/components/laser_sections.py
add_drop_ring cached ¤
add_drop_ring(
*,
length_m: float = 0.0004,
group_index: float = 4.0,
power_coupling: float = 0.2,
loss_m1: float = 100.0
) -> Circuit
Bidirectional add/drop ring assembled from two couplers and two arms.
Ports input/through/add/drop plus heater/heater_return. One arm supplies thermal phase tuning. All unexcited optical ports must be terminated.
Source code in circulax/components/hybrid_laser.py
characteristic_rlgc_transmission_line ¤
characteristic_rlgc_transmission_line(
frequencies: ArrayLike,
*,
R: ArrayLike | Callable[[ndarray], ArrayLike],
L: ArrayLike | Callable[[ndarray], ArrayLike],
G: ArrayLike | Callable[[ndarray], ArrayLike],
C: ArrayLike | Callable[[ndarray], ArrayLike],
length: float,
tolerance: float = 0.001,
max_order: int = 40,
delay_fraction: float = 0.98,
z0: float = 50.0
) -> Circuit
Create a fast uniform line from RLGC versus Hz, with its delay de-embedded.
Use it instead of :func:~circulax.components.reduced_rlgc_transmission_line when the line is electrically long. That model fits the S-parameters and needs many poles to follow the propagation phase. This one removes the delay exactly and fits only the smooth characteristic admittance and the remaining propagation. frequencies must start at DC, and the lowest nonzero frequency must be low enough for the DC floors described in :func:~circulax.fitting.fit_rlgc_characteristic. That function also documents the admission checks; a fit failing them raises ValueError. z0 is only the reference impedance for the S error check.
Ports p1 and p2 are single-ended to ground, with no internal taps. Fitting depends on length, so refit for a different length. Use fit_rlgc_characteristic to inspect the fit and model.circuit() to realize it.
Source code in circulax/components/characteristic_line.py
charge_from_capacitance_table ¤
charge_from_capacitance_table(
voltages: ArrayLike,
capacitance_F_per_m: ArrayLike,
*,
reference_voltage: float = 0.0
) -> VoltageFunction
Integrate a C(V) table, in F/m, into a junction charge function in C/m.
The capacitance is interpolated linearly and integrated exactly, so d charge / dv reproduces the table and stays continuous; outside the table the end capacitances are held. Pass the result as charge to :func:junction_model.
Source code in circulax/components/phase_shifter.py
delay_line_fdomain ¤
delay_line_fdomain(
f: float, length_um: float = 100.0, loss_dB_cm: float = 1.0, n_group: float = 4.0
) -> ndarray
Frequency-domain delay line for AC and harmonic-balance analysis.
Models a pure transmission-line group delay: S21 = T_mag * exp(-j 2pi f tau) where tau = length_um * n_group / c and T_mag accounts for propagation loss. The S-matrix is converted to a Y-matrix via :func:s_to_y.
This is a frequency-domain-only component (f = modulation / signal frequency, e.g. 1 GHz for an AC sweep). Carrier-phase effects (neff, wavelength_nm) belong in the wavelength-domain :func:OpticalWaveguide and are intentionally excluded here.
This component is AC/HB-only; it cannot be used in transient simulation (fdomain components raise at transient setup time).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f | float | Modulation frequency in Hz (supplied by the AC/HB solver). | 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 |
n_group | float | Group refractive index; sets the propagation delay via | 4.0 |
Source code in circulax/components/photonic.py
delta_neff_from_vpil ¤
delta_neff_from_vpil(
voltages: ArrayLike,
vpil_V_cm: ArrayLike,
*,
wavelength_nm: float,
reference_voltage: float = 0.0
) -> VoltageFunction
Integrate a small-signal VπL table into delta_neff(v).
vpil_V_cm is the small-signal VπL in V·cm at each junction voltage v = V_anode - V_cathode (negative for reverse bias), measured at wavelength_nm. The slope magnitude is |dn_eff/dV| = λ / (2·VπL). Its sign follows plasma dispersion in a depletion-mode junction: reverse bias removes carriers, so n_eff increases as v decreases.
The slope is interpolated linearly between samples and integrated exactly, so delta_neff has a continuous derivative inside the table and extrapolates with the end slopes. delta_neff(reference_voltage) = 0; the factory's neff is therefore the effective index at that voltage.
Source code in circulax/components/phase_shifter.py
depletion_charge ¤
depletion_charge(
v: Any,
cj0_F_per_m: float = 3e-10,
vbi: float = 0.9,
grading: float = 0.5,
fc: float = 0.5,
) -> Any
Depletion charge per metre with SPICE forward-bias linearisation.
C(v) = cj0 / (1 - v/vbi)**grading for v < fc*vbi. Above that the capacitance continues linearly (the standard SPICE FC treatment), so the charge and its derivative stay finite if the junction is driven forward during Newton iterations. charge(0) = 0.
Source code in circulax/components/phase_shifter.py
diode_current ¤
diode_current(
v: Any,
*,
is_A_per_m: float = 1e-08,
ideality: float = 1.0,
vt: float = 0.025852,
v_limit: float = 0.9,
dark_current_A_per_m: float = 0.0,
dark_bias_V: float = -1.0
) -> Any
Diode current per metre: Shockley equation plus a dark-current shunt.
I = is*(exp(v/(ideality*vt)) - 1) - dark_current * v / dark_bias_V. The second term is an ohmic leakage sized so that it carries dark_current_A_per_m at the reverse bias dark_bias_V (negative), in addition to the saturation current. The exponential is replaced by its tangent above v_limit so the current stays finite during Newton iterations.
Source code in circulax/components/phase_shifter.py
hybrid_laser_netlist ¤
hybrid_laser_netlist(
p: LaserParameters,
s: HybridSettings = DEFAULT_HYBRID_SETTINGS,
*,
segments: int = 4,
left_reflector: object = None,
right_reflector: object = None
) -> tuple[dict, dict]
Editable cavity netlist and model map, without drives or terminations.
Left output--SG_L--interface--gain cells--interface--phase--SG_R--right output. All gain diodes share anode/cathode. Reflector and phase heaters are separate electrical ports. Either reflector can be a compatible component or compiled Circuit with ports p1,p2,heater,heater_return, e.g. ring_reflector(). Its settings are then caller-owned; SG threshold helpers no longer apply. A replacement uses p1 facing the cavity and p2 facing the exterior. p.r_left/r_right belong to the older integrated model and are ignored; the separate reflector components own all reflection/transmission physics.
Source code in circulax/components/hybrid_laser.py
junction_model ¤
junction_model(
*,
current: VoltageFunction | float | None = None,
charge: VoltageFunction | None = None,
capacitance: VoltageFunction | float | None = None,
defaults: dict[str, float] | None = None
) -> JunctionModel
Build a junction model from functions of voltage, per metre of length.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current | VoltageFunction | float | None | DC current in A/m, anode to cathode, e.g. :func: | None |
charge | VoltageFunction | None | Stored charge in C/m, e.g. :func: | None |
capacitance | VoltageFunction | float | None | Alternative to | None |
defaults | dict[str, float] | None | Replacement defaults for keyword parameters of the functions. | None |
Functions take the junction voltage v = V_anode - V_cathode first and may declare keyword parameters with numeric defaults; those become runtime parameters wherever the model is used.
Source code in circulax/components/phase_shifter.py
mode_transmission_line ¤
mode_transmission_line(
frequencies: ArrayLike,
*,
attenuation_db_per_m: ArrayLike | Callable[[ndarray], ArrayLike],
n_eff: ArrayLike | Callable[[ndarray], ArrayLike],
impedance: ArrayLike | Callable[[ndarray], ArrayLike],
n_poles: int = 12,
poles: ArrayLike | None = None,
tolerance: float = 0.01
) -> RLGCTransmissionLine
Generate a passive RLC line factory from uniform-mode propagation data.
Each input may be a scalar, a sampled array, or a function of frequency in Hz returning either. attenuation_db_per_m is nonnegative loss in dB/metre. n_eff is the positive real RF phase effective index, not group index. impedance is the modal characteristic impedance in ohms and may be complex/frequency dependent, with positive real part.
Converts gamma = log(10)/20 * attenuation + 1j*2*pi*f*n_eff/c and Z'=gamma*impedance, Y'=gamma/impedance to per-metre RLGC. The generated model and all fit settings follow :func:rlgc_transmission_line. Loss, phase and impedance data must describe a mutually consistent mode; an independent choice of arbitrary curves need not admit this passive, causal Foster realization. Errors exceeding tolerance raise ValueError.
Group velocity is c/(n_eff + f*dn_eff/df). When designing a MZM, compare the RF phase index of the loaded electrode at each modulation frequency with the optical group index: the walk-off phase is 2*pi*f*L*(n_rf(f) - n_g_opt)/c. Avoid adding a junction R/C twice if it is already included in mode data. No additional loads are included by this factory.
Source code in circulax/components/transmission_line.py
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 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | |
phase_shifter_factory ¤
phase_shifter_factory(
*,
delta_neff: VoltageFunction | float,
loss_dB_cm: VoltageFunction | float = 0.0,
junction: JunctionModel | None = None,
name: str = "PhaseShifter"
) -> type[CircuitComponent]
Build an electro-optic phase shifter component from functions of voltage.
The optical inputs are functions of the voltage v = Re(V_anode - V_cathode) (or constants). Functions must be JAX-traceable and may declare extra keyword parameters with numeric defaults, for example def delta_neff(v, a1=1e-4, a2=1e-5): .... Those parameters, and the junction's, become runtime parameters of the returned component, shared by name, so they can be set in netlist settings, swept or fitted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delta_neff | VoltageFunction | float | Change in optical effective index, dimensionless. By convention it increases under reverse bias ( | required |
loss_dB_cm | VoltageFunction | float | Optical propagation loss in dB/cm. | 0.0 |
junction | JunctionModel | None | Electrical model from :func: | None |
name | str | Class name of the generated component. | 'PhaseShifter' |
Returns:
| Type | Description |
|---|---|
type[CircuitComponent] | A component class with ports |
type[CircuitComponent] | runtime parameters |
type[CircuitComponent] |
|
type[CircuitComponent] | keyword parameters of the supplied functions. |
Optical model: the section is a matched, reciprocal 1 Ω waveguide. Light takes length_um * n_group / c to cross it in either direction. The voltage-dependent transmission T(v) = 10**(-loss_dB_cm(v)*L_cm/20) * exp(-2j*pi*(neff + delta_neff(v))*L/λ) is applied at the section midpoint using the junction voltage half a transit earlier, which is when the light passed it. Model a long traveling-wave electrode as several short sections so the RF voltage is approximately uniform along each. Transient analysis reads each delay by interpolating accepted history; when the half-transit of a section is shorter than the time step, that error accumulates along a chain of sections, so check convergence by reducing the step.
Electrical model: the anode receives length * junction.current(v) and the junction stores length * junction.charge(v). Series resistance and electrode loading are external; connect them in the netlist.
Example, a depletion PN phase shifter from VπL and loss tables::
diode = pn_diode(cj0_F_per_m=3e-10, dark_current_A_per_m=1e-5)
diode.capacitance([-2.0, -1.0, 0.0]) # evaluate the junction alone
PN = phase_shifter_factory(
delta_neff=delta_neff_from_vpil(v_data, vpil_data, wavelength_nm=1310.0),
loss_dB_cm=tabulated(v_data, loss_data),
junction=diode,
)
# The diode parameters (cj0_F_per_m, vbi, ...) are settings of every "PN" instance.
Source code in circulax/components/phase_shifter.py
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 | |
pn_diode ¤
pn_diode(**defaults: float) -> JunctionModel
PN diode per metre: :func:diode_current plus :func:depletion_charge.
Keyword arguments replace parameter defaults, for example pn_diode(cj0_F_per_m=4e-10, vbi=0.8, dark_current_A_per_m=1e-5). Parameters: is_A_per_m, ideality, vt, v_limit, dark_current_A_per_m, dark_bias_V (negative), cj0_F_per_m, vbi, grading and fc.
Source code in circulax/components/phase_shifter.py
reduced_rlgc_transmission_line ¤
reduced_rlgc_transmission_line(
frequencies: ArrayLike,
*,
R: ArrayLike | Callable[[ndarray], ArrayLike],
L: ArrayLike | Callable[[ndarray], ArrayLike],
G: ArrayLike | Callable[[ndarray], ArrayLike],
C: ArrayLike | Callable[[ndarray], ArrayLike],
length: float,
z0: float = 50.0,
options: ModelFitOptions | None = None
) -> Circuit
Create a compact, transient-capable uniform line from RLGC versus Hz.
Fit the distributed two-port, rather than discretizing it into RLC sections. The default fit enforces sampled passivity; stable proper poles and nonnegative optional port delays make the realization causal. Invalid or insufficiently accurate fits raise instead of returning an unchecked model. Passivity is sampled, not globally certified; input causality is not certified.
Ports p1 and p2 are single-ended to ground. There are no internal taps: use :func:rlgc_transmission_line when distributed loading is needed. Fitting depends on length; refit for a different length. Use circulax.fitting.fit_rlgc to inspect, evaluate or save the coefficients. For electrically long lines, :func:characteristic_rlgc_transmission_line removes the propagation delay exactly and needs far fewer poles.
Source code in circulax/components/transmission_line.py
ring_reflector cached ¤
Ring drop port followed by a mirror: a replaceable spectral reflector.
Through/add ports are matched; drop sees a frequency-flat lossless mirror. p1 faces the cavity, p2 is the transmitted mirror output. This deliberately has a different spectrum and loss budget from a sampled Bragg reflector.
Source code in circulax/components/hybrid_laser.py
rlgc_transmission_line ¤
rlgc_transmission_line(
frequencies: ArrayLike,
*,
R: ArrayLike,
L: ArrayLike,
G: ArrayLike,
C: ArrayLike,
n_poles: int = 12,
poles: ArrayLike | None = None,
tolerance: float = 0.01
) -> RLGCTransmissionLine
Fit frequency-dependent RLGC per metre and return a line factory.
frequencies must be increasing, nonnegative Hz with a positive maximum. R, L, G, C are real nonnegative scalars or arrays on that grid, in ohm/m, H/m, S/m and F/m. The series impedance R+sL and shunt admittance G+sC are fitted independently; constant characteristic impedance is not assumed. Skin-effect responses can be approximated over a finite band, but not every passive response belongs to this branch family.
poles optionally supplies positive branch rates in rad/s. Otherwise n_poles logarithmically spaced rates are chosen. tolerance is the maximum weighted relative RMS fitting error for each response. The relative weighting has a floor of 1% of the maximum response magnitude. Excess error raises ValueError rather than returning a poor fit silently. Inspect series and shunt for coefficients and errors. Spatial discretization is separate: verify convergence as n_sections increases.
Example::
line = rlgc_transmission_line(f, R=r, L=l, G=g, C=c)
section = line(length=200e-6, n_sections=2)
# Use section as models_map["line"] in a parent circuit.
Fitting runs once in NumPy/SciPy. Generated Circulax component values are ordinary real RLC parameters; no S-to-state-space conversion is used.
Source code in circulax/components/transmission_line.py
sampled_bragg_grating cached ¤
sampled_bragg_grating(samples: int = 5) -> type[CircuitComponent]
Lossless thin-patch sampled-grating approximation with causal gap delays.
Identical zero-length Bragg patches have r=itanh(strength/samples), t=sech(strength/samples). Delayed gaps retain all multiple reflections. Peak power reflectance=tanh(strength)^2; comb FSR=c/(2n_g*spacing). Finite patch bandwidth/dispersion is omitted: qualify a finite wavelength window near the reference. Increasing samples changes the physical device; it is not numerical mesh refinement of the same grating.
Source code in circulax/components/laser_sections.py
tabulated ¤
Return a piecewise-linear function of voltage from a sampled table.
Use it for delta_neff, loss_dB_cm or a junction current when data is tabulated. Values are held constant outside the table. For a measured capacitance table use :func:charge_from_capacitance_table instead, which integrates exactly and keeps the capacitance continuous.