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 tonesExact 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 supportModeSet: Modes, frequency relations and RWA termsGainResult,PhaseMatchingResult: analysis resultsTWPA: Nonlinear TWPA model with circuit compositionABCDArray: Optimized 2x2 matrix arraysTwoPortCell: 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#
- twpasolver.analysis package
- twpasolver.cmes package
- twpasolver.models package
Submodules#
- twpasolver.basemodel module
- twpasolver.bonus_types module
- twpasolver.file_utils module
- twpasolver.logger module
- twpasolver.mathutils module
- twpasolver.matrices_arrays module
- twpasolver.modes_rwa module
- twpasolver.plotting module
- twpasolver.twoport module