twpasolver.models.twoportarrays module#

Generic models for user-defined abcd matrices and TwoPortModel lists.

This module provides a generic container class for arrays of TwoPortModels, allowing for the organization and manipulation of multiple two-port network models, including nested lists. It also includes specific models like TWPA for specialized applications.

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

Bases: ModelArray

Generic container for arrays of TwoPortModels.

Show JSON schema
{
   "$defs": {
      "Capacitance": {
         "description": "Model of a capacitor.",
         "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"
            },
            "twoport_parallel": {
               "default": false,
               "description": "Insert component in parallel when transforming to twoport representation.",
               "title": "Twoport Parallel",
               "type": "boolean"
            },
            "name": {
               "const": "Capacitance",
               "default": "Capacitance",
               "title": "Name",
               "type": "string"
            },
            "C": {
               "minimum": 0,
               "title": "C",
               "type": "number"
            }
         },
         "required": [
            "C"
         ],
         "title": "Capacitance",
         "type": "object"
      },
      "Inductance": {
         "description": "Model of an inductor.",
         "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"
            },
            "twoport_parallel": {
               "default": false,
               "description": "Insert component in parallel when transforming to twoport representation.",
               "title": "Twoport Parallel",
               "type": "boolean"
            },
            "name": {
               "const": "Inductance",
               "default": "Inductance",
               "title": "Name",
               "type": "string"
            },
            "L": {
               "minimum": 0,
               "title": "L",
               "type": "number"
            }
         },
         "required": [
            "L"
         ],
         "title": "Inductance",
         "type": "object"
      },
      "LCLfBaseCell": {
         "description": "Base cell of twpa LC model.",
         "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"
            },
            "name": {
               "const": "LCLfBaseCell",
               "default": "LCLfBaseCell",
               "title": "Name",
               "type": "string"
            },
            "L": {
               "description": "Inductance of the straight line.",
               "minimum": 0,
               "title": "L",
               "type": "number"
            },
            "C": {
               "description": "Capacitance of the stub finger.",
               "minimum": 0,
               "title": "C",
               "type": "number"
            },
            "Lf": {
               "description": "Inductance of the stub finger.",
               "minimum": 0,
               "title": "Lf",
               "type": "number"
            },
            "delta": {
               "default": 0,
               "description": "Loss Tangent",
               "minimum": 0,
               "title": "Delta",
               "type": "number"
            },
            "centered": {
               "default": false,
               "title": "Centered",
               "type": "boolean"
            }
         },
         "required": [
            "L",
            "C",
            "Lf"
         ],
         "title": "LCLfBaseCell",
         "type": "object"
      },
      "LosslessTL": {
         "description": "Model for a lossless transmission line.",
         "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"
            },
            "name": {
               "const": "LosslessTL",
               "default": "LosslessTL",
               "title": "Name",
               "type": "string"
            },
            "l": {
               "description": "Length of the line.",
               "minimum": 0,
               "title": "L",
               "type": "number"
            },
            "L": {
               "description": "Characteristic inductance of the line.",
               "minimum": 0,
               "title": "L",
               "type": "number"
            },
            "C": {
               "description": "Characteristic capacitance of the line.",
               "minimum": 0,
               "title": "C",
               "type": "number"
            }
         },
         "required": [
            "l",
            "L",
            "C"
         ],
         "title": "LosslessTL",
         "type": "object"
      },
      "OnePortArray": {
         "description": "Container for direct compositions of OnePortModels.",
         "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 OnePortModel representing the basic cells. Nested cells are allowed.",
               "items": {
                  "discriminator": {
                     "mapping": {
                        "Capacitance": "#/$defs/Capacitance",
                        "Inductance": "#/$defs/Inductance",
                        "OnePortArray": "#/$defs/OnePortArray",
                        "Resistance": "#/$defs/Resistance",
                        "Stub": "#/$defs/Stub"
                     },
                     "propertyName": "name"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/Resistance"
                     },
                     {
                        "$ref": "#/$defs/Inductance"
                     },
                     {
                        "$ref": "#/$defs/Capacitance"
                     },
                     {
                        "$ref": "#/$defs/Stub"
                     },
                     {
                        "$ref": "#/$defs/OnePortArray"
                     }
                  ]
               },
               "title": "Cells",
               "type": "array"
            },
            "twoport_parallel": {
               "default": false,
               "description": "Insert component in parallel when transforming to twoport representation.",
               "title": "Twoport Parallel",
               "type": "boolean"
            },
            "name": {
               "const": "OnePortArray",
               "default": "OnePortArray",
               "title": "Name",
               "type": "string"
            },
            "parallel": {
               "default": false,
               "description": "Connect internal OnePortModels in parallel.",
               "title": "Parallel",
               "type": "boolean"
            }
         },
         "title": "OnePortArray",
         "type": "object"
      },
      "Resistance": {
         "description": "Model of a resistor.",
         "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"
            },
            "twoport_parallel": {
               "default": false,
               "description": "Insert component in parallel when transforming to twoport representation.",
               "title": "Twoport Parallel",
               "type": "boolean"
            },
            "name": {
               "const": "Resistance",
               "default": "Resistance",
               "title": "Name",
               "type": "string"
            },
            "R": {
               "minimum": 0,
               "title": "R",
               "type": "number"
            }
         },
         "required": [
            "R"
         ],
         "title": "Resistance",
         "type": "object"
      },
      "Stub": {
         "description": "Model of a stub.",
         "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"
            },
            "twoport_parallel": {
               "default": false,
               "description": "Insert component in parallel when transforming to twoport representation.",
               "title": "Twoport Parallel",
               "type": "boolean"
            },
            "name": {
               "const": "Stub",
               "default": "Stub",
               "title": "Name",
               "type": "string"
            },
            "L": {
               "minimum": 0,
               "title": "L",
               "type": "number"
            },
            "C": {
               "minimum": 0,
               "title": "C",
               "type": "number"
            },
            "length": {
               "minimum": 0,
               "title": "Length",
               "type": "number"
            },
            "open": {
               "default": true,
               "title": "Open",
               "type": "boolean"
            }
         },
         "required": [
            "L",
            "C",
            "length"
         ],
         "title": "Stub",
         "type": "object"
      },
      "StubBaseCell": {
         "description": "Base cell of twpa stub filter model.",
         "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"
            },
            "name": {
               "const": "StubBaseCell2",
               "default": "StubBaseCell2",
               "title": "Name",
               "type": "string"
            },
            "L": {
               "description": "Inductance of the straight line.",
               "minimum": 0,
               "title": "L",
               "type": "number"
            },
            "C": {
               "description": "Capacitance of the line.",
               "minimum": 0,
               "title": "C",
               "type": "number"
            },
            "Lf": {
               "description": "Inductance of the stub finger.",
               "minimum": 0,
               "title": "Lf",
               "type": "number"
            },
            "l1": {
               "description": "Length of the stub finger.",
               "minimum": 0,
               "title": "L1",
               "type": "number"
            },
            "l2": {
               "description": "Length of the straight line.",
               "minimum": 0,
               "title": "L2",
               "type": "number"
            },
            "delta": {
               "default": 0,
               "description": "Loss Tangent",
               "minimum": 0,
               "title": "Delta",
               "type": "number"
            },
            "line": {
               "default": false,
               "description": "Model line as distributed element instead of lumped inductance.",
               "title": "Line",
               "type": "boolean"
            }
         },
         "required": [
            "L",
            "C",
            "Lf",
            "l1",
            "l2"
         ],
         "title": "StubBaseCell",
         "type": "object"
      },
      "TWPA": {
         "description": "Simple model for TWPAs.",
         "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": {
                  "discriminator": {
                     "mapping": {
                        "Capacitance": "#/$defs/Capacitance",
                        "Inductance": "#/$defs/Inductance",
                        "LCLfBaseCell": "#/$defs/LCLfBaseCell",
                        "LosslessTL": "#/$defs/LosslessTL",
                        "OnePortArray": "#/$defs/OnePortArray",
                        "Resistance": "#/$defs/Resistance",
                        "Stub": "#/$defs/Stub",
                        "StubBaseCell2": "#/$defs/StubBaseCell",
                        "TWPA": "#/$defs/TWPA",
                        "TwoPortArray": "#/$defs/TwoPortArray"
                     },
                     "propertyName": "name"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/LosslessTL"
                     },
                     {
                        "$ref": "#/$defs/StubBaseCell"
                     },
                     {
                        "$ref": "#/$defs/LCLfBaseCell"
                     },
                     {
                        "$ref": "#/$defs/OnePortArray"
                     },
                     {
                        "$ref": "#/$defs/TwoPortArray"
                     },
                     {
                        "$ref": "#/$defs/TWPA"
                     },
                     {
                        "$ref": "#/$defs/Resistance"
                     },
                     {
                        "$ref": "#/$defs/Capacitance"
                     },
                     {
                        "$ref": "#/$defs/Inductance"
                     },
                     {
                        "$ref": "#/$defs/Stub"
                     }
                  ]
               },
               "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"
            },
            "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"
            }
         },
         "title": "TWPA",
         "type": "object"
      },
      "TwoPortArray": {
         "description": "Generic container for arrays of TwoPortModels.",
         "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": {
                  "discriminator": {
                     "mapping": {
                        "Capacitance": "#/$defs/Capacitance",
                        "Inductance": "#/$defs/Inductance",
                        "LCLfBaseCell": "#/$defs/LCLfBaseCell",
                        "LosslessTL": "#/$defs/LosslessTL",
                        "OnePortArray": "#/$defs/OnePortArray",
                        "Resistance": "#/$defs/Resistance",
                        "Stub": "#/$defs/Stub",
                        "StubBaseCell2": "#/$defs/StubBaseCell",
                        "TWPA": "#/$defs/TWPA",
                        "TwoPortArray": "#/$defs/TwoPortArray"
                     },
                     "propertyName": "name"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/LosslessTL"
                     },
                     {
                        "$ref": "#/$defs/StubBaseCell"
                     },
                     {
                        "$ref": "#/$defs/LCLfBaseCell"
                     },
                     {
                        "$ref": "#/$defs/OnePortArray"
                     },
                     {
                        "$ref": "#/$defs/TwoPortArray"
                     },
                     {
                        "$ref": "#/$defs/TWPA"
                     },
                     {
                        "$ref": "#/$defs/Resistance"
                     },
                     {
                        "$ref": "#/$defs/Capacitance"
                     },
                     {
                        "$ref": "#/$defs/Inductance"
                     },
                     {
                        "$ref": "#/$defs/Stub"
                     }
                  ]
               },
               "title": "Cells",
               "type": "array"
            },
            "name": {
               "const": "TwoPortArray",
               "default": "TwoPortArray",
               "title": "Name",
               "type": "string"
            }
         },
         "title": "TwoPortArray",
         "type": "object"
      }
   },
   "$ref": "#/$defs/TwoPortArray"
}

