twpasolver.models.twoportarrays module#

Arrays of TwoPortModels, including nested lists, and the TWPA model.

pydantic model twpasolver.models.twoportarrays.TwoPortArray[source]#

Bases: ModelArray

Generic container for arrays of TwoPortModels.

Show JSON schema
{
   "title": "TwoPortArray",
   "description": "Generic container for arrays of TwoPortModels.",
   "type": "object",
   "properties": {
      "Z0_ref": {
         "default": 50.0,
         "description": "Reference line impedance of the two-port component.",
         "title": "Z0 Ref",
         "type": "number"
      },
      "N": {
         "default": 1,
         "description": "Number of repetitions of the model in the computed abcd matrix.",
         "minimum": 0,
         "title": "N",
         "type": "integer"
      },
      "cells": {
         "description": "List of TwoPortModels representing the basic cells. Nested lists are allowed.",
         "items": {},
         "title": "Cells",
         "type": "array"
      },
      "name": {
         "const": "TwoPortArray",
         "default": "TwoPortArray",
         "title": "Name",
         "type": "string"
      }
   }
}

Fields:
Validators:

field name: Literal['TwoPortArray'] = 'TwoPortArray'#
single_abcd(freqs: ndarray) → ABCDArray[source]#

Cascade the ABCD matrices of the cells.

property N_tot: int#

Total number of base cells, counting nested arrays and repetitions N.

pydantic model twpasolver.models.twoportarrays.TWPA[source]#

Bases: TwoPortArray

Simple model for TWPAs.

Show JSON schema
{
   "title": "TWPA",
   "description": "Simple model for TWPAs.",
   "type": "object",
   "properties": {
      "Z0_ref": {
         "default": 50.0,
         "description": "Reference line impedance of the two-port component.",
         "title": "Z0 Ref",
         "type": "number"
      },
      "N": {
         "default": 1,
         "description": "Number of repetitions of the model in the computed abcd matrix.",
         "minimum": 0,
         "title": "N",
         "type": "integer"
      },
      "cells": {
         "description": "List of TwoPortModels representing the basic cells. Nested lists are allowed.",
         "items": {},
         "title": "Cells",
         "type": "array"
      },
      "name": {
         "const": "TWPA",
         "default": "TWPA",
         "title": "Name",
         "type": "string"
      },
      "Istar": {
         "default": 0.0065,
         "description": "Nonlinearity scale current parameter.",
         "minimum": 0,
         "title": "Istar",
         "type": "number"
      },
      "Istar2": {
         "anyOf": [
            {
               "minimum": 0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Second order scaling current parameter.",
         "title": "Istar2"
      },
      "Idc": {
         "default": 0.001,
         "description": "Bias dc current.",
         "minimum": 0,
         "title": "Idc",
         "type": "number"
      },
      "Ip0": {
         "default": 0.0002,
         "description": "Rf pump amplitude.",
         "minimum": 0,
         "title": "Ip0",
         "type": "number"
      }
   }
}

Fields:
Validators:

field name: Literal['TWPA'] = 'TWPA'#
field Istar: NonNegativeFloat = 0.0065#

Nonlinearity scale current parameter.

Constraints:
  • ge = 0

field Istar2: NonNegativeFloat | None = None#

Second order scaling current parameter.

field Idc: NonNegativeFloat = 0.001#

Bias dc current.

Constraints:
  • ge = 0

field Ip0: NonNegativeFloat = 0.0002#

Rf pump amplitude.

Constraints:
  • ge = 0

property epsilon: float#

Coefficient of first-order term in inductance.

With L(I) = Lk (1 + (I/Istar)^2 + (I/Istar2)^4) and I = Idc + i, L = L(Idc) (1 + epsilon i + xi i^2 + O(i^3)).

property xi: float#

Coefficient of second-order term in inductance (see epsilon).

property chi: float#

Coefficient for second term of phase matching relation.

property alpha: float#

Second-order correction term for inductance as function of dc current.

property Iratio: float#

Ratio Idc / Istar between bias and nonlinearity current.