twpasolver.analysis.linear module#

Linear response of a TWPA: Bloch parameters per segment, stopbands, k*.

class twpasolver.analysis.linear.LinearData(freqs: ndarray, abcd: ndarray, S21: ndarray, S11: ndarray, stopbands: ndarray, k: ndarray, alpha: ndarray, Zb: ndarray, reflection_coeff: ndarray, k_star: ndarray, seg_bounds: ndarray, seg_N_tot: ndarray, seg_epsilon: ndarray, seg_xi: ndarray)[source]#

Bases: object

Linear response of a TWPA on the analysis frequency grid.

Frequencies are in the analysis unit. Per-segment arrays have shape (n_segments, n_freq); a uniform device is one segment.

Variables:
  • freqs (numpy.ndarray) – Frequency grid, shape (n_freq,).

  • abcd (numpy.ndarray) – ABCD matrices of the whole device, shape (n_freq, 2, 2).

  • S11 (S21,) – Scattering parameters of the whole device against twpa.Z0_ref.

  • stopbands (numpy.ndarray) – [start, end] of every stopband of the (first segment’s) lossless supercell in the grid, shape (n_bands, 2).

  • alpha (k,) – Bloch wavenumber and attenuation per unit cell.

  • Zb (numpy.ndarray) – Bloch impedance.

  • reflection_coeff (numpy.ndarray) – Reflection coefficient of Zb against twpa.Z0_ref.

  • k_star (numpy.ndarray) – Length-weighted mean k minus the linear part of a quadratic fit below a tenth of the first stopband (the bare k without stopband), shape (n_freq,).

  • seg_bounds (numpy.ndarray) – Segment boundaries in unit cells, shape (n_segments + 1,).

  • seg_N_tot (numpy.ndarray) – Unit cells per segment.

  • seg_xi (seg_epsilon,) – Nonlinearity coefficients per segment.

freqs: ndarray#
abcd: ndarray#
S21: ndarray#
S11: ndarray#
stopbands: ndarray#
k: ndarray#
alpha: ndarray#
Zb: ndarray#
reflection_coeff: ndarray#
k_star: ndarray#
seg_bounds: ndarray#
seg_N_tot: ndarray#
seg_epsilon: ndarray#
seg_xi: ndarray#
property S21_db: ndarray#

|S21| in dB.

property seg_midpoints: ndarray#

Segment midpoints in unit cells.

class twpasolver.analysis.linear.ParameterInterpolator(frequencies: ndarray, params: dict[str, numpy.ndarray])[source]#

Bases: object

Cubic-spline interpolation over frequency of 1-D (n_freq,) or 2-D (n, n_freq) arrays (row by row), real or complex; frequencies sorted.

interpolate(frequencies: Any) → dict[str, numpy.ndarray][source]#

Every parameter at frequencies; 2-D parameters give (n, len(frequencies)).

twpasolver.analysis.linear.is_segmented(twpa: TWPA) → bool[source]#

Whether twpa is a chain of TWPA segments.

twpasolver.analysis.linear.segments_of(twpa: TWPA) → list[twpasolver.models.twoportarrays.TWPA][source]#

Uniform segments of twpa; a uniform device is one segment.

twpasolver.analysis.linear.linear_data(twpa: TWPA, f: ndarray, unit_multiplier: float) → LinearData[source]#

Linear response of twpa on the grid f (Hz), reported in f / unit_multiplier.

twpasolver.analysis.linear.interpolator(lin: LinearData) → ParameterInterpolator[source]#

Spline of the per-segment k, gamma (reflection) and alpha.