Fields:
Validators:
field name: Literal['TwoPortArray'] = 'TwoPortArray'#
field cells: list[AnyModel] [Optional]#

List of TwoPortModels representing the basic cells. Nested lists are allowed.

Validated by:
single_abcd(freqs: ndarray) ABCDArray[source]#

Compute abcd of combined models.

Parameters:

freqs (np.ndarray) – Array of frequencies.

Returns:

The combined ABCD matrix of the models.

Return type:

ABCDArray

property N_tot: int#

Total number of base cells in the model.

Returns:

The total number of base cells.

Return type:

NonNegativeInt

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

Bases: TwoPortArray

Simple model for TWPAs.

Show JSON schema
{
   "$defs": {
      "Capacitance": {
         "description": "Model of a capacitor.",
         "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"
            },
            "twoport_parallel": {
               "default": false,
               "description": "Insert component in parallel when transforming to twoport representation.",
               "title": "Twoport Parallel",
               "type": "boolean"
            },
            "name": {
               "const": "Capacitance",
               "default": "Capacitance",
               "title": "Name",
               "type": "string"
            },
            "C": {
               "minimum": 0,
               "title": "C",
               "type": "number"
            }
         },
         "required": [
            "C"
         ],
         "title": "Capacitance",
         "type": "object"
      },
      "Inductance": {
         "description": "Model of an inductor.",
         "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"
            },
            "twoport_parallel": {
               "default": false,
               "description": "Insert component in parallel when transforming to twoport representation.",
               "title": "Twoport Parallel",
               "type": "boolean"
            },
            "name": {
               "const": "Inductance",
               "default": "Inductance",
               "title": "Name",
               "type": "string"
            },
            "L": {
               "minimum": 0,
               "title": "L",
               "type": "number"
            }
         },
         "required": [
            "L"
         ],
         "title": "Inductance",
         "type": "object"
      },
      "LCLfBaseCell": {
         "description": "Base cell of twpa LC model.",
         "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"
            },
            "name": {
               "const": "LCLfBaseCell",
               "default": "LCLfBaseCell",
               "title": "Name",
               "type": "string"
            },
            "L": {
               "description": "Inductance of the straight line.",
               "minimum": 0,
               "title": "L",
               "type": "number"
            },
            "C": {
               "description": "Capacitance of the stub finger.",
               "minimum": 0,
               "title": "C",
               "type": "number"
            },
            "Lf": {
               "description": "Inductance of the stub finger.",
               "minimum": 0,
               "title": "Lf",
               "type": "number"
            },
            "delta": {
               "default": 0,
               "description": "Loss Tangent",
               "minimum": 0,
               "title": "Delta",
               "type": "number"
            },
            "centered": {
               "default": false,
               "title": "Centered",
               "type": "boolean"
            }
         },
         "required": [
            "L",
            "C",
            "Lf"
         ],
         "title": "LCLfBaseCell",
         "type": "object"
      },
      "LosslessTL": {
         "description": "Model for a lossless transmission line.",
         "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"
            },
            "name": {
               "const": "LosslessTL",
               "default": "LosslessTL",
               "title": "Name",
               "type": "string"
            },
            "l": {
               "description": "Length of the line.",
               "minimum": 0,
               "title": "L",
               "type": "number"
            },
            "L": {
               "description": "Characteristic inductance of the line.",
               "minimum": 0,
               "title": "L",
               "type": "number"
            },
            "C": {
               "description": "Characteristic capacitance of the line.",
               "minimum": 0,
               "title": "C",
               "type": "number"
            }
         },
         "required": [
            "l",
            "L",
            "C"
         ],
         "title": "LosslessTL",
         "type": "object"
      },
      "OnePortArray": {
         "description": "Container for direct compositions of OnePortModels.",
         "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 OnePortModel representing the basic cells. Nested cells are allowed.",
               "items": {
                  "discriminator": {
                     "mapping": {
                        "Capacitance": "#/$defs/Capacitance",
                        "Inductance": "#/$defs/Inductance",
                        "OnePortArray": "#/$defs/OnePortArray",
                        "Resistance": "#/$defs/Resistance",
                        "Stub": "#/$defs/Stub"
                     },
                     "propertyName": "name"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/Resistance"
                     },
                     {
                        "$ref": "#/$defs/Inductance"
                     },
                     {
                        "$ref": "#/$defs/Capacitance"
                     },
                     {
                        "$ref": "#/$defs/Stub"
                     },
                     {
                        "$ref": "#/$defs/OnePortArray"
                     }
                  ]
               },
               "title": "Cells",
               "type": "array"
            },
            "twoport_parallel": {
               "default": false,
               "description": "Insert component in parallel when transforming to twoport representation.",
               "title": "Twoport Parallel",
               "type": "boolean"
            },
            "name": {
               "const": "OnePortArray",
               "default": "OnePortArray",
               "title": "Name",
               "type": "string"
            },
            "parallel": {
               "default": false,
               "description": "Connect internal OnePortModels in parallel.",
               "title": "Parallel",
               "type": "boolean"
            }
         },
         "title": "OnePortArray",
         "type": "object"
      },
      "Resistance": {
         "description": "Model of a resistor.",
         "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"
            },
            "twoport_parallel": {
               "default": false,
               "description": "Insert component in parallel when transforming to twoport representation.",
               "title": "Twoport Parallel",
               "type": "boolean"
            },
            "name": {
               "const": "Resistance",
               "default": "Resistance",
               "title": "Name",
               "type": "string"
            },
            "R": {
               "minimum": 0,
               "title": "R",
               "type": "number"
            }
         },
         "required": [
            "R"
         ],
         "title": "Resistance",
         "type": "object"
      },
      "Stub": {
         "description": "Model of a stub.",
         "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"
            },
            "twoport_parallel": {
               "default": false,
               "description": "Insert component in parallel when transforming to twoport representation.",
               "title": "Twoport Parallel",
               "type": "boolean"
            },
            "name": {
               "const": "Stub",
               "default": "Stub",
               "title": "Name",
               "type": "string"
            },
            "L": {
               "minimum": 0,
               "title": "L",
               "type": "number"
            },
            "C": {
               "minimum": 0,
               "title": "C",
               "type": "number"
            },
            "length": {
               "minimum": 0,
               "title": "Length",
               "type": "number"
            },
            "open": {
               "default": true,
               "title": "Open",
               "type": "boolean"
            }
         },
         "required": [
            "L",
            "C",
            "length"
         ],
         "title": "Stub",
         "type": "object"
      },
      "StubBaseCell": {
         "description": "Base cell of twpa stub filter model.",
         "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"
            },
            "name": {
               "const": "StubBaseCell2",
               "default": "StubBaseCell2",
               "title": "Name",
               "type": "string"
            },
            "L": {
               "description": "Inductance of the straight line.",
               "minimum": 0,
               "title": "L",
               "type": "number"
            },
            "C": {
               "description": "Capacitance of the line.",
               "minimum": 0,
               "title": "C",
               "type": "number"
            },
            "Lf": {
               "description": "Inductance of the stub finger.",
               "minimum": 0,
               "title": "Lf",
               "type": "number"
            },
            "l1": {
               "description": "Length of the stub finger.",
               "minimum": 0,
               "title": "L1",
               "type": "number"
            },
            "l2": {
               "description": "Length of the straight line.",
               "minimum": 0,
               "title": "L2",
               "type": "number"
            },
            "delta": {
               "default": 0,
               "description": "Loss Tangent",
               "minimum": 0,
               "title": "Delta",
               "type": "number"
            },
            "line": {
               "default": false,
               "description": "Model line as distributed element instead of lumped inductance.",
               "title": "Line",
               "type": "boolean"
            }
         },
         "required": [
            "L",
            "C",
            "Lf",
            "l1",
            "l2"
         ],
         "title": "StubBaseCell",
         "type": "object"
      },
      "TWPA": {
         "description": "Simple model for TWPAs.",
         "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": {
                  "discriminator": {
                     "mapping": {
                        "Capacitance": "#/$defs/Capacitance",
                        "Inductance": "#/$defs/Inductance",
                        "LCLfBaseCell": "#/$defs/LCLfBaseCell",
                        "LosslessTL": "#/$defs/LosslessTL",
                        "OnePortArray": "#/$defs/OnePortArray",
                        "Resistance": "#/$defs/Resistance",
                        "Stub": "#/$defs/Stub",
                        "StubBaseCell2": "#/$defs/StubBaseCell",
                        "TWPA": "#/$defs/TWPA",
                        "TwoPortArray": "#/$defs/TwoPortArray"
                     },
                     "propertyName": "name"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/LosslessTL"
                     },
                     {
                        "$ref": "#/$defs/StubBaseCell"
                     },
                     {
                        "$ref": "#/$defs/LCLfBaseCell"
                     },
                     {
                        "$ref": "#/$defs/OnePortArray"
                     },
                     {
                        "$ref": "#/$defs/TwoPortArray"
                     },
                     {
                        "$ref": "#/$defs/TWPA"
                     },
                     {
                        "$ref": "#/$defs/Resistance"
                     },
                     {
                        "$ref": "#/$defs/Capacitance"
                     },
                     {
                        "$ref": "#/$defs/Inductance"
                     },
                     {
                        "$ref": "#/$defs/Stub"
                     }
                  ]
               },
               "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"
            },
            "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"
            }
         },
         "title": "TWPA",
         "type": "object"
      },
      "TwoPortArray": {
         "description": "Generic container for arrays of TwoPortModels.",
         "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": {
                  "discriminator": {
                     "mapping": {
                        "Capacitance": "#/$defs/Capacitance",
                        "Inductance": "#/$defs/Inductance",
                        "LCLfBaseCell": "#/$defs/LCLfBaseCell",
                        "LosslessTL": "#/$defs/LosslessTL",
                        "OnePortArray": "#/$defs/OnePortArray",
                        "Resistance": "#/$defs/Resistance",
                        "Stub": "#/$defs/Stub",
                        "StubBaseCell2": "#/$defs/StubBaseCell",
                        "TWPA": "#/$defs/TWPA",
                        "TwoPortArray": "#/$defs/TwoPortArray"
                     },
                     "propertyName": "name"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/LosslessTL"
                     },
                     {
                        "$ref": "#/$defs/StubBaseCell"
                     },
                     {
                        "$ref": "#/$defs/LCLfBaseCell"
                     },
                     {
                        "$ref": "#/$defs/OnePortArray"
                     },
                     {
                        "$ref": "#/$defs/TwoPortArray"
                     },
                     {
                        "$ref": "#/$defs/TWPA"
                     },
                     {
                        "$ref": "#/$defs/Resistance"
                     },
                     {
                        "$ref": "#/$defs/Capacitance"
                     },
                     {
                        "$ref": "#/$defs/Inductance"
                     },
                     {
                        "$ref": "#/$defs/Stub"
                     }
                  ]
               },
               "title": "Cells",
               "type": "array"
            },
            "name": {
               "const": "TwoPortArray",
               "default": "TwoPortArray",
               "title": "Name",
               "type": "string"
            }
         },
         "title": "TwoPortArray",
         "type": "object"
      }
   },
   "$ref": "#/$defs/TWPA"
}

Fields:
Validators:

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

Nonlinearity scale current parameter.

Constraints:
  • ge = 0

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.

Returns:

The epsilon value.

Return type:

NonNegativeFloat

property xi: float#

Coefficient of second-order term in inductance.

Returns:

The xi value.

Return type:

NonNegativeFloat

property chi: float#

Coefficient for second term of phase matching relation.

Returns:

The chi value.

Return type:

NonNegativeFloat

property alpha: float#

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

Returns:

The alpha value.

Return type:

NonNegativeFloat

property Iratio: float#

Ratio between bias and nonlinearity current parameter.

Returns:

The Iratio value.

Return type:

NonNegativeFloat