twpasolver package#

Twpasolver: TWPA Analysis and Simulation Library#

twpasolver is a Python library for analyzing and simulating Traveling Wave Parametric Amplifiers (TWPAs) by solving systems of Coupled Mode Equations (CMEs).

This release simulates kinetic-inductance TWPAs (KI-TWPAs): the cells of the line can be any linear circuit, but the only nonlinearity is that of a kinetic inductance. Josephson-junction and SNAIL TWPAs are not supported yet.

Key Features#

Extended CME Systems:
  • Solve CMEs with arbitrary numbers of modes beyond pump-signal-idler

  • Automatic inclusion of pump harmonics and frequency conversion terms

  • Support for 3-wave mixing (3WM) and 4-wave mixing (4WM) processes

  • Rotating Wave Approximation (RWA) term selection

Mode Management:
  • ModeSet: modes and frequency relations, any number of independent tones

  • Exact RWA term selection on integer frequency vectors

Performance:
  • Numba-accelerated parallel CME solvers

  • Vectorised 2x2 ABCD matrix arrays

Gain Models:
  • SIMPLE: Traditional coupled mode equations of a homogeneous line, forward waves only (fast, approximate couplings)

  • BLOCH: Forward-backward coupled mode equations in the Bloch-mode basis (exact couplings, reflections, connectors, stopband edges, segmented devices)

Circuit Modeling:
  • Hierarchical composition of one-port and two-port network elements

  • Pre-built KI-TWPA cell models (lumped or distributed elements)

  • Custom circuit elements with automatic ABCD matrix computation

Analysis Tools:
  • Phase matching analysis with custom mode configurations

  • Gain and bandwidth calculations with pump depletion effects

  • Port-resolved gains (S21, S12, S11, S22) with connector models

  • Results that save to HDF5 and plot themselves

Core Classes#

  • TWPAnalysis: Main analysis engine with extended CME support

  • ModeSet: Modes, frequency relations and RWA terms

  • GainResult, PhaseMatchingResult: analysis results

  • TWPA: Nonlinear TWPA model with circuit composition

  • ABCDArray: Optimized 2x2 matrix arrays

  • TwoPortCell: Network parameter container with format conversion

Usage Examples#

See the Tutorials section for detailed examples from simple linear component analysis to complex multi-mode simulations with pump harmonics and frequency conversion processes.

Subpackages#

Submodules#