twpasolver.models.twpa_cells module#

Models for TWPAS.

pydantic model twpasolver.models.twpa_cells.StubBaseCell[source]#

Bases: TwoPortModel

Base cell of the twpa stub-filter model: a centre line loaded by two open stubs.

line=True: lumped centre line split around the stubs, [L/2][stubs][L/2]. Each of the two open stubs is a distributed line of length l1 with inductance Lf and capacitance C per unit length (total per stub Lf*l1, C*l1; shunt admittance 2j tan(w sqrt(Lf C) l1) / sqrt(Lf/C)). Below the stub resonance this is the centered LCLfBaseCell with total capacitance 2 C l1 and finger inductance Lf l1 / 3 (same expansion to order w^3). qp_loss acts on the centre line, delta on the stub capacitance. Supported by the Bloch CMEs (the two halves of L are the nonlinear elements).

line=False (legacy): stubs and centre line share L and C per unit length, centre line lumped (L*l2) after the stubs; Lf and qp_loss are unused.

Show JSON schema
{
   "title": "StubBaseCell",
   "description": "Base cell of the twpa stub-filter model: a centre line loaded by two open stubs.\n\n``line=True``: lumped centre line split around the stubs, ``[L/2][stubs][L/2]``.\nEach of the two open stubs is a distributed line of length ``l1`` with inductance\n``Lf`` and capacitance ``C`` per unit length (total per stub ``Lf*l1``, ``C*l1``;\nshunt admittance ``2j tan(w sqrt(Lf C) l1) / sqrt(Lf/C)``). Below the stub resonance\nthis is the centered ``LCLfBaseCell`` with total capacitance ``2 C l1`` and finger\ninductance ``Lf l1 / 3`` (same expansion to order w^3). ``qp_loss`` acts on the centre\nline, ``delta`` on the stub capacitance. Supported by the Bloch CMEs (the two halves\nof ``L`` are the nonlinear elements).\n\n``line=False`` (legacy): stubs and centre line share ``L`` and ``C`` per unit length,\ncentre line lumped (``L*l2``) after the stubs; ``Lf`` and ``qp_loss`` are unused.",
   "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"
      },
      "name": {
         "const": "StubBaseCell",
         "default": "StubBaseCell",
         "title": "Name",
         "type": "string"
      },
      "L": {
         "description": "Inductance of the straight line.",
         "minimum": 0,
         "title": "L",
         "type": "number"
      },
      "C": {
         "description": "Capacitance per unit length of each stub.",
         "minimum": 0,
         "title": "C",
         "type": "number"
      },
      "Lf": {
         "description": "Inductance per unit length of each stub (line=True).",
         "minimum": 0,
         "title": "Lf",
         "type": "number"
      },
      "l1": {
         "default": 1,
         "description": "Length of the stub finger.",
         "minimum": 0,
         "title": "L1",
         "type": "number"
      },
      "l2": {
         "default": 1,
         "description": "Length of the straight line.",
         "minimum": 0,
         "title": "L2",
         "type": "number"
      },
      "qp_loss": {
         "default": 0,
         "description": "Quasiparticle-loss coefficient",
         "minimum": 0,
         "title": "Qp Loss",
         "type": "number"
      },
      "delta": {
         "default": 0,
         "description": "Loss Tangent",
         "minimum": 0,
         "title": "Delta",
         "type": "number"
      },
      "nl_scale": {
         "default": 1.0,
         "description": "Fraction of the line inductance L that is nonlinear: scales the nonlinear elements of the bloch CMEs (not the linear response, nor the simple model).",
         "minimum": 0,
         "title": "Nl Scale",
         "type": "number"
      },
      "line": {
         "default": false,
         "description": "Lumped centre line split around stubs with their own inductance Lf ([L/2][stubs][L/2]) instead of the legacy shared-L stub cell.",
         "title": "Line",
         "type": "boolean"
      }
   },
   "required": [
      "L",
      "C",
      "Lf"
   ]
}

Fields:
field name: Literal['StubBaseCell'] = 'StubBaseCell'#
field L: NonNegativeFloat [Required]#

Inductance of the straight line.

Constraints:
  • ge = 0

field C: NonNegativeFloat [Required]#

Capacitance per unit length of each stub.

Constraints:
  • ge = 0

field Lf: NonNegativeFloat [Required]#

Inductance per unit length of each stub (line=True).

Constraints:
  • ge = 0

field l1: NonNegativeFloat = 1#

Length of the stub finger.

Constraints:
  • ge = 0

field l2: NonNegativeFloat = 1#

Length of the straight line.

Constraints:
  • ge = 0

field qp_loss: NonNegativeFloat = 0#

Quasiparticle-loss coefficient

Constraints:
  • ge = 0

field delta: NonNegativeFloat = 0#

Loss Tangent

Constraints:
  • ge = 0

field nl_scale: NonNegativeFloat = 1.0#

Fraction of the line inductance L that is nonlinear: scales the nonlinear elements of the bloch CMEs (not the linear response, nor the simple model).

Constraints:
  • ge = 0

field line: bool = False#

Lumped centre line split around stubs with their own inductance Lf ([L/2][stubs][L/2]) instead of the legacy shared-L stub cell.

single_abcd(freqs: ndarray) → ABCDArray[source]#

Compute abcd matrix.

pydantic model twpasolver.models.twpa_cells.LCLfBaseCell[source]#

Bases: TwoPortModel

Base cell of twpa LC model.

Show JSON schema
{
   "title": "LCLfBaseCell",
   "description": "Base cell of twpa LC model.",
   "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"
      },
      "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"
      },
      "qp_loss": {
         "default": 0,
         "description": "Quasiparticle-loss coefficient",
         "minimum": 0,
         "title": "Qp Loss",
         "type": "number"
      },
      "nl_scale": {
         "default": 1.0,
         "description": "Fraction of the line inductance L that is nonlinear: scales the nonlinear elements of the bloch CMEs (not the linear response, nor the simple model).",
         "minimum": 0,
         "title": "Nl Scale",
         "type": "number"
      },
      "centered": {
         "default": false,
         "title": "Centered",
         "type": "boolean"
      }
   },
   "required": [
      "L",
      "C",
      "Lf"
   ]
}

Fields:
field name: Literal['LCLfBaseCell'] = 'LCLfBaseCell'#
field L: NonNegativeFloat [Required]#

Inductance of the straight line.

Constraints:
  • ge = 0

field C: NonNegativeFloat [Required]#

Capacitance of the stub finger.

Constraints:
  • ge = 0

field Lf: NonNegativeFloat [Required]#

Inductance of the stub finger.

Constraints:
  • ge = 0

field delta: NonNegativeFloat = 0#

Loss Tangent

Constraints:
  • ge = 0

field qp_loss: NonNegativeFloat = 0#

Quasiparticle-loss coefficient

Constraints:
  • ge = 0

field nl_scale: NonNegativeFloat = 1.0#

Fraction of the line inductance L that is nonlinear: scales the nonlinear elements of the bloch CMEs (not the linear response, nor the simple model).

Constraints:
  • ge = 0

field centered: bool = False#
single_abcd(freqs: ndarray) → ABCDArray[source]#

Compute abcd matrix.