phase_shifter ¤
Electro-optic phase shifters built from designer-supplied physics.
:func:phase_shifter_factory turns functions of junction voltage into a four-port component with electrical ports anode/cathode and optical ports o1/o2. The optical path has a native, bidirectional group delay, so the same component serves DC operating points and transient simulation, including traveling-wave modulators built from repeated sections. Compile circuits that contain it with is_complex=True. The junction voltage is taken as a real part, so the component is not holomorphic. Use Circuit.small_signal() for its quadrature and optical-power response; the legacy ac_response() interface excludes this mixed optical model.
The electrical junction is a separate :class:JunctionModel, built with :func:pn_diode or :func:junction_model, which can be evaluated on its own (I-V, C-V) before it is passed to the phase shifter. The helpers in this module convert typical extracted data (VπL and C(V) tables, depletion and diode parameters) into functions of voltage. Any keyword arguments of a supplied function become runtime component parameters that can be swept with circuit.dc(params=...) or differentiated with JAX.
Units follow :mod:circulax.components.photonic: wavelengths in nm, device length in µm and optical loss in dB/cm. Electrical quantities are per metre of device length and carry their unit in the argument name.
Classes:
| Name | Description |
|---|---|
JunctionModel | Electrical junction model per metre of length, usable on its own. |
Functions:
| Name | Description |
|---|---|
charge_from_capacitance_table | Integrate a C(V) table, in F/m, into a junction charge function in C/m. |
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. |
junction_model | Build a junction model from functions of voltage, per metre of length. |
phase_shifter_factory | Build an electro-optic phase shifter component from functions of voltage. |
pn_diode | PN diode per metre: :func: |
tabulated | Return a piecewise-linear function of voltage from a sampled table. |
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
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
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
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
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
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.