# Models

`qpdk.models` contains frequency-domain circuit models for the QPDK
components, built on [SAX](https://gdsfactory.github.io/sax/), together with
the analytical helpers used to design them. Install them with
`pip install qpdk[models]`.

### SAX models

Transmon, fluxonium, flipmon and unimon circuits, bare or coupled to a resonator.

19 functions

Quarter- and half-wave transmission-line resonators and their coupled variants.

5 functions

Straight and ring couplers between CPW lines.

2 functions

Interdigital and plate capacitors, meander inductors and lumped-element resonators.

4 functions

Single junctions and SQUIDs.

2 functions

Straights, bends, tapers, launchers, airbridges, bumps, TSVs, rectangles and generic N-port blocks.

18 functions

Opens, shorts, series and shunt elements and ideal LC resonators.

9 functions

1 function

### Helper functions

Effective permittivity, characteristic impedance and propagation of CPW and microstrip lines.

10 functions

Conversions between circuit energies, capacitances and inductances, and unimon spectra.

13 functions

Transmon frequency and anharmonicity, dispersive shifts, Purcell decay, linewidths and dephasing.

6 functions

Closed-form estimates for resonators, couplers and inductors.

3 functions

<a id="models-sax"></a>

## SAX models

Frequency-domain models returning S-parameter dictionaries (`sax.SDict`). Pass them to [`sax.circuit()`](https://gdsfactory.github.io/sax/api/#sax.circuit) to simulate netlists, or call them directly with a frequency array `f`.

<a id="models-qubits"></a>

### Qubits

Transmon, fluxonium, flipmon and unimon circuits, bare or coupled to a resonator.

| [`double_island_transmon`](#qpdk.models.double_island_transmon)                | LC resonator model for a double-island transmon qubit.                         |
|----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| [`double_island_transmon_with_bbox`](#qpdk.models.double_island_transmon_with_bbox)      | LC resonator model for a double-island transmon qubit with bounding box ports. |
| [`double_island_transmon_with_resonator`](#qpdk.models.double_island_transmon_with_resonator) | Model for a double-island transmon qubit coupled to a quarter-wave resonator.  |
| [`double_pad_transmon`](#qpdk.models.double_pad_transmon)                   | LC resonator model for a double-pad transmon qubit.                            |
| [`double_pad_transmon_with_bbox`](#qpdk.models.double_pad_transmon_with_bbox)         | LC resonator model for a double-island transmon qubit with bounding box ports. |
| [`double_pad_transmon_with_resonator`](#qpdk.models.double_pad_transmon_with_resonator)    | Model for a double-island transmon qubit coupled to a quarter-wave resonator.  |
| [`flipmon`](#qpdk.models.flipmon)                               | LC resonator model for a flipmon qubit.                                        |
| [`flipmon_with_bbox`](#qpdk.models.flipmon_with_bbox)                     | LC resonator model for a flipmon qubit with bounding box ports.                |
| [`flipmon_with_resonator`](#qpdk.models.flipmon_with_resonator)                | Model for a flipmon qubit coupled to a quarter-wave resonator.                 |
| [`fluxonium`](#qpdk.models.fluxonium)                             | S-parameter model for a fluxonium qubit.                                       |
| [`fluxonium_coupled`](#qpdk.models.fluxonium_coupled)                     | Coupled fluxonium qubit model.                                                 |
| [`fluxonium_with_bbox`](#qpdk.models.fluxonium_with_bbox)                   | S-parameter model for a fluxonium qubit with bounding box ports.               |
| [`fluxonium_with_resonator`](#qpdk.models.fluxonium_with_resonator)              | Model for a fluxonium qubit coupled to a quarter-wave resonator.               |
| [`qubit_with_resonator`](#qpdk.models.qubit_with_resonator)                  | Model for a transmon qubit coupled to a quarter-wave resonator.                |
| [`shunted_transmon`](#qpdk.models.shunted_transmon)                      | LC resonator model for a shunted transmon qubit.                               |
| [`transmon_coupled`](#qpdk.models.transmon_coupled)                      | Coupled transmon qubit model.                                                  |
| [`transmon_with_resonator`](#qpdk.models.transmon_with_resonator)               | Model for a transmon qubit coupled to a quarter-wave resonator.                |
| [`unimon_coupled`](#qpdk.models.unimon_coupled)                        | SAX model for a capacitively coupled unimon qubit.                             |
| [`xmon_transmon`](#qpdk.models.xmon_transmon)                         | LC resonator model for an Xmon style transmon qubit.                           |

#### double_island_transmon

### qpdk.models.double_island_transmon(f=5000000000.0, capacitance=1e-13, inductance=7e-09, ground_capacitance=0.0)

LC resonator model for a double-island transmon qubit.

A double-island transmon has two superconducting islands connected by
Josephson junctions, with both islands floating (not grounded). This is
modeled as an ungrounded parallel LC resonator.

The qubit frequency is approximately:

$$
f_\text{q} \approx \frac{1}{2\pi} \sqrt{8 E_\text{J} E_\text{C}} - E_\text{C}
$$

For the LC model, the resonance frequency is:

$$
f_\text{r} = \frac{1}{2\pi\sqrt{LC}}
$$

Use [`ec_to_capacitance()`](#qpdk.models.ec_to_capacitance) and [`ej_to_inductance()`](#qpdk.models.ej_to_inductance) to convert
from qubit Hamiltonian parameters.

![o1 ──┬──L──┬── o2
     │     │
     └──C──┘](_build/html/_images/svgbob-d2667306d552b5ac075ca1a2d075da455a500fa5.svg)![o1 ──┬──L──┬── o2
     │     │
     └──C──┘](_build/html/_images/svgbob-d2667306d552b5ac075ca1a2d075da455a500fa5_dark.svg)
* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **capacitance** (*FloatArrayLike*) – Total capacitance $C_\Sigma$ of the qubit in Farads.
  * **inductance** (*FloatArrayLike*) – Josephson inductance $L_\text{J}$ in Henries.
  * **ground_capacitance** (*FloatArrayLike*) – Parasitic capacitance to ground $C_\text{g}$ at each port in Farads.
* **Returns:**
  S-parameters dictionary with ports o1 and o2.
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/9b872a4640429f92dcd5b3ba20b6a5c8/models-1.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/887f7293ff05b7cfef3743f3e235cbbd/models-1.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/b1e67d3e32ce076933729ef45ec3030f/models-1.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/4c9fe6c8b0c14015eb921c27e6aac0a7/models-1.png))

![image](_build/html/plot_directive/models-1.svg)![image](_build/html/plot_directive/models-1_dark.svg)

#### double_island_transmon_with_bbox

### qpdk.models.double_island_transmon_with_bbox(f=5000000000.0, capacitance=1e-13, inductance=7e-09, ground_capacitance=0.0)

LC resonator model for a double-island transmon qubit with bounding box ports.

This model is the same as [`double_island_transmon()`](#qpdk.models.double_island_transmon).

* **Returns:**
  S-parameters dictionary.
* **Return type:**
  sax.SDict
* **Parameters:**
  * **f** (*FloatArrayLike*)
  * **capacitance** (*FloatArrayLike*)
  * **inductance** (*FloatArrayLike*)
  * **ground_capacitance** (*FloatArrayLike*)

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/c0167f5c6ac3c36406e02e49510b9470/models-2.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/e7eaeaadc32d614a897a24f8b99aa04a/models-2.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/8e71d5086ab791783fc91c981abad8c2/models-2.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/a5eca52023491bf15708887e66b1d456/models-2.png))

![image](_build/html/plot_directive/models-2.svg)![image](_build/html/plot_directive/models-2_dark.svg)

#### double_island_transmon_with_resonator

### qpdk.models.double_island_transmon_with_resonator(f=5000000000.0, qubit_capacitance=1e-13, qubit_inductance=1e-09, resonator_length=5000.0, resonator_cross_section='cpw', coupling_capacitance=1e-14)

Model for a double-island transmon qubit coupled to a quarter-wave resonator.

This model is identical to [`qubit_with_resonator()`](#qpdk.models.qubit_with_resonator) but the qubit is set to floating.

* **Returns:**
  S-parameters dictionary.
* **Return type:**
  sax.SDict
* **Parameters:**
  * **f** (*FloatArrayLike*)
  * **qubit_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **qubit_inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **resonator_length** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **resonator_cross_section** ([*str*](https://docs.python.org/3/builtins/stdtypes.html#str))
  * **coupling_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/68b57776348472a8ae9f64e5b2979140/models-3.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/0daa8c764f7958802e266b0c38798765/models-3.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/ad847e245b0f796381fe21ca31495505/models-3.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/12273e1e354f4e4ca795c80ee6aba777/models-3.png))

![image](_build/html/plot_directive/models-3.svg)![image](_build/html/plot_directive/models-3_dark.svg)

#### double_pad_transmon

### qpdk.models.double_pad_transmon(f=5000000000.0, capacitance=1e-13, inductance=7e-09, ground_capacitance=0.0)

LC resonator model for a double-pad transmon qubit.

Physically the [`double_island_transmon()`](#qpdk.models.double_island_transmon) model, with ports renamed to
`left_pad` and `right_pad` to match the layout cell ports.

* **Returns:**
  S-parameters dictionary with ports left_pad and right_pad.
* **Return type:**
  sax.SDict
* **Parameters:**
  * **f** (*FloatArrayLike*)
  * **capacitance** (*FloatArrayLike*)
  * **inductance** (*FloatArrayLike*)
  * **ground_capacitance** (*FloatArrayLike*)

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/85f8a9060973ebce217c4d664ef7d964/models-4.py))

#### double_pad_transmon_with_bbox

### qpdk.models.double_pad_transmon_with_bbox(f=5000000000.0, capacitance=1e-13, inductance=7e-09, ground_capacitance=0.0)

LC resonator model for a double-island transmon qubit with bounding box ports.

This model is the same as [`double_island_transmon()`](#qpdk.models.double_island_transmon).

* **Returns:**
  S-parameters dictionary.
* **Return type:**
  sax.SDict
* **Parameters:**
  * **f** (*FloatArrayLike*)
  * **capacitance** (*FloatArrayLike*)
  * **inductance** (*FloatArrayLike*)
  * **ground_capacitance** (*FloatArrayLike*)

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/975cbef4ecfd6bc26ec2aae9770bf887/models-5.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/3e88b98429e19e69f66de4a789a60fef/models-5.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/ea667e1156652258a2cc4b7289eeb23f/models-5.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/4dee21c51ed884e7bcbc2f6ca6ab3fe3/models-5.png))

![image](_build/html/plot_directive/models-5.svg)![image](_build/html/plot_directive/models-5_dark.svg)

#### double_pad_transmon_with_resonator

### qpdk.models.double_pad_transmon_with_resonator(f=5000000000.0, qubit_capacitance=1e-13, qubit_inductance=1e-09, resonator_length=5000.0, resonator_cross_section='cpw', coupling_capacitance=1e-14)

Model for a double-island transmon qubit coupled to a quarter-wave resonator.

This model is identical to [`qubit_with_resonator()`](#qpdk.models.qubit_with_resonator) but the qubit is set to floating.

* **Returns:**
  S-parameters dictionary.
* **Return type:**
  sax.SDict
* **Parameters:**
  * **f** (*FloatArrayLike*)
  * **qubit_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **qubit_inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **resonator_length** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **resonator_cross_section** ([*str*](https://docs.python.org/3/builtins/stdtypes.html#str))
  * **coupling_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/66191a47eed96b118a0b8888b445b3ea/models-6.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/00cd62629a58fe3a92872ff1332a8bb1/models-6.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/6538b42fc67cc54af2501b365696a9c0/models-6.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/300eb312fa85ee6acd7f691df73fe264/models-6.png))

![image](_build/html/plot_directive/models-6.svg)![image](_build/html/plot_directive/models-6_dark.svg)

#### flipmon

### qpdk.models.flipmon(f=5000000000.0, capacitance=1e-13, inductance=7e-09, ground_capacitance=0.0)

LC resonator model for a flipmon qubit.

This model is identical to [`double_island_transmon()`](#qpdk.models.double_island_transmon).

* **Returns:**
  S-parameters dictionary.
* **Return type:**
  sax.SDict
* **Parameters:**
  * **f** (*FloatArrayLike*)
  * **capacitance** (*FloatArrayLike*)
  * **inductance** (*FloatArrayLike*)
  * **ground_capacitance** (*FloatArrayLike*)

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/dd9e9c11d340d0717262fbca61990169/models-7.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/028596312845fe1a192d2f8ad4716e9f/models-7.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/e694846bf701ebd83b8742755d10a23d/models-7.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/fb490ad23967f86162e3749af5b1977a/models-7.png))

![image](_build/html/plot_directive/models-7.svg)![image](_build/html/plot_directive/models-7_dark.svg)

#### flipmon_with_bbox

### qpdk.models.flipmon_with_bbox(f=5000000000.0, capacitance=1e-13, inductance=7e-09, ground_capacitance=0.0)

LC resonator model for a flipmon qubit with bounding box ports.

This model is the same as [`flipmon()`](#qpdk.models.flipmon).

* **Returns:**
  S-parameters dictionary.
* **Return type:**
  sax.SDict
* **Parameters:**
  * **f** (*FloatArrayLike*)
  * **capacitance** (*FloatArrayLike*)
  * **inductance** (*FloatArrayLike*)
  * **ground_capacitance** (*FloatArrayLike*)

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/456a8377619bd3a8b4116e4687964af9/models-8.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/1f0b1cd151eb72cb5b89ba9deef9e793/models-8.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/c3b87fe99f4549e64ab44538595b6e98/models-8.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/e5d14f13ba4ae1f1d1277082312522e2/models-8.png))

![image](_build/html/plot_directive/models-8.svg)![image](_build/html/plot_directive/models-8_dark.svg)

#### flipmon_with_resonator

### qpdk.models.flipmon_with_resonator(f=5000000000.0, qubit_capacitance=1e-13, qubit_inductance=1e-09, resonator_length=5000.0, resonator_cross_section='cpw', coupling_capacitance=1e-14)

Model for a flipmon qubit coupled to a quarter-wave resonator.

This model is identical to [`qubit_with_resonator()`](#qpdk.models.qubit_with_resonator) but the qubit is set to floating.

* **Returns:**
  S-parameters dictionary.
* **Return type:**
  sax.SDict
* **Parameters:**
  * **f** (*FloatArrayLike*)
  * **qubit_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **qubit_inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **resonator_length** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **resonator_cross_section** ([*str*](https://docs.python.org/3/builtins/stdtypes.html#str))
  * **coupling_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/282d2ea157fead08a146cd6a1260bf03/models-9.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/e233584198ac0c82e2cab5a96a8c781d/models-9.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/358d755e81701343c5ab355e657ebb00/models-9.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/151461081207542dd9428a52ccdca1ce/models-9.png))

![image](_build/html/plot_directive/models-9.svg)![image](_build/html/plot_directive/models-9_dark.svg)

#### fluxonium

### qpdk.models.fluxonium(f=5000000000.0, capacitance=1e-14, josephson_inductance=1e-08, superinductance=5e-07, ground_capacitance=0.0)

S-parameter model for a fluxonium qubit.

A fluxonium qubit consists of a Josephson junction shunted by a large
superinductance and a capacitor. In the linear regime, this is modeled
as a parallel LCL circuit.

For an accurate microwave model reflecting the real physical layout,
the circuit is treated as ungrounded (floating) with optional symmetric
parasitic capacitances connecting both ends to ground [[NLS+19](#id78)].

![     ┌────── C ──────┐
o1 ──┼────── Lj ─────┼── o2
     ├────── Ls ─────┤
     │               │
    Cg              Cg
     │               │
    GND             GND](_build/html/_images/svgbob-3a7f228406ff8493d53b5d2d582a4c8f473519ea.svg)![     ┌────── C ──────┐
o1 ──┼────── Lj ─────┼── o2
     ├────── Ls ─────┤
     │               │
    Cg              Cg
     │               │
    GND             GND](_build/html/_images/svgbob-3a7f228406ff8493d53b5d2d582a4c8f473519ea_dark.svg)

#### NOTE
The total shunt capacitance capacitance should include the pads,
junction capacitance, and parasitic meander capacitance. Spurious
array self-resonance (SR) modes can be phenomenologically modeled
by adding to the shunt capacitance or using a multimode model.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Total shunt capacitance $C_\Sigma$ in Farads.
  * **josephson_inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Josephson inductance $L_\text{J}$ in Henries.
  * **superinductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Superinductance $L_\text{s}$ in Henries.
  * **ground_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Parasitic capacitance to ground $C_\text{g}$ at each port in Farads.
* **Returns:**
  S-parameters dictionary with ports o1 and o2.
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/5bc61c4755db615f76b7d1f54b3af9d8/models-10.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/eec3a8f24a94b2278bdf6c9c6daf2513/models-10.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/cf23f734875f8a0baa595f606ed77d11/models-10.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/070f7fcb2c4787554407252a7523fbc2/models-10.png))

![image](_build/html/plot_directive/models-10.svg)![image](_build/html/plot_directive/models-10_dark.svg)

#### fluxonium_coupled

### qpdk.models.fluxonium_coupled(f=5000000000.0, capacitance=1e-14, josephson_inductance=1e-08, superinductance=5e-07, ground_capacitance=0.0, coupling_capacitance=1e-14, coupling_inductance=0.0)

Coupled fluxonium qubit model.

This model adds a coupling network to the fluxonium model.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Total shunt capacitance $C_\Sigma$ in Farads.
  * **josephson_inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Josephson inductance $L_\text{J}$ in Henries.
  * **superinductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Superinductance $L_\text{s}$ in Henries.
  * **ground_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Parasitic capacitance to ground $C_\text{g}$ in Farads.
  * **coupling_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Coupling capacitance $C_\text{c}$ in Farads.
  * **coupling_inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Coupling inductance $L_\text{c}$ in Henries.
* **Returns:**
  S-parameters dictionary with ports o1 and o2.
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/9b71ff7ae4bd97c6befd6dd955f4e829/models-11.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/3dd9e7defec953862bc9252698379621/models-11.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/d2ffadafbbffaf8ce52f983b0eddf3b5/models-11.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/6114dea8847f4ecf0e0dfe6f937df9db/models-11.png))

![image](_build/html/plot_directive/models-11.svg)![image](_build/html/plot_directive/models-11_dark.svg)

#### fluxonium_with_bbox

### qpdk.models.fluxonium_with_bbox(f=5000000000.0, capacitance=1e-14, josephson_inductance=1e-08, superinductance=5e-07, ground_capacitance=0.0)

S-parameter model for a fluxonium qubit with bounding box ports.

This model is the same as [`fluxonium()`](#qpdk.models.fluxonium).

* **Returns:**
  S-parameters dictionary.
* **Return type:**
  sax.SDict
* **Parameters:**
  * **f** (*FloatArrayLike*)
  * **capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **josephson_inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **superinductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **ground_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/395759712be8a2c42ea2db25d1cbcd18/models-12.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/effec86cc6e186b6f958452c9761aee3/models-12.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/83da6507c7e8fc77514fef8a02a1c9f3/models-12.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/2ff03ee4307a60b87f3b013e934209b4/models-12.png))

![image](_build/html/plot_directive/models-12.svg)![image](_build/html/plot_directive/models-12_dark.svg)

#### fluxonium_with_resonator

### qpdk.models.fluxonium_with_resonator(f=5000000000.0, capacitance=1e-14, josephson_inductance=1e-08, superinductance=5e-07, ground_capacitance=0.0, resonator_length=5000.0, resonator_cross_section='cpw', coupling_capacitance=1e-14)

Model for a fluxonium qubit coupled to a quarter-wave resonator.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Total shunt capacitance $C_\Sigma$ in Farads.
  * **josephson_inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Josephson inductance $L_\text{J}$ in Henries.
  * **superinductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Superinductance $L_\text{s}$ in Henries.
  * **ground_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Parasitic capacitance to ground $C_\text{g}$ in Farads.
  * **resonator_length** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Length of the quarter-wave resonator in µm.
  * **resonator_cross_section** ([*str*](https://docs.python.org/3/builtins/stdtypes.html#str)) – Cross-section specification for the resonator.
  * **coupling_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Coupling capacitance between qubit and resonator in Farads.
* **Returns:**
  S-parameters dictionary.
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/b8b4ae9184b260543122ce299ea7b8cf/models-13.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/65d12d5c75326b43eed459294dc99ee0/models-13.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/0c825e710de3dfc0289fff34c277d106/models-13.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/7163910e62b5d738271c63f85671c489/models-13.png))

![image](_build/html/plot_directive/models-13.svg)![image](_build/html/plot_directive/models-13_dark.svg)

#### qubit_with_resonator

### qpdk.models.qubit_with_resonator(f=5000000000.0, qubit_capacitance=1e-13, qubit_inductance=1e-09, qubit_grounded=False, resonator_length=5000.0, resonator_cross_section='cpw', coupling_capacitance=1e-14)

Model for a transmon qubit coupled to a quarter-wave resonator.

This model corresponds to the layout function
`transmon_with_resonator()`.

The model combines:
- A transmon qubit (LC resonator)
- A quarter-wave coplanar waveguide resonator
- A coupling capacitor connecting the qubit to the resonator

![    "quarter-wave resonator"
    (straight_shorted)
           │
o1 ── tee ─┤
           │
           +── Cc ── qubit ── o2](_build/html/_images/svgbob-8bc3af14d5097c2cbeeeb5ea89e0644ab736c85c.svg)![    "quarter-wave resonator"
    (straight_shorted)
           │
o1 ── tee ─┤
           │
           +── Cc ── qubit ── o2](_build/html/_images/svgbob-8bc3af14d5097c2cbeeeb5ea89e0644ab736c85c_dark.svg)

The qubit can be either:
- A double-island transmon (`qubit_grounded=False`): both islands floating
- A shunted transmon (`qubit_grounded=True`): one island grounded

Use [`ec_to_capacitance()`](#qpdk.models.ec_to_capacitance) and [`ej_to_inductance()`](#qpdk.models.ej_to_inductance) to convert
from qubit Hamiltonian parameters ($E_\text{C}$, $E_\text{J}$) to circuit parameters.

#### NOTE
This function is not JIT-compiled because it depends on [`straight_shorted()`](#qpdk.models.straight_shorted),
which internally uses cpw_parameters for transmission line modeling.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **qubit_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Total capacitance $C_\Sigma$ of the qubit in Farads.
    Convert from charging energy using [`ec_to_capacitance()`](#qpdk.models.ec_to_capacitance).
  * **qubit_inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Josephson inductance $L_\text{J}$ in Henries.
    Convert from Josephson energy using [`ej_to_inductance()`](#qpdk.models.ej_to_inductance).
  * **qubit_grounded** ([*bool*](https://docs.python.org/3/builtins/functions.html#bool)) – If True, the qubit is a shunted transmon (grounded).
    If False, it is a double-island transmon (ungrounded).
  * **resonator_length** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Length of the quarter-wave resonator in µm.
  * **resonator_cross_section** ([*str*](https://docs.python.org/3/builtins/stdtypes.html#str)) – Cross-section specification for the resonator.
  * **coupling_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Coupling capacitance between qubit and resonator in
    Farads. Use [`coupling_strength_to_capacitance()`](#qpdk.models.coupling_strength_to_capacitance) to convert from
    qubit-resonator coupling strength $g$.
* **Returns:**
  S-parameters dictionary with ports `o1` (resonator input)
  : and `o2` (qubit ground or floating).
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/33e1622ea61ae18813942e6cd44c04f3/models-14.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/1ff2a6039df13b5b8c9ed83c33fd9b69/models-14.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/dfca5adba4c08e760d62a302cc72f0e5/models-14.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/ec4a10d66c397fad3e03bea94d6a64c5/models-14.png))

![image](_build/html/plot_directive/models-14.svg)![image](_build/html/plot_directive/models-14_dark.svg)

#### shunted_transmon

### qpdk.models.shunted_transmon(f=5000000000.0, capacitance=1e-13, inductance=7e-09, ground_capacitance=0.0)

LC resonator model for a shunted transmon qubit.

A shunted transmon has one island grounded and the other island connected
to the junction. This is modeled as a grounded parallel LC resonator.

The qubit frequency is approximately:

$$
f_\text{q} \approx \frac{1}{2\pi} \sqrt{8 E_\text{J} E_\text{C}} - E_\text{C}
$$

For the LC model, the resonance frequency is:

$$
f_\text{r} = \frac{1}{2\pi\sqrt{LC}}
$$

Use [`ec_to_capacitance()`](#qpdk.models.ec_to_capacitance) and [`ej_to_inductance()`](#qpdk.models.ej_to_inductance) to convert
from qubit Hamiltonian parameters.

![o1 ──┬──L──┬──.
     │     │  | "2-port ground"
     └──C──┘  |
             "o2"](_build/html/_images/svgbob-248da6029165dbf44320109b707001438a67f734.svg)![o1 ──┬──L──┬──.
     │     │  | "2-port ground"
     └──C──┘  |
             "o2"](_build/html/_images/svgbob-248da6029165dbf44320109b707001438a67f734_dark.svg)
* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **capacitance** (*FloatArrayLike*) – Total capacitance $C_\Sigma$ of the qubit in Farads.
  * **inductance** (*FloatArrayLike*) – Josephson inductance $L_\text{J}$ in Henries.
  * **ground_capacitance** (*FloatArrayLike*) – Parasitic capacitance to ground $C_\text{g}$ at the floating port in Farads.
* **Returns:**
  S-parameters dictionary with ports o1 and o2.
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/8987717f026b9a32018b62861f83d539/models-15.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/24bb53e8c71d64cd4a47a8e61190f254/models-15.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/76d6bce1284cddbb7a87ec1b291fad21/models-15.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/30b084c33091b590170bd373c47c24f5/models-15.png))

![image](_build/html/plot_directive/models-15.svg)![image](_build/html/plot_directive/models-15_dark.svg)

#### transmon_coupled

### qpdk.models.transmon_coupled(f=5000000000.0, capacitance=1e-13, inductance=1e-09, grounded=False, ground_capacitance=0.0, coupling_capacitance=1e-14, coupling_inductance=0.0)

Coupled transmon qubit model.

This model extends the basic transmon qubit by adding a coupling network
consisting of a parallel capacitor and/or inductor. This can represent
capacitive or inductive coupling between qubits or between a qubit and
a readout resonator.

The coupling network is connected in series with the LC resonator:

![     +──Lc──+    +──L──+
o1 ──│      │────|     │─── o2 or grounded o2
     +──Cc──+    +──C──+
               "LC resonator"](_build/html/_images/svgbob-1fbbe6ea86ad7ac620395764c649e141d7cd1454.svg)![     +──Lc──+    +──L──+
o1 ──│      │────|     │─── o2 or grounded o2
     +──Cc──+    +──C──+
               "LC resonator"](_build/html/_images/svgbob-1fbbe6ea86ad7ac620395764c649e141d7cd1454_dark.svg)

For capacitive coupling (common for qubit-resonator coupling):
: - Set `coupling_capacitance` to the coupling capacitor value
  - Set `coupling_inductance=0.0`

For inductive coupling (common for flux-tunable coupling):
: - Set `coupling_inductance` to the coupling inductor value
  - Set `coupling_capacitance=0.0` (or small value)

Use [`coupling_strength_to_capacitance()`](#qpdk.models.coupling_strength_to_capacitance) to convert from the
qubit-resonator coupling strength $g$ to the coupling capacitance.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **capacitance** (*FloatArrayLike*) – Total capacitance $C_\Sigma$ of the qubit in Farads.
  * **inductance** (*FloatArrayLike*) – Josephson inductance $L_\text{J}$ in Henries.
  * **grounded** ([*bool*](https://docs.python.org/3/builtins/functions.html#bool)) – If True, the qubit is a shunted transmon (grounded).
    If False, it is a double-pad transmon (ungrounded).
  * **ground_capacitance** (*FloatArrayLike*) – Parasitic capacitance to ground $C_\text{g}$ in Farads.
  * **coupling_capacitance** (*FloatArrayLike*) – Coupling capacitance $C_\text{c}$ in Farads.
  * **coupling_inductance** (*FloatArrayLike*) – Coupling inductance $L_\text{c}$ in Henries.
* **Returns:**
  S-parameters dictionary with ports o1 and o2.
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/c6c9b147343ad2a2f0fd0a496a13359b/models-16.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/faf22f8ec1dff558cacf3617766c31a0/models-16.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/7ee85ec328707d0c5e40aa3365742f71/models-16.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/805ff1f5d048b64a00c93931b1a88b22/models-16.png))

![image](_build/html/plot_directive/models-16.svg)![image](_build/html/plot_directive/models-16_dark.svg)

#### transmon_with_resonator

### qpdk.models.transmon_with_resonator(f=5000000000.0, qubit_capacitance=1e-13, qubit_inductance=1e-09, qubit_grounded=False, resonator_length=5000.0, resonator_cross_section='cpw', coupling_capacitance=1e-14)

Model for a transmon qubit coupled to a quarter-wave resonator.

This model is identical to [`qubit_with_resonator()`](#qpdk.models.qubit_with_resonator).

* **Returns:**
  S-parameters dictionary.
* **Return type:**
  sax.SDict
* **Parameters:**
  * **f** (*FloatArrayLike*)
  * **qubit_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **qubit_inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **qubit_grounded** ([*bool*](https://docs.python.org/3/builtins/functions.html#bool))
  * **resonator_length** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **resonator_cross_section** ([*str*](https://docs.python.org/3/builtins/stdtypes.html#str))
  * **coupling_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/3f118c11d1bb86e101ff63f6da1b635a/models-17.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/de6cc73695924cd8d6e6900a38644d80/models-17.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/79f093c69e39c674ed5dfb9c2852ad65/models-17.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/9a6f2b66a4b20801bcefa22efdfb091e/models-17.png))

![image](_build/html/plot_directive/models-17.svg)![image](_build/html/plot_directive/models-17_dark.svg)

#### unimon_coupled

### qpdk.models.unimon_coupled(f=5000000000.0, arm_length=3000.0, cross_section='cpw', junction_capacitance=5e-15, junction_inductance=-7e-09, coupling_capacitance=1e-14)

SAX model for a capacitively coupled unimon qubit.

The unimon is modeled as a closed system of two shorted quarter-wave CPW
resonators connected by a Josephson junction. Interaction with the qubit
is provided via a single coupling capacitor connected to one of the arms.

![o1 ── Cc ──┬── λ/4 TL ── (ground)
           │
         Junction
           │
           └── λ/4 TL ── (ground)](_build/html/_images/svgbob-a518dd266255d1e8e30678e189e6f6b2406e526c.svg)![o1 ── Cc ──┬── λ/4 TL ── (ground)
           │
         Junction
           │
           └── λ/4 TL ── (ground)](_build/html/_images/svgbob-a518dd266255d1e8e30678e189e6f6b2406e526c_dark.svg)
* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **arm_length** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Length of each quarter-wave resonator arm in µm.
  * **cross_section** ([*str*](https://docs.python.org/3/builtins/stdtypes.html#str)) – Cross-section specification for the CPW arms.
  * **junction_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Junction capacitance $C_\text{J}$ in Farads.
  * **junction_inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Junction inductance $L_\text{J}$ in Henries.
  * **coupling_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Coupling capacitance $C_\text{c}$ in Farads.
* **Returns:**
  S-parameters dictionary with a single port `o1`.
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/f6006244748ddbcced291441441b1992/models-18.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/20840b8c667141ffd00eb69b96013cda/models-18.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/f62bfe3120ac90c839f84df1a5018ee9/models-18.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/2aa222b649d770aef7c42759d6bbd4f9/models-18.png))

![image](_build/html/plot_directive/models-18.svg)![image](_build/html/plot_directive/models-18_dark.svg)

#### xmon_transmon

### qpdk.models.xmon_transmon(f=5000000000.0, capacitance=1e-13, inductance=7e-09)

LC resonator model for an Xmon style transmon qubit.

An Xmon transmon is typically shunted, so this model wraps [`shunted_transmon()`](#qpdk.models.shunted_transmon).

* **Returns:**
  S-parameters dictionary.
* **Return type:**
  sax.SDict
* **Parameters:**
  * **f** (*FloatArrayLike*)
  * **capacitance** (*FloatArrayLike*)
  * **inductance** (*FloatArrayLike*)

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/9f98d8ecfa96961d682da9d9e2d6eba4/models-19.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/02dbbfb172c5bd419fd84b87325029ed/models-19.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/986d692fa891662d76ef4b21c8371f6c/models-19.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/88a0a4f6bd7d0d480a004996643f8713/models-19.png))

![image](_build/html/plot_directive/models-19.svg)![image](_build/html/plot_directive/models-19_dark.svg)

<a id="models-resonators"></a>

### Resonators

Quarter- and half-wave transmission-line resonators and their coupled variants.

| [`quarter_wave_resonator_coupled`](#qpdk.models.quarter_wave_resonator_coupled)   | Model for a quarter-wave coplanar waveguide resonator coupled to a probeline.   |
|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| [`resonator`](#qpdk.models.resonator)                        | S-parameter model for a simple transmission line resonator.                     |
| [`resonator_coupled`](#qpdk.models.resonator_coupled)                | Model for a coplanar waveguide resonator coupled to a probeline.                |
| [`resonator_half_wave`](#qpdk.models.resonator_half_wave)              | S-parameter model for a half-wave resonator (open at both ends).                |
| [`resonator_quarter_wave`](#qpdk.models.resonator_quarter_wave)           | S-parameter model for a quarter-wave resonator (shorted at one end).            |

#### quarter_wave_resonator_coupled

### qpdk.models.quarter_wave_resonator_coupled(f=5000000000.0, length=4000.0, coupling_gap=20.0, coupling_straight_length=200.0, cross_section='cpw', cross_section_non_resonator='cpw')

Model for a quarter-wave coplanar waveguide resonator coupled to a probeline.

* **Parameters:**
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the CPW.
  * **f** (*FloatArrayLike*) – Frequency in Hz at which to evaluate the S-parameters.
  * **length** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Total length of the resonator in μm.
  * **coupling_gap** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Gap between the resonator and the probeline in μm.
  * **coupling_straight_length** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Length of the coupling section in μm.
  * **cross_section_non_resonator** (*CrossSectionSpec* *|* *None*) – Cross-section of the coupling waveguide. If
    `None`, uses `cross_section`.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/1bc186ab48706b0ba55e309130f3f583/models-20.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/241df04025114a65c13c36f57e63ce4a/models-20.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/5e3a2f7a191fd356ff8f824afd328609/models-20.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/66a097a79542668d5a5cf2e9db3357a1/models-20.png))

![image](_build/html/plot_directive/models-20.svg)![image](_build/html/plot_directive/models-20_dark.svg)

#### resonator

### qpdk.models.resonator(f=5000000000.0, length=4000.0, cross_section='cpw')

S-parameter model for a simple transmission line resonator.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** (*Float*) – Physical length in µm
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the waveguide.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/3a4281846afb3f3762dd6e6dd730caf7/models-21.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/b79d7e1f29fd48b481b4a2e10c3725c8/models-21.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/63d89c6d7bb6487aca224467a9feb1b0/models-21.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/89b49764e2d4f402bb80c50139ab362f/models-21.png))

![image](_build/html/plot_directive/models-21.svg)![image](_build/html/plot_directive/models-21_dark.svg)

#### resonator_coupled

### qpdk.models.resonator_coupled(f=5000000000.0, length=4000.0, coupling_gap=20.0, coupling_straight_length=200.0, cross_section='cpw', cross_section_non_resonator='cpw', open_start=True, open_end=False)

Model for a coplanar waveguide resonator coupled to a probeline.

* **Parameters:**
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the CPW.
  * **f** (*FloatArrayLike*) – Frequency in Hz at which to evaluate the S-parameters.
  * **length** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Total length of the resonator in μm.
  * **coupling_gap** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Gap between the resonator and the probeline in μm.
  * **coupling_straight_length** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Length of the coupling section in μm.
  * **cross_section_non_resonator** (*CrossSectionSpec* *|* *None*) – Cross-section of the coupling waveguide. If
    `None`, uses `cross_section`.
  * **open_start** ([*bool*](https://docs.python.org/3/builtins/functions.html#bool)) – If True, adds an electrical open at the start.
  * **open_end** ([*bool*](https://docs.python.org/3/builtins/functions.html#bool)) – If True, adds an electrical open at the end.
* **Returns:**
  S-parameters dictionary with 4 ports.
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/e23fb904496a2cb94353897c580b1b64/models-22.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/22a83ac477d9c0cf37edc49709e5b97b/models-22.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/580a089a9098409e0cdfe5461946b657/models-22.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/fce953234cc1ee501b44e3dc5810f3d1/models-22.png))

![image](_build/html/plot_directive/models-22.svg)![image](_build/html/plot_directive/models-22_dark.svg)

#### resonator_half_wave

### qpdk.models.resonator_half_wave(f=5000000000.0, length=4000.0, cross_section='cpw')

S-parameter model for a half-wave resonator (open at both ends).

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** (*Float*) – Physical length in µm
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the waveguide.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/f0278aad2a47633c11a0b4cb7250ab40/models-23.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/3d243b6ca257a2fee9a5f7d1f36ab3cd/models-23.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/847ffad24e670a4170e726ce6f074cc1/models-23.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/c08ed2f2ae43a285aa956b55e85a4834/models-23.png))

![image](_build/html/plot_directive/models-23.svg)![image](_build/html/plot_directive/models-23_dark.svg)

#### resonator_quarter_wave

### qpdk.models.resonator_quarter_wave(f=5000000000.0, length=4000.0, cross_section='cpw')

S-parameter model for a quarter-wave resonator (shorted at one end).

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** (*Float*) – Physical length in µm
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the waveguide.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/a27b450d8c853d92f155abde7819fcf5/models-24.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/e764ff829da9c382f4aa1f78d02830a1/models-24.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/40c72848bb9e9a605d7677bacf5c6610/models-24.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/e3ec40a6519f9eab590b8743903cbc62/models-24.png))

![image](_build/html/plot_directive/models-24.svg)![image](_build/html/plot_directive/models-24_dark.svg)

<a id="models-couplers"></a>

### Couplers

Straight and ring couplers between CPW lines.

| [`coupler_ring`](#qpdk.models.coupler_ring)     | S-parameter model for two coupled coplanar waveguides in a ring configuration.   |
|-------------------------------------------------------------------|----------------------------------------------------------------------------------|
| [`coupler_straight`](#qpdk.models.coupler_straight) | S-parameter model for two coupled coplanar waveguides, `coupler_straight()`.     |

#### coupler_ring

### qpdk.models.coupler_ring(f=5000000000.0, length_x=20.0, gap=16, cross_section='cpw')

S-parameter model for two coupled coplanar waveguides in a ring configuration.

The implementation is the same as straight coupler for now.

TODO: Fetch coupling capacitance from a curved simulation library.

* **Parameters:**
  * **f** (*ArrayLike*) – Array of frequency points in Hz
  * **length_x** ([*int*](https://docs.python.org/3/builtins/functions.html#int) *|* [*float*](https://docs.python.org/3/builtins/functions.html#float)) – Physical length of coupling section in µm
  * **gap** ([*int*](https://docs.python.org/3/builtins/functions.html#int) *|* [*float*](https://docs.python.org/3/builtins/functions.html#float)) – Gap between the coupled waveguides in µm
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the CPW.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/fca827ad97543ee8178d392fb990c451/models-25.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/bb7d4f9104fa5a3deda5dd07cbcb9114/models-25.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/1979970699e1e69f85be71804bef6456/models-25.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/27889b18761d5325487d03a122fc8fcf/models-25.png))

![image](_build/html/plot_directive/models-25.svg)![image](_build/html/plot_directive/models-25_dark.svg)

#### coupler_straight

### qpdk.models.coupler_straight(f=5000000000.0, length=10, gap=16, cross_section='cpw', cross_section_non_resonator=None, resonator_offset=0.0)

S-parameter model for two coupled coplanar waveguides, `coupler_straight()`.

* **Parameters:**
  * **f** (*ArrayLike*) – Array of frequency points in Hz
  * **length** ([*int*](https://docs.python.org/3/builtins/functions.html#int) *|* [*float*](https://docs.python.org/3/builtins/functions.html#float)) – Physical length of coupling section in µm
  * **gap** ([*int*](https://docs.python.org/3/builtins/functions.html#int) *|* [*float*](https://docs.python.org/3/builtins/functions.html#float)) – Gap between the coupled waveguides in µm
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the CPW.
  * **cross_section_non_resonator** (*CrossSectionSpec* *|* *None*) – Optional cross section of the upper bus.
  * **resonator_offset** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Lower trace layout offset in µm; the legacy model
    retains the full nominal coupling length.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

```default
o2──────▲───────o3
        │gap
o1──────▼───────o4
```

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/eb48a7660750adbd2c47bfbc7db27f53/models-26.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/63e2e65a1af6014d7ba51a4da5539f9f/models-26.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/7554a62a17a3325ea1de930749c2e9f7/models-26.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/44bb5c5fa3f829b18e9beda73f2dcbcb/models-26.png))

![image](_build/html/plot_directive/models-26.svg)![image](_build/html/plot_directive/models-26_dark.svg)

<a id="models-lumped"></a>

### Capacitors and inductors

Interdigital and plate capacitors, meander inductors and lumped-element resonators.

| [`interdigital_capacitor`](#qpdk.models.interdigital_capacitor)   | Interdigital capacitor Sax model.      |
|---------------------------------------------------------------------------|----------------------------------------|
| [`lumped_element_resonator`](#qpdk.models.lumped_element_resonator) | Lumped-element LC resonator SAX model. |
| [`meander_inductor`](#qpdk.models.meander_inductor)         | Meander inductor SAX model.            |
| [`plate_capacitor`](#qpdk.models.plate_capacitor)          | Plate capacitor Sax model.             |

#### interdigital_capacitor

### qpdk.models.interdigital_capacitor(, f=5000000000.0, fingers=4, finger_length=20.0, finger_gap=2.0, thickness=5.0, cross_section='cpw')

Interdigital capacitor Sax model.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **fingers** ([*int*](https://docs.python.org/3/builtins/functions.html#int)) – Total number of fingers (must be >= 2)
  * **finger_length** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Length of each finger in μm
  * **finger_gap** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Gap between adjacent fingers in μm
  * **thickness** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Thickness of fingers in μm
  * **cross_section** (*CrossSectionSpec*) – Cross-section specification
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/e311712ff81b7e0fa99b93c87e17d109/models-27.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/36f87640a2781769854b2ff4c18dfb43/models-27.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/654c2b1a0639f77a5fc1689d287bc039/models-27.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/222faa3fa54776054fd284558e72a1bf/models-27.png))

![image](_build/html/plot_directive/models-27.svg)![image](_build/html/plot_directive/models-27_dark.svg)

#### lumped_element_resonator

### qpdk.models.lumped_element_resonator(, f=5000000000.0, fingers=20, finger_length=20.0, finger_gap=2.0, finger_thickness=5.0, n_turns=15, sheet_inductance=4e-13, cross_section='meander_inductor_cross_section', grounded=False)

Lumped-element LC resonator SAX model.

Combines an interdigital capacitor and a meander inductor in parallel
to form an LC resonator.  The resonance frequency is:

$$
f_\text{r} = \frac{1}{2\pi\sqrt{LC}}
$$

where $C$ is computed from the interdigital capacitor geometry
using `interdigital_capacitor_capacitance_analytical()`
and $L$ is computed from the meander inductor geometry using
[`meander_inductor_inductance_analytical()`](#qpdk.models.meander_inductor_inductance_analytical).

The inductor section uses the width and gap derived from the
cross_section to ensure consistent RF behavior across the meander.
The vertical spacing between meander runs is set to twice the etch gap
to prevent overlap of the etched regions.

See [[CSD+23](#id37), [KVH+11](#id59)].

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **fingers** ([*int*](https://docs.python.org/3/builtins/functions.html#int)) – Number of interdigital capacitor fingers.
  * **finger_length** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Length of each capacitor finger in µm.
  * **finger_gap** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Gap between adjacent capacitor fingers in µm.
  * **finger_thickness** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Width of each capacitor finger in µm.
  * **n_turns** ([*int*](https://docs.python.org/3/builtins/functions.html#int)) – Number of horizontal meander inductor runs (must be odd to
    match the cell geometry where the path spans left-to-right bus bars).
  * **sheet_inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Sheet inductance per square in H/□.
  * **cross_section** (*CrossSectionSpec*) – Cross-section specification. Used for substrate
    permittivity and to determine inductor wire width and gap.
  * **grounded** ([*bool*](https://docs.python.org/3/builtins/functions.html#bool)) – If True, one port of the resonator is grounded.
* **Returns:**
  S-parameters dictionary with ports o1 and o2.
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/23e74844c9f25d53f9929609022172dc/models-28.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/74e35b601e6e6e9fdcef8ec9407d2123/models-28.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/fb7258fd02bdb9e4599b4182bc1f84fe/models-28.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/f1ef549f9f870d4334109842c33198bd/models-28.png))

![image](_build/html/plot_directive/models-28.svg)![image](_build/html/plot_directive/models-28_dark.svg)

#### meander_inductor

### qpdk.models.meander_inductor(, f=5000000000.0, n_turns=5, turn_length=200.0, cross_section='meander_inductor_cross_section', wire_gap=None, sheet_inductance=4e-13)

Meander inductor SAX model.

Computes the inductance from the meander geometry and returns
S-parameters of an equivalent lumped inductor.

The model extracts the center conductor width and gap from the provided
cross-section. The vertical pitch is calculated as:

$$
p = w + \text{wire gap}
$$

where $w$ is the center conductor width. Without an explicit
`wire_gap`, the gap defaults to twice the etch-section width so
that the etched regions of adjacent meander runs do not overlap and
interfere with the characteristic impedance of each other, or to
$w$ for cross-sections without an etch section such as a plain
microstrip.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **n_turns** ([*int*](https://docs.python.org/3/builtins/functions.html#int)) – Number of horizontal meander runs.
  * **turn_length** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Length of each horizontal run in µm.
  * **cross_section** (*CrossSectionSpec*) – Cross-section specification for the meander wire.
    Used to determine the wire width and the gap between runs.
  * **wire_gap** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *None*) – Optional explicit gap between adjacent meander runs in µm.
    If None (default), it is inferred from the cross-section the same
    way the meander inductor cell does it. An explicit gap is used
    as is, whether or not the cross-section defines an etch section,
    and must be positive.
  * **sheet_inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Sheet inductance per square in H/□.
* **Returns:**
  S-parameters dictionary.
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/afd3762f200b21723f39e097de836e32/models-29.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/5c1e1a55c619763360070e6fc9f3d693/models-29.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/a278be92fb9f9682dfbba6e92f2596e7/models-29.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/b6705dd9cfa4b84837d1fe6ea2695845/models-29.png))

![image](_build/html/plot_directive/models-29.svg)![image](_build/html/plot_directive/models-29_dark.svg)

#### plate_capacitor

### qpdk.models.plate_capacitor(, f=5000000000.0, length=26.0, width=5.0, gap=7.0, cross_section='cpw')

Plate capacitor Sax model.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Length of the capacitor pad in μm
  * **width** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Width of the capacitor pad in μm
  * **gap** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Gap between plates in μm
  * **cross_section** (*CrossSectionSpec*) – Cross-section specification
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/b197d674bed781608f34f25bbeedd5f0/models-30.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/88596ea6b8c1c267144fd4d1c18dcf1e/models-30.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/4c4f3da3f84835a46f056812dc6ba723/models-30.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/3cec63a680947eac6ff64f5a3950aa73/models-30.png))

![image](_build/html/plot_directive/models-30.svg)![image](_build/html/plot_directive/models-30_dark.svg)

<a id="models-junctions"></a>

### Josephson junctions

Single junctions and SQUIDs.

| [`josephson_junction`](#qpdk.models.josephson_junction)   | Josephson junction (RCSJ) small-signal Sax model.            |
|-----------------------------------------------------------------------|--------------------------------------------------------------|
| [`squid_junction`](#qpdk.models.squid_junction)       | DC SQUID small-signal Sax model in the zero-screening limit. |

#### josephson_junction

### qpdk.models.josephson_junction(, f=5000000000.0, ic=1e-06, capacitance=5e-15, resistance=10000.0, ib=0.0)

Josephson junction (RCSJ) small-signal Sax model.

Linearized RCSJ model consisting of a bias-dependent Josephson inductance
in parallel with capacitance and resistance.

Valid in the superconducting (zero-voltage) state and for small AC signals.

Default capacitance taken from [[SFS+15](#id88)].

See [[McC68](#id74)] for details.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **ic** (*Float*) – Critical current $I_\text{c}$ in Amperes
  * **capacitance** (*Float*) – Junction capacitance $C$ in Farads
  * **resistance** (*Float*) – Shunt resistance $R$ in Ohms
  * **ib** (*Float*) – DC bias current $I_\text{b}$ in Amperes ($\|I_\text{b}\| < I_\text{c}$)
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/25fe82c5e76a4d2cd293c9273074cdd0/models-31.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/d6a123b431781280d38fa96eab6e4b28/models-31.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/9bd095ca6d5343fd9485f73ec4d2b06a/models-31.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/090b8b6b5ec6bada6cfd501ad97537ca/models-31.png))

![image](_build/html/plot_directive/models-31.svg)![image](_build/html/plot_directive/models-31_dark.svg)

#### squid_junction

### qpdk.models.squid_junction(, f=5000000000.0, ic_tot=2e-06, asymmetry=0.0, capacitance=1e-14, resistance=5000.0, ib=0.0, flux=0.0)

DC SQUID small-signal Sax model in the zero-screening limit.

Treats the DC SQUID as a single effective RCSJ whose critical current is
tunable by an external magnetic flux. Assumes negligible loop geometric inductance.

See [[KYG+07](#id61)] and [[Tin15](#id91)]
for details on asymmetric SQUIDs and effective Josephson inductance.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **ic_tot** (*Float*) – Total critical current sum $I_{\text{c}1} + I_{\text{c}2}$ in Amperes
  * **asymmetry** (*Float*) – Junction asymmetry $(I_{\text{c}1} - I_{\text{c}2}) / I_{\text{c,tot}}$
  * **capacitance** (*Float*) – Total SQUID capacitance $C_1 + C_2$ in Farads
  * **resistance** (*Float*) – Total SQUID shunt resistance $R_1 || R_2$ in Ohms
  * **ib** (*Float*) – DC bias current $I_\text{b}$ in Amperes
  * **flux** (*FloatArrayLike*) – External magnetic flux $\Phi_{\text{ext}}$ in Webers
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/a4479a4eb6a2ee15a886c0ff9166c457/models-32.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/4c8f1d7de8dc2c2876193673bec099d4/models-32.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/39d02112a84a601727ec91e4b48bf001/models-32.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/c3f7e43f188e2722cbc83918d45ab27e/models-32.png))

![image](_build/html/plot_directive/models-32.svg)![image](_build/html/plot_directive/models-32_dark.svg)

<a id="models-waveguides"></a>

### Waveguides and interconnects

Straights, bends, tapers, launchers, airbridges, bumps, TSVs, rectangles and generic N-port blocks.

| [`airbridge`](#qpdk.models.airbridge)               | S-parameter model for a superconducting CPW airbridge.                                |
|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| [`bend_circular`](#qpdk.models.bend_circular)           | S-parameter model for a circular bend, wrapped to `straight()`.                       |
| [`bend_circular_all_angle`](#qpdk.models.bend_circular_all_angle) | S-parameter model for a circular bend, wrapped to `straight()`.                       |
| [`bend_euler`](#qpdk.models.bend_euler)              | S-parameter model for an Euler bend, wrapped to `straight()`.                         |
| [`bend_euler_all_angle`](#qpdk.models.bend_euler_all_angle)    | S-parameter model for an Euler bend, wrapped to `straight()`.                         |
| [`bend_s`](#qpdk.models.bend_s)                  | S-parameter model for an S-bend, wrapped to `straight()`.                             |
| [`indium_bump`](#qpdk.models.indium_bump)             | S-parameter model for an indium bump, wrapped to `straight()`.                        |
| [`launcher`](#qpdk.models.launcher)                | S-parameter model for a launcher, effectively a straight section followed by a taper. |
| [`nxn`](#qpdk.models.nxn)                     | NxN junction model using tee components.                                              |
| [`rectangle`](#qpdk.models.rectangle)               | S-parameter model for a rectangular section, wrapped to `straight()`.                 |
| [`straight`](#qpdk.models.straight)                | S-parameter model for a straight coplanar waveguide.                                  |
| [`straight_all_angle`](#qpdk.models.straight_all_angle)      | S-parameter model for a straight coplanar waveguide.                                  |
| [`straight_double_open`](#qpdk.models.straight_double_open)    | S-parameter model for a straight waveguide with open ends.                            |
| [`straight_microstrip`](#qpdk.models.straight_microstrip)     | S-parameter model for a straight microstrip transmission line.                        |
| [`straight_open`](#qpdk.models.straight_open)           | S-parameter model for a straight waveguide with one open end.                         |
| [`straight_shorted`](#qpdk.models.straight_shorted)        | S-parameter model for a straight waveguide with one shorted end.                      |
| [`taper_cross_section`](#qpdk.models.taper_cross_section)     | S-parameter model for a cross-section taper using linear interpolation.               |
| [`tsv`](#qpdk.models.tsv)                     | S-parameter model for a through-silicon via (TSV), wrapped to `straight()`.           |

#### airbridge

### qpdk.models.airbridge(f=5000000000.0, cpw_width=10.0, bridge_width=8.0, airgap_height=3.0, loss_tangent=1.2e-08)

S-parameter model for a superconducting CPW airbridge.

The airbridge is modeled as a lumped lossy shunt admittance to ground
(shunt capacitance plus dielectric loss) across the CPW at the bridge
location.

Ports `o1` and `o2` are the CPW reference planes immediately either
side of the bridge, both referenced to $Z_0 = 50\,\Omega$. The
bridge footprint adds no transmission line length, so the two reference
planes coincide. The landing pads of the layout cell (`e1` and `e2`,
on the `AB_VIA` layer) contact the ground plane and are *not* RF ports
of this model.

Parallel plate capacitor model is as done in [[CMK+14](#id38)]
The default value for the loss tangent $\tan\,\delta$ is also taken from there.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **cpw_width** (*Float*) – Width of the CPW center conductor in µm.
  * **bridge_width** (*Float*) – Width of the airbridge in µm.
  * **airgap_height** (*Float*) – Height of the airgap in µm.
  * **loss_tangent** (*Float*) – Dielectric loss tangent of the supporting layer/residues.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/7499b90b822045db5993cfe7bd07c8f6/models-33.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/1ed02b0150df394d3c93089d48d23b75/models-33.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/384491e643e7e75b277216e8a34244c7/models-33.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/f2e2e0132eba7091a53204c25c885a67/models-33.png))

![image](_build/html/plot_directive/models-33.svg)![image](_build/html/plot_directive/models-33_dark.svg)

#### bend_circular

### qpdk.models.bend_circular(f=5000000000.0, length=1000, cross_section='cpw')

S-parameter model for a circular bend, wrapped to [`straight()`](#qpdk.models.straight).

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** (*Float*) – Physical length in µm
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the waveguide.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/95d000170e6a0f2ec77ee4f130e048fd/models-34.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/4e374962715a5a4ab86647097b0e7c09/models-34.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/ff551bc9cd917ff6cdf786b1eac042df/models-34.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/7b85dacbf06e471b4605758c1e43e6d2/models-34.png))

![image](_build/html/plot_directive/models-34.svg)![image](_build/html/plot_directive/models-34_dark.svg)

#### bend_circular_all_angle

### qpdk.models.bend_circular_all_angle(f=5000000000.0, length=1000, cross_section='cpw')

S-parameter model for a circular bend, wrapped to [`straight()`](#qpdk.models.straight).

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** (*Float*) – Physical length in µm
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the waveguide.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/f79224671e89676e32638ed27fbab01c/models-35.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/0a0438502fda77a6e041f16e8b55bd6b/models-35.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/cc52b3ba4abc860888f697671a2a881e/models-35.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/ebff81f0012a7eb6da16bcb601d3d224/models-35.png))

![image](_build/html/plot_directive/models-35.svg)![image](_build/html/plot_directive/models-35_dark.svg)

#### bend_euler

### qpdk.models.bend_euler(f=5000000000.0, length=1000, cross_section='cpw')

S-parameter model for an Euler bend, wrapped to [`straight()`](#qpdk.models.straight).

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** (*Float*) – Physical length in µm
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the waveguide.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/3359c401b16329e7d756b8eead7c63d3/models-36.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/69d1c61cf244bab270408d0b14eff972/models-36.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/5d37ed06fb25ce0de0ec71de7b72fa1a/models-36.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/81ba005183f563e4e8c7e7bb114d710c/models-36.png))

![image](_build/html/plot_directive/models-36.svg)![image](_build/html/plot_directive/models-36_dark.svg)

#### bend_euler_all_angle

### qpdk.models.bend_euler_all_angle(f=5000000000.0, length=1000, cross_section='cpw')

S-parameter model for an Euler bend, wrapped to [`straight()`](#qpdk.models.straight).

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** (*Float*) – Physical length in µm
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the waveguide.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/866568342bb7430272f213e589e83ba3/models-37.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/5167cdb6bf233b5a77151a85529c2540/models-37.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/97a8d68b7d496ad02efabcfd30404195/models-37.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/a01f2740120e8a87920d9b25f3652e88/models-37.png))

![image](_build/html/plot_directive/models-37.svg)![image](_build/html/plot_directive/models-37_dark.svg)

#### bend_s

### qpdk.models.bend_s(f=5000000000.0, length=None, size=(20.0, 3.0), npoints=99, cross_section='cpw')

S-parameter model for an S-bend, wrapped to [`straight()`](#qpdk.models.straight).

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** (*Float* *|* *None*) – Physical length in µm. When omitted, it is derived from `size`.
  * **size** (*Size*) – Layout S-bend extent in µm.
  * **npoints** ([*int*](https://docs.python.org/3/builtins/functions.html#int) *|* [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)) – Number of points used to discretize the layout Bézier curve;
    a scalar array (as gdsfactoryplus model binding emits) is accepted.
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the waveguide.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/f385dcf661fce0e43bb2692d0aab1449/models-38.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/38789c7fe6441e75a6511fbeae8df75f/models-38.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/5ed346482f8f8f319f2a966e200f3d53/models-38.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/9393e26051daeedbac1dab5ac7a2df5b/models-38.png))

![image](_build/html/plot_directive/models-38.svg)![image](_build/html/plot_directive/models-38_dark.svg)

#### indium_bump

### qpdk.models.indium_bump(f=5000000000.0, bump_height=10.0)

S-parameter model for an indium bump, wrapped to [`straight()`](#qpdk.models.straight).

TODO: add a constant loss channel for indium bumps.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **bump_height** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Physical height (length) of the indium bump in µm.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/85ecb03f342fd6cb02fdc3c8cd73eb44/models-39.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/1e84be38b9e82f14efd57aa9bba80908/models-39.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/084de2dce5a1a454d96e5497e5520e37/models-39.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/ed2706a2fc72117e01e08d0ab3d7f8f0/models-39.png))

![image](_build/html/plot_directive/models-39.svg)![image](_build/html/plot_directive/models-39_dark.svg)

#### launcher

### qpdk.models.launcher(f=5000000000.0, straight_length=200.0, taper_length=100.0, cross_section_big=<function launcher_cross_section_big>, cross_section_small='cpw')

S-parameter model for a launcher, effectively a straight section followed by a taper.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **straight_length** (*Float*) – Length of the straight section in µm.
  * **taper_length** (*Float*) – Length of the taper section in µm.
  * **cross_section_big** (*CrossSectionSpec*) – Cross-section for the wide section.
  * **cross_section_small** (*CrossSectionSpec*) – Cross-section for the narrow section.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

#### nxn

### qpdk.models.nxn(f=5000000000.0, west=1, east=1, north=1, south=1)

NxN junction model using tee components.

This model creates an N-port divider/combiner by chaining 3-port tee
junctions. All ports are connected to a single node.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **west** ([*int*](https://docs.python.org/3/builtins/functions.html#int)) – Number of ports on the west side.
  * **east** ([*int*](https://docs.python.org/3/builtins/functions.html#int)) – Number of ports on the east side.
  * **north** ([*int*](https://docs.python.org/3/builtins/functions.html#int)) – Number of ports on the north side.
  * **south** ([*int*](https://docs.python.org/3/builtins/functions.html#int)) – Number of ports on the south side.
* **Returns:**
  S-parameters dictionary with ports o1, o2, …, oN.
* **Return type:**
  sax.SDict
* **Raises:**
  [**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError) – If total number of ports is not positive.

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/1d30be546d48f042fff81ea2c10c42a1/models-40.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/0bbd586b758247ee44480726e7e3d31e/models-40.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/a16869d2e56f50d9b7ce9b7b09ec5028/models-40.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/a784472c972571b781136798f316d345/models-40.png))

![image](_build/html/plot_directive/models-40.svg)![image](_build/html/plot_directive/models-40_dark.svg)

#### rectangle

### qpdk.models.rectangle(f=5000000000.0, length=1000, cross_section='cpw')

S-parameter model for a rectangular section, wrapped to [`straight()`](#qpdk.models.straight).

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** (*Float*) – Physical length in µm
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the waveguide.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/3dbdc599d5af9ee05c3914736f3d33e6/models-41.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/cf10e17fef75862a4e706707da8e0150/models-41.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/751043b301c28cbe6c64c17bfaa8c3a7/models-41.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/4bd4f602eea1259d516e8d3c61b76c9a/models-41.png))

![image](_build/html/plot_directive/models-41.svg)![image](_build/html/plot_directive/models-41_dark.svg)

#### straight

### qpdk.models.straight(f=5000000000.0, length=10.0, cross_section='cpw')

S-parameter model for a straight coplanar waveguide.

Wraps [`sax.models.rf.coplanar_waveguide()`](https://gdsfactory.github.io/sax/models_rf/#sax.models.rf.coplanar_waveguide), extracting the physical
dimensions from the given *cross_section* and the PDK layer stack.

Computes S-parameters analytically using conformal-mapping CPW theory
following Simons [[Sim01](#id89)] (ch. 2)
and the Qucs-S CPW model ([Qucs technical documentation](https://qucs.sourceforge.net/docs/technical/technical.pdf), §12.4).
Conductor thickness corrections use the first-order model of
Gupta, Garg, Bahl, and Bhartia [[GGBB96](#id50)].

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** (*FloatArrayLike*) – Physical length in µm
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the waveguide.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/86dfefe6a420d3af481251825053d1d1/models-42.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/714682ad8dc3e9c0ea4f38cd68aea68b/models-42.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/dca657fc9962ecc3111b49f72d259327/models-42.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/4067493cb3e95a82d5c70066cc18e486/models-42.png))

![image](_build/html/plot_directive/models-42.svg)![image](_build/html/plot_directive/models-42_dark.svg)

#### straight_all_angle

### qpdk.models.straight_all_angle(f=5000000000.0, length=10.0, cross_section='cpw')

S-parameter model for a straight coplanar waveguide.

Same as [`straight()`](#qpdk.models.straight).

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** (*Float*) – Physical length in µm
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the waveguide.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/ee9677dc77c1979dfb498ff8edcd89fd/models-43.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/4597fa6c452cb00d2b8257ac1b1bab08/models-43.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/4727f2c7c35c9168c38130e9a67c2867/models-43.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/2fe2cc93ccf74e80fcf5aa61e83a69f0/models-43.png))

![image](_build/html/plot_directive/models-43.svg)![image](_build/html/plot_directive/models-43_dark.svg)

#### straight_double_open

### qpdk.models.straight_double_open(f=5000000000.0, length=10.0, cross_section='cpw')

S-parameter model for a straight waveguide with open ends.

#### NOTE
Ports `o1` and `o2` are internally open-circuited and should not be used.
They are provided to match the number of ports in the layout component.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** (*Float*) – Physical length in µm
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the waveguide.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/e14de50d5adbe019a8eed9671a37bded/models-44.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/1229f60aa9ff1df2b54990db712edad0/models-44.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/f1df216e61359d0f71892d9342ca6367/models-44.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/d22a50b1a858818683eb69e878bdbcef/models-44.png))

![image](_build/html/plot_directive/models-44.svg)![image](_build/html/plot_directive/models-44_dark.svg)

#### straight_microstrip

### qpdk.models.straight_microstrip(f=5000000000.0, length=1000, width=10.0, h=500.0, t=0.2, ep_r=11.45, tand=0.0)

S-parameter model for a straight microstrip transmission line.

Wraps [`sax.models.rf.microstrip()`](https://gdsfactory.github.io/sax/models_rf/#sax.models.rf.microstrip), mapping the qpdk parameter
names to the upstream model.

Computes S-parameters analytically using the Hammerstad-Jensen
[[HJ80](#id53)] closed-form expressions
for effective permittivity and characteristic impedance, as described
in Pozar [[MP12](#id68)] (ch. 3, §3.8).
Conductor thickness corrections follow
Gupta et al. [[GGBB96](#id50)] (§2.2.4).

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **length** (*Float*) – Physical length in µm.
  * **width** (*Float*) – Strip width in µm.
  * **h** (*Float*) – Substrate height in µm.
  * **t** (*Float*) – Conductor thickness in µm (default 0.2 µm = 200 nm).
  * **ep_r** (*Float*) – Relative permittivity of the substrate (default 11.45 for Si).
  * **tand** (*Float*) – Dielectric loss tangent (default 0 — lossless).
* **Returns:**
  S-parameters dictionary.
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/e6954448f0faa4b34400bdcc97487898/models-45.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/ff5e1b18974ce477f70bcbb3cf4e9b57/models-45.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/0c53d5de58d297f21f790f63d6040e60/models-45.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/dcc946243320f209ae29ab8223ccce73/models-45.png))

![image](_build/html/plot_directive/models-45.svg)![image](_build/html/plot_directive/models-45_dark.svg)

#### straight_open

### qpdk.models.straight_open(f=5000000000.0, length=10.0, cross_section='cpw')

S-parameter model for a straight waveguide with one open end.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** (*Float*) – Physical length in µm
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the waveguide.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/010db6904e90fc5dd0309cc03df3565d/models-46.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/1ca1c5d1b1de9b2c351c19ed9c23f09d/models-46.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/f50bb4e990c332998964924ab31e78b7/models-46.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/d7c5c8127eff04fe156279010d5f02e5/models-46.png))

![image](_build/html/plot_directive/models-46.svg)![image](_build/html/plot_directive/models-46_dark.svg)

#### straight_shorted

### qpdk.models.straight_shorted(f=5000000000.0, length=10.0, cross_section='cpw')

S-parameter model for a straight waveguide with one shorted end.

This may be used to model a quarter-wave coplanar waveguide resonator.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** (*Float*) – Physical length in µm
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the waveguide.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/389ded2e4f76f697ac28a35b56f5a1d9/models-47.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/bff9d7942ece34380811c09124202937/models-47.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/a651fa5f601fda84a6690e7d185054fe/models-47.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/589340a8f3f78182d7d83f3ed418cdb7/models-47.png))

![image](_build/html/plot_directive/models-47.svg)![image](_build/html/plot_directive/models-47_dark.svg)

#### taper_cross_section

### qpdk.models.taper_cross_section(f=5000000000.0, length=10, cross_section1='cpw', cross_section2='cpw', npoints=100)

S-parameter model for a cross-section taper using linear interpolation.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **length** (*Float*) – Physical length in µm
  * **cross_section1** (*CrossSectionSpec*) – Cross-section for the start of the taper.
  * **cross_section2** (*CrossSectionSpec*) – Cross-section for the end of the taper.
  * **npoints** ([*int*](https://docs.python.org/3/builtins/functions.html#int)) – Number of segments to divide the taper into for simulation.
    Clamped to a minimum of one segment. Ignored when both
    cross-sections have identical dimensions.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/93ef9e8a8d8183751cd3c8979ec3b933/models-48.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/98fea0e83dd61b68b724bb8824d61802/models-48.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/c082d6781db8c66caa1e6ea3125649ba/models-48.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/7fd3321bf6cf332cf20f7018a078d750/models-48.png))

![image](_build/html/plot_directive/models-48.svg)![image](_build/html/plot_directive/models-48_dark.svg)

#### tsv

### qpdk.models.tsv(f=5000000000.0, via_height=1000.0)

S-parameter model for a through-silicon via (TSV), wrapped to [`straight()`](#qpdk.models.straight).

TODO: add a constant loss channel for TSVs.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz
  * **via_height** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Physical height (length) of the TSV in µm.
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/28e58491a08961c5ce151b7168e80fb6/models-49.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/b2397f3a0fcd7c13ca7a8943e433dcac/models-49.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/c117e62c43161bee89d8e0471cef8a1d/models-49.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/6bc0bb3829ab0561043fd3b10088e6df/models-49.png))

![image](_build/html/plot_directive/models-49.svg)![image](_build/html/plot_directive/models-49_dark.svg)

<a id="models-generic"></a>

### Generic circuit elements

Opens, shorts, series and shunt elements and ideal LC resonators.

| [`electrical_short_2_port`](#qpdk.models.electrical_short_2_port)   | Electrical short 2-port connection Sax model.                   |
|----------------------------------------------------------------------------|-----------------------------------------------------------------|
| [`lc_resonator`](#qpdk.models.lc_resonator)              | LC resonator Sax model with capacitor and inductor in parallel. |
| [`lc_resonator_coupled`](#qpdk.models.lc_resonator_coupled)      | Coupled LC resonator Sax model.                                 |
| [`open`](#qpdk.models.open)                      | Return the reflection coefficient of an ideal one-port open.    |
| [`open_2_port`](#qpdk.models.open_2_port)               | Return two isolated ports with ideal open reflections.          |
| [`series_impedance`](#qpdk.models.series_impedance)          | Two-port series impedance Sax model.                            |
| [`short`](#qpdk.models.short)                     | Return the reflection coefficient of an ideal one-port short.   |
| [`short_2_port`](#qpdk.models.short_2_port)              | Electrical short 2-port connection Sax model.                   |
| [`shunt_admittance`](#qpdk.models.shunt_admittance)          | Two-port shunt admittance Sax model.                            |

#### electrical_short_2_port

### qpdk.models.electrical_short_2_port(f=5000000000.0)

Electrical short 2-port connection Sax model.

* **Parameters:**
  **f** (*FloatArrayLike*) – Array of frequency points in Hz
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/6aa56d41882e0b7ede489944be3eea9b/models-50.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/e0da84bcc156f005870b5a6e4888ec15/models-50.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/b015098d4dd739f3080ff5feaa7220ae/models-50.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/6a2d10e2f8ee6eb565a034f3f5cd33f6/models-50.png))

![image](_build/html/plot_directive/models-50.svg)![image](_build/html/plot_directive/models-50_dark.svg)

#### lc_resonator

### qpdk.models.lc_resonator(f=5000000000.0, capacitance=1e-13, inductance=1e-09, grounded=False, ground_capacitance=0.0)

LC resonator Sax model with capacitor and inductor in parallel.

The resonance frequency is given by:

![o1 ──┬──L──┬── o2
     │     │
     └──C──┘](_build/html/_images/svgbob-d2667306d552b5ac075ca1a2d075da455a500fa5.svg)![o1 ──┬──L──┬── o2
     │     │
     └──C──┘](_build/html/_images/svgbob-d2667306d552b5ac075ca1a2d075da455a500fa5_dark.svg)

If grounded=True, a 2-port short is connected to port o2:

![o1 ──┬──L──┬──.
     │     │  | "2-port ground"
     └──C──┘  |
             "o2"](_build/html/_images/svgbob-248da6029165dbf44320109b707001438a67f734.svg)![o1 ──┬──L──┬──.
     │     │  | "2-port ground"
     └──C──┘  |
             "o2"](_build/html/_images/svgbob-248da6029165dbf44320109b707001438a67f734_dark.svg)

Optional ground capacitances Cg can be added to both ports:

![     ┌────── C ──────┐
o1 ──┼────── L ──────┼── o2
     │               │
    Cg              Cg
     │               │
    GND             GND](_build/html/_images/svgbob-168aea226a47dcb815bc2a4fcba4b36739d1f17d.svg)![     ┌────── C ──────┐
o1 ──┼────── L ──────┼── o2
     │               │
    Cg              Cg
     │               │
    GND             GND](_build/html/_images/svgbob-168aea226a47dcb815bc2a4fcba4b36739d1f17d_dark.svg)
$$
f_\text{r} = \frac{1}{2 \pi \sqrt{LC}}
$$

For theory and relation to superconductors, see [[Gao08](#id45)].

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **capacitance** (*FloatArrayLike*) – Capacitance of the resonator in Farads.
  * **inductance** (*FloatArrayLike*) – Inductance of the resonator in Henries.
  * **grounded** ([*bool*](https://docs.python.org/3/builtins/functions.html#bool)) – If True, add a 2-port ground to the second port.
  * **ground_capacitance** (*FloatArrayLike*) – Parasitic capacitance to ground Cg at each port in Farads.
* **Returns:**
  S-parameters dictionary with ports o1 and o2.
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/300e1f8ff8d82f4dea5f4d878809c973/models-51.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/15a7a1b5e283b179460bf00049bf4dd8/models-51.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/c9696d3f6f9ebf3fa8f8521a186481d3/models-51.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/f20bec7821e40e5b30e9c7f510015eda/models-51.png))

![image](_build/html/plot_directive/models-51.svg)![image](_build/html/plot_directive/models-51_dark.svg)

#### lc_resonator_coupled

### qpdk.models.lc_resonator_coupled(f=5000000000.0, capacitance=1e-13, inductance=1e-09, grounded=False, ground_capacitance=0.0, coupling_capacitance=1e-14, coupling_inductance=0.0)

Coupled LC resonator Sax model.

This model extends the basic LC resonator by adding a coupling network
consisting of a parallel capacitor and inductor connected in series
to one port of the LC resonator.

The resonance frequency of the main LC resonator is given by:

$$
f_\text{r} = \frac{1}{2 \pi \sqrt{LC}}
$$

The coupling network modifies the effective coupling to the resonator.

![         +──Lc──+    +──L──+
o1 ──────│      │────|     │─── o2 or grounded o2
         +──Cc──+    +──C──+
                   "LC resonator"](_build/html/_images/svgbob-3524576d6b1004e3ea5e8aa259350d3c8035834f.svg)![         +──Lc──+    +──L──+
o1 ──────│      │────|     │─── o2 or grounded o2
         +──Cc──+    +──C──+
                   "LC resonator"](_build/html/_images/svgbob-3524576d6b1004e3ea5e8aa259350d3c8035834f_dark.svg)

Where $L_\text{c}$ and $C_\text{c}$ are the coupling inductance and capacitance, respectively.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **capacitance** (*FloatArrayLike*) – Capacitance of the main resonator in Farads.
  * **inductance** (*FloatArrayLike*) – Inductance of the main resonator in Henries.
  * **grounded** ([*bool*](https://docs.python.org/3/builtins/functions.html#bool)) – If True, the resonator is grounded.
  * **ground_capacitance** (*FloatArrayLike*) – Parasitic capacitance to ground Cg at each port in Farads.
  * **coupling_capacitance** (*FloatArrayLike*) – Coupling capacitance in Farads.
  * **coupling_inductance** (*FloatArrayLike*) – Coupling inductance in Henries.
* **Returns:**
  S-parameters dictionary with ports o1 and o2.
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/976490064899c76627b832a153b1a7f0/models-52.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/2f9c4a96b79df348c8c53b948200ddb3/models-52.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/d73409799c39f2f6e37d38f23572f279/models-52.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/522fa1eb984b673574abe20a61a2d63f/models-52.png))

![image](_build/html/plot_directive/models-52.svg)![image](_build/html/plot_directive/models-52_dark.svg)

#### open

### qpdk.models.open(f=5000000000.0)

Return the reflection coefficient of an ideal one-port open.

* **Parameters:**
  **f** (*FloatArrayLike*)
* **Return type:**
  *SDict*

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/d89b8e56164535b6a3e9100782b1e82d/models-53.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/396ad3512d3cb19ef936758f631d2230/models-53.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/d7e85b327ea2124ffe2ab177ddae2843/models-53.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/c9f87c4f88b52643b509974e0208a84c/models-53.png))

![image](_build/html/plot_directive/models-53.svg)![image](_build/html/plot_directive/models-53_dark.svg)

#### open_2_port

### qpdk.models.open_2_port(f=5000000000.0)

Return two isolated ports with ideal open reflections.

* **Parameters:**
  **f** (*FloatArrayLike*)
* **Return type:**
  *SDict*

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/f5a46ee2ceff88627664fbbb63065103/models-54.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/bc089c18913feb2f32493e32724263ae/models-54.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/0d3817385686bd20798b5d65842192e5/models-54.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/a74f0fdd0655a0711a1eb3410f7ee5d6/models-54.png))

![image](_build/html/plot_directive/models-54.svg)![image](_build/html/plot_directive/models-54_dark.svg)

#### series_impedance

### qpdk.models.series_impedance(f=5000000000.0, z=0.0, z0=50.0)

Two-port series impedance Sax model.

![o1 ─── Z ─── o2](_build/html/_images/svgbob-ed525c4f51d3841d82788eb76f18ef32fe1bd193.svg)![o1 ─── Z ─── o2](_build/html/_images/svgbob-ed525c4f51d3841d82788eb76f18ef32fe1bd193_dark.svg)

See [[MP12](#id68)] (Ch. 4, Table 4.1, Table 4.2, Problem 4.11)
for the S-parameter derivation.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **z** (*ComplexArrayLike*) – Complex impedance in Ohms.
  * **z0** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Reference characteristic impedance in Ohms.
* **Returns:**
  S-parameters dictionary with ports o1 and o2.
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/02a37dbbe3102228819a67ac739021fa/models-55.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/22595878e85ae82c43d97d1a85b41152/models-55.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/c4fe25595ed832845843ab3726565ae4/models-55.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/586f2d4408868edd3b59b494ac0c95c9/models-55.png))

![image](_build/html/plot_directive/models-55.svg)![image](_build/html/plot_directive/models-55_dark.svg)

#### short

### qpdk.models.short(f=5000000000.0)

Return the reflection coefficient of an ideal one-port short.

* **Parameters:**
  **f** (*FloatArrayLike*)
* **Return type:**
  *SDict*

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/0121f8c66801669b1aeb3b177c7c7712/models-56.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/fbe18f6eb9255056056aa3ed78aa758b/models-56.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/12310fae165f81493d7df850b5e076ba/models-56.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/4015bd2f01a7b87e8d8dbd51bc3fe463/models-56.png))

![image](_build/html/plot_directive/models-56.svg)![image](_build/html/plot_directive/models-56_dark.svg)

#### short_2_port

### qpdk.models.short_2_port(f=5000000000.0)

Electrical short 2-port connection Sax model.

* **Parameters:**
  **f** (*FloatArrayLike*) – Array of frequency points in Hz
* **Returns:**
  S-parameters dictionary
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/9fda219d3f66896d58d9c7400ff31abc/models-57.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/75df0a36119a56ea5681b855fe7bac53/models-57.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/b3721d788e7b0c902dc6598217bc3db9/models-57.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/941104b8be63e92d69d7e731783587cc/models-57.png))

![image](_build/html/plot_directive/models-57.svg)![image](_build/html/plot_directive/models-57_dark.svg)

#### shunt_admittance

### qpdk.models.shunt_admittance(f=5000000000.0, y=0.0, z0=50.0)

Two-port shunt admittance Sax model.

![o1 ──┬── o2
     │
     Y
     │
    GND](_build/html/_images/svgbob-bb64a39e4c0978127f11d1e6751dc5f9b21a4816.svg)![o1 ──┬── o2
     │
     Y
     │
    GND](_build/html/_images/svgbob-bb64a39e4c0978127f11d1e6751dc5f9b21a4816_dark.svg)

See [[MP12](#id68)] (Ch. 4, Table 4.1, Table 4.2, Problem 4.11)
for the S-parameter derivation.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Array of frequency points in Hz.
  * **y** (*ComplexArrayLike*) – Complex admittance in Siemens.
  * **z0** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Reference characteristic impedance in Ohms.
* **Returns:**
  S-parameters dictionary with ports o1 and o2.
* **Return type:**
  sax.SDict

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/b462e73e6f1b491f50b15b37d817523c/models-58.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/f81ae2b24efbe28dd135a8c55ff94734/models-58.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/08662c20e993bee0d0a593a4cc26a54b/models-58.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/7eedf70966cd2d498878995cc854c0b2/models-58.png))

![image](_build/html/plot_directive/models-58.svg)![image](_build/html/plot_directive/models-58_dark.svg)

<a id="models-sax-other"></a>

### Other

| [`resonator_meander`](#qpdk.models.resonator_meander)   | Model the meander by its total CPW electrical length.   |
|----------------------------------------------------------------------|---------------------------------------------------------|

#### resonator_meander

### qpdk.models.resonator_meander(f=5000000000.0, length=3700.0, cross_section='cpw')

Model the meander by its total CPW electrical length.

Bends are approximated as straight CPW of equal length. The layout’s
meander count, bend specification, and end-bend setting do not alter this
electrical model, matching the pre-section whole-device model.

* **Returns:**
  Two-port SAX S-parameters for the meander path.
* **Parameters:**
  * **f** (*FloatArrayLike*)
  * **length** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **cross_section** (*CrossSectionSpec*)
* **Return type:**
  *SDict*

([`Source code`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/4563734aa724ee8bb54934ef87c1e2e3/models-59.py), [`svg`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/2f8e3077fff9fc37246b5f74876ad44f/models-59.svg), [`pdf`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/e53c0b1ab9fa833410984c15f13c8aa1/models-59.pdf), [`png`](https://gdsfactory.github.io/quantum-rf-pdk/_downloads/eda52cb35bf381a9f1507a74133e0518/models-59.png))

![image](_build/html/plot_directive/models-59.svg)![image](_build/html/plot_directive/models-59_dark.svg)

<a id="models-helpers"></a>

## Helper functions

Analytical formulas, parameter conversions and Hamiltonians used to build and design with the SAX models above.

<a id="models-transmission-lines"></a>

### Transmission-line parameters

Effective permittivity, characteristic impedance and propagation of CPW and microstrip lines.

| [`cpw_epsilon_eff`](#qpdk.models.cpw_epsilon_eff)                 | Effective permittivity of a CPW on a finite-height substrate.                  |
|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| [`cpw_parameters`](#qpdk.models.cpw_parameters)                  | Compute complex effective permittivity and characteristic impedance for a CPW. |
| [`cpw_thickness_correction`](#qpdk.models.cpw_thickness_correction)        | Apply conductor thickness correction to CPW ε_eff and Z₀.                      |
| [`cpw_z0`](#qpdk.models.cpw_z0)                          | Characteristic impedance of a CPW.                                             |
| [`cpw_z0_from_cross_section`](#qpdk.models.cpw_z0_from_cross_section)       | Characteristic impedance of a CPW defined by a layout cross-section.           |
| [`microstrip_epsilon_eff`](#qpdk.models.microstrip_epsilon_eff)          | Effective permittivity of a microstrip line.                                   |
| [`microstrip_thickness_correction`](#qpdk.models.microstrip_thickness_correction) | Conductor thickness correction for a microstrip line.                          |
| [`microstrip_z0`](#qpdk.models.microstrip_z0)                   | Characteristic impedance of a microstrip line.                                 |
| [`propagation_constant`](#qpdk.models.propagation_constant)            | Complex propagation constant of a quasi-TEM transmission line.                 |
| [`transmission_line_s_params`](#qpdk.models.transmission_line_s_params)      | S-parameters of a uniform transmission line (ABCD→S conversion).               |

#### cpw_epsilon_eff

### qpdk.models.cpw_epsilon_eff(w, s, h, ep_r)

Effective permittivity of a CPW on a finite-height substrate.

$$
\begin{aligned}
k_0 &= \frac{w}{w + 2s} \\
k_1 &= \frac{\sinh(\pi w / 4h)}{\sinh\bigl(\pi(w + 2s) / 4h\bigr)} \\
q_1 &= \frac{K(k_1^2)/K(1 - k_1^2)}{K(k_0^2)/K(1 - k_0^2)}  \\
\varepsilon_{\mathrm{eff}} &= 1 + \frac{q_1(\varepsilon_r - 1)}{2}
\end{aligned}
$$

where $K$ is the complete elliptic integral of the first kind in
the *parameter* convention ($m = k^2$).

### References

Simoons, Eq. 2.37;
Ghione & Naldi

* **Parameters:**
  * **w** (*FloatArrayLike*) – Centre-conductor width (m).
  * **s** (*FloatArrayLike*) – Gap to ground plane (m).
  * **h** (*FloatArrayLike*) – Substrate height (m).
  * **ep_r** (*FloatArrayLike*) – Relative permittivity of the substrate.
* **Returns:**
  Effective permittivity (dimensionless).
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

#### cpw_parameters

### qpdk.models.cpw_parameters(width, gap, , tand=None)

Compute complex effective permittivity and characteristic impedance for a CPW.

Uses the JAX-jittable functions from [`sax.models.rf`](https://gdsfactory.github.io/sax/models_rf/#sax.models.rf) with the
PDK layer stack (substrate height, conductor thickness, material
permittivity).

Dielectric loss is included via the filling factor $q$ and the
provided *tand*:

$$
\varepsilon_{\text{eff, complex}} = \varepsilon_{\text{eff}} \left( 1 - j q \frac{\varepsilon_\text{r}}{\varepsilon_{\text{eff}}} \tan \delta \right)
$$

where $q = (\varepsilon_{\text{eff}} - 1) / (\varepsilon_\text{r} - 1)$.

Conductor thickness corrections follow
Gupta, Garg, Bahl & Bhartia [[GGBB96](#id50)]
(§7.3, Eqs. 7.98-7.100).

* **Parameters:**
  * **width** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Centre-conductor width in µm.
  * **gap** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Gap between centre conductor and ground plane in µm.
  * **tand** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *None*) – Loss tangent $\tan\,\delta$ of the substrate. If None, uses the PDK default.
* **Returns:**
  `(ep_eff, z0)` — complex effective permittivity (dimensionless) and
  characteristic impedance (Ω).
* **Return type:**
  [*tuple*](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array), [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)]

#### cpw_thickness_correction

### qpdk.models.cpw_thickness_correction(w, s, t, ep_eff)

Apply conductor thickness correction to CPW ε_eff and Z₀.

First-order correction from Gupta, Garg, Bahl & Bhartia

$$
\begin{aligned}
\Delta &= \frac{1.25\,t}{\pi}
\left(1 + \ln\frac{4\pi w}{t}\right) \\
k_e    &= k_0 + (1 - k_0^2)\,\frac{\Delta}{2s} \\
\varepsilon_{\mathrm{eff},t}
&= \varepsilon_{\mathrm{eff}}
- \frac{0.7\,(\varepsilon_{\mathrm{eff}} - 1)\,t/s}
{K(k_0^2)/K(1-k_0^2) + 0.7\,t/s} \\
Z_{0,t} &= \frac{30\pi}
{\sqrt{\varepsilon_{\mathrm{eff},t}}\;
K(k_e^2)/K(1-k_e^2)}
\end{aligned}
$$

### References

Gupta, Garg, Bahl & Bhartia, §7.3, Eqs. 7.98-7.100

* **Parameters:**
  * **w** (*FloatArrayLike*) – Centre-conductor width (m).
  * **s** (*FloatArrayLike*) – Gap to ground plane (m).
  * **t** (*FloatArrayLike*) – Conductor thickness (m).
  * **ep_eff** (*FloatArrayLike*) – Uncorrected effective permittivity.
* **Returns:**
  `(ep_eff_t, z0_t)` — thickness-corrected effective permittivity
  and characteristic impedance (Ω).
* **Return type:**
  [*tuple*](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[*Any*](https://docs.python.org/3/library/typing.html#typing.Any), [*Any*](https://docs.python.org/3/library/typing.html#typing.Any)]

#### cpw_z0

### qpdk.models.cpw_z0(w, s, ep_eff)

Characteristic impedance of a CPW.

$$
Z_0 = \frac{30\pi}{\sqrt{\varepsilon_{\mathrm{eff}}} K(k_0^2)/K(1 - k_0^2)}
$$

### References

Simons, Eq. 2.38.
Note that our $w$ and $s$ correspond to Simons’ $s$ and $w$.

* **Parameters:**
  * **w** (*FloatArrayLike*) – Centre-conductor width (m).
  * **s** (*FloatArrayLike*) – Gap to ground plane (m).
  * **ep_eff** (*FloatArrayLike*) – Effective permittivity (see [`cpw_epsilon_eff()`](#qpdk.models.cpw_epsilon_eff)).
* **Returns:**
  Characteristic impedance (Ω).
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

#### cpw_z0_from_cross_section

### qpdk.models.cpw_z0_from_cross_section(cross_section, f=None)

Characteristic impedance of a CPW defined by a layout cross-section.

* **Parameters:**
  * **cross_section** (*CrossSectionSpec*) – A gdsfactory cross-section specification.
  * **f** (*ArrayLike* *|* *None*) – Frequency array (Hz). Used only to determine the output shape;
    the impedance is frequency-independent in the quasi-static model.
* **Returns:**
  Characteristic impedance broadcast to the shape of *f* (Ω).
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

#### microstrip_epsilon_eff

### qpdk.models.microstrip_epsilon_eff(w, h, ep_r)

Effective permittivity of a microstrip line.

Uses the Hammerstad-Jensen formula as given in Pozar.

$$
\varepsilon_{\mathrm{eff}} = \frac{\varepsilon_r + 1}{2}
+ \frac{\varepsilon_r - 1}{2} \left(\frac{1}{\sqrt{1 + 12h/w}}
+ 0.04(1 - w/h)^2 \Theta(1 - w/h)\right)
$$

where the last term contributes only for narrow strips ($w/h < 1$).

### References

Hammerstad & Jensen;
Pozar, Eqs. 3.195-3.196.

* **Parameters:**
  * **w** (*FloatArrayLike*) – Strip width (m).
  * **h** (*FloatArrayLike*) – Substrate height (m).
  * **ep_r** (*FloatArrayLike*) – Relative permittivity of the substrate.
* **Returns:**
  Effective permittivity (dimensionless).
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

#### microstrip_thickness_correction

### qpdk.models.microstrip_thickness_correction(w, h, t, ep_r, ep_eff)

Conductor thickness correction for a microstrip line.

Uses the widely-adopted Schneider correction as presented in
Pozar and Gupta et al.

$$
\begin{aligned}
w_e &= w + \frac{t}{\pi}
\ln\frac{4e}{\sqrt{(t/h)^2 + (t/(wPI + 1.1tPI))^2}} \\
\varepsilon_{\mathrm{eff},t}
&= \varepsilon_{\mathrm{eff}}
- \frac{(\varepsilon_r - 1)\,t/h}
{4.6\,\sqrt{w/h}}
\end{aligned}
$$

Then the corrected $Z_0$ is computed with the effective width
$w_e$ and corrected $\varepsilon_{\mathrm{eff},t}$.

### References

Pozar, §3.8;
Gupta, Garg, Bahl & Bhartia

* **Parameters:**
  * **w** (*FloatArrayLike*) – Strip width (m).
  * **h** (*FloatArrayLike*) – Substrate height (m).
  * **t** (*FloatArrayLike*) – Conductor thickness (m).
  * **ep_r** (*FloatArrayLike*) – Relative permittivity of the substrate.
  * **ep_eff** (*FloatArrayLike*) – Uncorrected effective permittivity.
* **Returns:**
  `(w_eff, ep_eff_t, z0_t)` — effective width (m),
  thickness-corrected effective permittivity,
  and characteristic impedance (Ω).
* **Return type:**
  [*tuple*](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array), [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array), [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)]

#### microstrip_z0

### qpdk.models.microstrip_z0(w, h, ep_eff)

Characteristic impedance of a microstrip line.

Uses the Hammerstad-Jensen approximation as given in
Pozar.

$$
\begin{aligned}
Z_0 = \begin{cases}
\displaystyle\frac{60}{\sqrt{\varepsilon_{\mathrm{eff}}}}
\ln\!\left(\frac{8h}{w} + \frac{w}{4h}\right)
& w/h \le 1 \\[6pt]
\displaystyle\frac{120\pi}
{\sqrt{\varepsilon_{\mathrm{eff}}}\,
\bigl[w/h + 1.393 + 0.667\ln(w/h + 1.444)\bigr]}
& w/h \ge 1
\end{cases}
\end{aligned}
$$

### References

Hammerstad & Jensen;
Pozar, Eqs. 3.197-3.198.

* **Parameters:**
  * **w** (*FloatArrayLike*) – Strip width (m).
  * **h** (*FloatArrayLike*) – Substrate height (m).
  * **ep_eff** (*FloatArrayLike*) – Effective permittivity (see [`microstrip_epsilon_eff()`](#qpdk.models.microstrip_epsilon_eff)).
* **Returns:**
  Characteristic impedance (Ω).
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

#### propagation_constant

### qpdk.models.propagation_constant(f, ep_eff, tand=0.0, ep_r=1.0)

Complex propagation constant of a quasi-TEM transmission line.

For the general lossy case

$$
\gamma = \alpha_d + j\,\beta
$$

where the **dielectric attenuation** is

$$
\alpha_d = \frac{\pi f}{C_{M_S}}
\frac{\varepsilon_r}{\sqrt{\varepsilon_{\mathrm{eff}}}}
\frac{\varepsilon_{\mathrm{eff}} - 1}
{\varepsilon_r - 1}
\tan\delta
$$

and the **phase constant** is

$$
\beta = \frac{2\pi f}{C_{M_S}}\,\sqrt{\varepsilon_{\mathrm{eff}}}
$$

For a superconducting line ($\tan\delta = 0$) the propagation
is purely imaginary: $\gamma = j\beta$.

### References

Pozar, §3.8

* **Parameters:**
  * **f** (*FloatArrayLike*) – Frequency (Hz).
  * **ep_eff** (*FloatArrayLike*) – Effective permittivity.
  * **tand** (*FloatArrayLike*) – Real dielectric loss tangent (default 0 — lossless).
  * **ep_r** (*FloatArrayLike*) – Substrate relative permittivity (only needed when `tand > 0`).
* **Returns:**
  Complex propagation constant $\gamma$ (1/m).
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

#### transmission_line_s_params

### qpdk.models.transmission_line_s_params(gamma, z0, length, z_ref=None)

S-parameters of a uniform transmission line (ABCD→S conversion).

The ABCD matrix of a line with characteristic impedance $Z_0$,
propagation constant $\gamma$, and length $\ell$ is:

$$
\begin{aligned}
\begin{pmatrix} A & B \\ C & D \end{pmatrix}
= \begin{pmatrix}
\cosh\theta & Z_0\sinh\theta \\
\sinh\theta / Z_0 & \cosh\theta
\end{pmatrix}, \quad \theta = \gamma\ell
\end{aligned}
$$

Converting to S-parameters referenced to $Z_{\mathrm{ref}}$

$$
\begin{aligned}
S_{11} &= \frac{A + B/Z_{\mathrm{ref}} - CZ_{\mathrm{ref}} - D}{
A + B/Z_{\mathrm{ref}} + CZ_{\mathrm{ref}} + D} \\
S_{21} &= \frac{2}{A + B/Z_{\mathrm{ref}} + CZ_{\mathrm{ref}} + D}
\end{aligned}
$$

When `z_ref` is `None` the reference impedance defaults to `z0`
(matched case), giving $S_{11} = 0$ and
$S_{21} = e^{-\gamma\ell}$.

### References

Pozar, Table 4.2

* **Parameters:**
  * **gamma** (*ComplexLike*) – Complex propagation constant (1/m).
  * **z0** (*ComplexLike*) – Characteristic impedance (Ω).
  * **length** (*FloatArrayLike*) – Physical length (m).
  * **z_ref** (*ComplexLike* *|* *None*) – Reference (port) impedance (Ω).  Defaults to `z0`.
* **Returns:**
  `(S11, S21)` — complex S-parameter arrays.
* **Return type:**
  [*tuple*](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array), [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)]

<a id="models-qubit-parameters"></a>

### Qubit parameters

Conversions between circuit energies, capacitances and inductances, and unimon spectra.

| [`coupling_strength_to_capacitance`](#qpdk.models.coupling_strength_to_capacitance)   | Convert coupling strength $g$ to coupling capacitance $C_\text{c}$.           |
|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| [`double_pad_transmon_capacitance`](#qpdk.models.double_pad_transmon_capacitance)    | Return the capacitance seen by charge moving between the two pads, in F.      |
| [`double_pad_transmon_fem_model`](#qpdk.models.double_pad_transmon_fem_model)      | Build a linearized transmon circuit from the stored two-pad Palace matrix.    |
| [`ec_to_capacitance`](#qpdk.models.ec_to_capacitance)                  | Convert charging energy $E_\text{C}$ to total capacitance $C_\Sigma$.         |
| [`ej_to_inductance`](#qpdk.models.ej_to_inductance)                   | Convert Josephson energy $E_\text{J}$ to Josephson inductance $L_\text{J}$.   |
| [`el_to_arm_inductance`](#qpdk.models.el_to_arm_inductance)               | Convert inductive energy $E_\text{L}$ to geometric inductance of one arm $L$. |
| [`el_to_inductance`](#qpdk.models.el_to_inductance)                   | Convert Josephson energy $E_\text{J}$ to Josephson inductance $L_\text{J}$.   |
| [`flipmon_ideal_bond_model`](#qpdk.models.flipmon_ideal_bond_model)           | Join inner and top pads with an ideal wire, then add a linearized junction.   |
| [`flipmon_readout_coupon_model`](#qpdk.models.flipmon_readout_coupon_model)       | Return the complete static readout coupon as a JAX SAX model.                 |
| [`flipmon_unbonded_model`](#qpdk.models.flipmon_unbonded_model)             | Return the three-electrode electrostatic coupon as a JAX SAX model.           |
| [`unimon_energies`](#qpdk.models.unimon_energies)                    | Compute the lowest energy eigenvalues of the unimon Hamiltonian.              |
| [`unimon_frequency_and_anharmonicity`](#qpdk.models.unimon_frequency_and_anharmonicity) | Compute the qubit transition frequency and anharmonicity of the unimon.       |
| [`unimon_hamiltonian`](#qpdk.models.unimon_hamiltonian)                 | Build the unimon Hamiltonian matrix in the harmonic-oscillator basis.         |

#### coupling_strength_to_capacitance

### qpdk.models.coupling_strength_to_capacitance(g_ghz, c_sigma, c_r, f_q_ghz, f_r_ghz)

Convert coupling strength $g$ to coupling capacitance $C_\text{c}$.

In the dispersive limit ($g \ll f_\text{q}, f_\text{r}$), the coupling strength
can be related to a coupling capacitance via:

$$
g \approx \frac{1}{2} \frac{C_\text{c}}{\sqrt{C_\Sigma C_\text{r}}} \sqrt{f_\text{q} f_\text{r}}
$$

Solving for $C_\text{c}$:

$$
C_\text{c} = \frac{2g}{\sqrt{f_\text{q} f_\text{r}}} \sqrt{C_\Sigma C_\text{r}}
$$

See [[KKY+19](#id62), [Sav23](#id87)] for details.

* **Parameters:**
  * **g_ghz** (*ArrayLike*) – Coupling strength in GHz.
  * **c_sigma** (*ArrayLike*) – Total qubit capacitance in Farads.
  * **c_r** (*ArrayLike*) – Total resonator capacitance in Farads.
  * **f_q_ghz** (*ArrayLike*) – Qubit frequency in GHz.
  * **f_r_ghz** (*ArrayLike*) – Resonator frequency in GHz.
* **Returns:**
  Coupling capacitance in Farads.
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

### Example

```pycon
>>> C_c = coupling_strength_to_capacitance(
...     g_ghz=0.1,
...     c_sigma=100e-15,  # 100 fF
...     c_r=50e-15,  # 50 fF
...     f_q_ghz=5.0,
...     f_r_ghz=7.0,
... )
>>> print(f"{C_c * 1e15:.2f} fF")
```

#### double_pad_transmon_capacitance

### qpdk.models.double_pad_transmon_capacitance(, pad_width=250.0, pad_height=400.0, pad_gap=20.0, ground_clearance=200.0)

Return the capacitance seen by charge moving between the two pads, in F.

Both pads float inside a 300 um wide coplanar ground frame on silicon.
Dimensions are in um. The stored Palace matrix includes pad-to-pad and
pad-to-ground fields; `differential_capacitance()`
combines them for equal and opposite pad charges.

The junction and neighbouring devices are omitted. Add the junction’s
capacitance in parallel before computing $E_\text{C}=e^2/(2C)$.
Dimensions outside the stored grid return NaN. Supports JIT, vmap and grad.

* **Returns:**
  Differential pad capacitance in F, excluding the junction capacitance.
* **Parameters:**
  * **pad_width** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **pad_height** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **pad_gap** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **ground_clearance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

#### double_pad_transmon_fem_model

### qpdk.models.double_pad_transmon_fem_model(, inductance, junction_capacitance=0.0)

Build a linearized transmon circuit from the stored two-pad Palace matrix.

Supply the Josephson inductance in H and additional junction capacitance
in F. The returned JAX model accepts frequency in Hz, `z_ref` in ohms,
and `pad_width`, `pad_height`, `pad_gap`, `ground_clearance` in um.
Its `left_pad` and `right_pad` ports both reference the finite ground
frame. All pad-to-ground and mutual capacitances are retained.

This describes small oscillations, not the nonlinear qubit spectrum.
No readout, feedline, package lid or backside ground is included.
See `junction_model()` for the circuit convention.

* **Returns:**
  Jittable two-port SAX model with explicit junction parameters.
* **Parameters:**
  * **inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **junction_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
* **Return type:**
  *Model*

#### ec_to_capacitance

### qpdk.models.ec_to_capacitance(ec_ghz)

Convert charging energy $E_\text{C}$ to total capacitance $C_\Sigma$.

The charging energy is related to capacitance by:

$$
E_\text{C} = \frac{e^2}{2 C_\Sigma}
$$

where $e$ is the electron charge.

* **Parameters:**
  **ec_ghz** (*ArrayLike*) – Charging energy in GHz.
* **Returns:**
  Total capacitance in Farads.
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

### Example

```pycon
>>> C = ec_to_capacitance(0.2)  # 0.2 GHz (200 MHz) charging energy
>>> print(f"{C * 1e15:.1f} fF")  # ~96 fF
```

#### ej_to_inductance

### qpdk.models.ej_to_inductance(ej_ghz)

Convert Josephson energy $E_\text{J}$ to Josephson inductance $L_\text{J}$.

The Josephson energy is related to inductance by:

$$
E_\text{J} = \frac{\Phi_0^2}{4 \pi^2 L_\text{J}} = \frac{(\hbar / 2e)^2}{L_\text{J}}
$$

This is equivalent to:

$$
L_\text{J} = \frac{\Phi_0}{2 \pi I_\text{c}}
$$

where $I_\text{c}$ is the critical current and $\Phi_0$ is the magnetic flux quantum.

* **Parameters:**
  **ej_ghz** (*ArrayLike*) – Josephson energy in GHz.
* **Returns:**
  Josephson inductance in Henries.
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

### Example

```pycon
>>> L = ej_to_inductance(20.0)  # 20 GHz Josephson energy
>>> print(f"{L * 1e9:.2f} nH")  # ~1.0 nH
```

#### el_to_arm_inductance

### qpdk.models.el_to_arm_inductance(el_ghz)

Convert inductive energy $E_\text{L}$ to geometric inductance of one arm $L$.

The total inductive energy $E_\text{L}$ of the unimon is related to the
geometric inductance of its two arms (in series) by:

$$
E_\text{L} = \frac{\Phi_0^2}{4 \pi^2 \cdot 2 L}
    = \frac{(\hbar / 2e)^2}{2 L}
$$

Solving for the inductance $L$ of a single arm:

$$
L = \frac{\Phi_0^2}{8 \pi^2 E_\text{L}}
$$

* **Parameters:**
  **el_ghz** (*ArrayLike*) – Inductive energy in GHz.
* **Returns:**
  Geometric inductance of one arm in Henries.
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

### Example

```pycon
>>> L = el_to_arm_inductance(5.0)  # 5 GHz inductive energy
>>> print(f"{L * 1e9:.2f} nH")
```

#### el_to_inductance

### qpdk.models.el_to_inductance(ej_ghz)

Convert Josephson energy $E_\text{J}$ to Josephson inductance $L_\text{J}$.

The Josephson energy is related to inductance by:

$$
E_\text{J} = \frac{\Phi_0^2}{4 \pi^2 L_\text{J}} = \frac{(\hbar / 2e)^2}{L_\text{J}}
$$

This is equivalent to:

$$
L_\text{J} = \frac{\Phi_0}{2 \pi I_\text{c}}
$$

where $I_\text{c}$ is the critical current and $\Phi_0$ is the magnetic flux quantum.

* **Parameters:**
  **ej_ghz** (*ArrayLike*) – Josephson energy in GHz.
* **Returns:**
  Josephson inductance in Henries.
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

### Example

```pycon
>>> L = ej_to_inductance(20.0)  # 20 GHz Josephson energy
>>> print(f"{L * 1e9:.2f} nH")  # ~1.0 nH
```

#### flipmon_ideal_bond_model

### qpdk.models.flipmon_ideal_bond_model(, inductance, junction_capacitance=0.0)

Join inner and top pads with an ideal wire, then add a linearized junction.

Supply the Josephson inductance in H and additional junction capacitance
in F. The returned JAX model accepts the same geometry and frequency
arguments as [`flipmon_unbonded_model()`](#qpdk.models.flipmon_unbonded_model). Its ports are `inner_pad`
and `outer_ring`, both referenced to chip ground.

The ideal wire preserves capacitance to ground but adds no bump field or
inductance. This reduction has no finite-bump validation and describes
small oscillations, not the nonlinear qubit spectrum. See
`junction_model()` for the circuit convention.

* **Returns:**
  Jittable two-port model with explicit junction parameters.
* **Parameters:**
  * **inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
  * **junction_capacitance** ([*float*](https://docs.python.org/3/builtins/functions.html#float))
* **Return type:**
  *Model*

#### flipmon_readout_coupon_model

### qpdk.models.flipmon_readout_coupon_model()

Return the complete static readout coupon as a JAX SAX model.

The ports include a separate unbonded top pad in addition to
`island_a`, `island_b`, `readout` and `feedline`. Each port
references chip ground. The returned model accepts `pad_length`,
`pad_offset`, `feedline_gap` and `coupling_length` in um,
frequency `f` in Hz and `z_ref` in ohms.

The feedline ends are cut open and the entire readout conductor shares
one potential. This does not describe a shorted resonator mode. Adding
it to a distributed circuit would duplicate route and ground capacitance.
No driven/eigenmode or resonance validation is implied.

* **Returns:**
  Jittable five-port static coupon model; out-of-grid inputs return NaN.
* **Return type:**
  *Model*

#### flipmon_unbonded_model

### qpdk.models.flipmon_unbonded_model()

Return the three-electrode electrostatic coupon as a JAX SAX model.

`inner_pad`, `outer_ring` and `top_pad` remain separate ports, all
referenced to the two chip ground frames. The coupon has two 300 um
silicon chips and 0.2 um metal. It omits the junction and bonding bump.
The returned model accepts `chip_gap`, `alignment`, `inner_radius`
and `top_radius` in um, frequency `f` in Hz and `z_ref` in ohms.
Alignment shifts the top pad horizontally while ground frames stay fixed.
Dimensions outside the stored grid return NaN.

* **Returns:**
  Jittable three-port model retaining all Maxwell capacitances.
* **Return type:**
  *Model*

#### unimon_energies

### qpdk.models.unimon_energies(ec_ghz=1.0, el_ghz=5.0, ej_ghz=10.0, phi_ext=3.141592653589793, n_max=30, n_levels=5)

Compute the lowest energy eigenvalues of the unimon Hamiltonian.

Diagonalises the Hamiltonian returned by [`unimon_hamiltonian()`](#qpdk.models.unimon_hamiltonian) and
returns the `n_levels` lowest eigenvalues, shifted so that the ground
state energy is zero.

* **Parameters:**
  * **ec_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Charging energy $E_\text{C}$ in GHz.
  * **el_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Inductive energy $E_\text{L}$ in GHz.
  * **ej_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Josephson energy $E_\text{J}$ in GHz.
  * **phi_ext** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – External flux $\varphi_{\text{ext}}$ in radians.
  * **n_max** ([*int*](https://docs.python.org/3/builtins/functions.html#int)) – Basis truncation, see [`unimon_hamiltonian()`](#qpdk.models.unimon_hamiltonian).
  * **n_levels** ([*int*](https://docs.python.org/3/builtins/functions.html#int)) – Number of lowest energy levels to return.
* **Returns:**
  Array of shape `(n_levels,)` with energies in GHz,
  referenced to the ground state.
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

### Example

```pycon
>>> energies = unimon_energies(ec_ghz=1.0, el_ghz=5.0, ej_ghz=10.0)
>>> f_01 = float(energies[1])  # qubit frequency in GHz
>>> alpha = float(energies[2] - 2 * energies[1])  # anharmonicity
```

#### unimon_frequency_and_anharmonicity

### qpdk.models.unimon_frequency_and_anharmonicity(ec_ghz=1.0, el_ghz=5.0, ej_ghz=10.0, phi_ext=3.141592653589793, n_max=30)

Compute the qubit transition frequency and anharmonicity of the unimon.

The qubit frequency is

$$
f_{01} = E_1 - E_0
$$

and the anharmonicity is

$$
\alpha = (E_2 - E_1) - (E_1 - E_0) = E_2 - 2 E_1
$$

(since $E_0 = 0$ after shifting).

* **Parameters:**
  * **ec_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Charging energy $E_\text{C}$ in GHz.
  * **el_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Inductive energy $E_\text{L}$ in GHz.
  * **ej_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Josephson energy $E_\text{J}$ in GHz.
  * **phi_ext** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – External flux $\varphi_{\text{ext}}$ in radians.
  * **n_max** ([*int*](https://docs.python.org/3/builtins/functions.html#int)) – Basis truncation, see [`unimon_hamiltonian()`](#qpdk.models.unimon_hamiltonian).
* **Returns:**
  Tuple of (frequency_ghz, anharmonicity_ghz).
* **Return type:**
  [*tuple*](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[*float*](https://docs.python.org/3/builtins/functions.html#float), [*float*](https://docs.python.org/3/builtins/functions.html#float)]

### Example

```pycon
>>> f01, alpha = unimon_frequency_and_anharmonicity(
...     ec_ghz=1.0, el_ghz=5.0, ej_ghz=10.0
... )
>>> print(f"f_01 = {f01:.3f} GHz, alpha = {alpha:.3f} GHz")
```

#### unimon_hamiltonian

### qpdk.models.unimon_hamiltonian(ec_ghz=1.0, el_ghz=5.0, ej_ghz=10.0, phi_ext=3.141592653589793, n_max=30)

Build the unimon Hamiltonian matrix in the harmonic-oscillator basis.

The effective single-mode unimon Hamiltonian is

$$
\hat{H} = 4 E_\text{C} \hat{n}^2
         + \tfrac{1}{2} E_\text{L} (\hat{\varphi} - \varphi_{\text{ext}})^2
         - E_\text{J} \cos\hat{\varphi}
$$

**Energy Scales and Physics**:
- $E_\text{J}$: The Josephson energy of the single non-linear junction.
- $E_\text{C}$: The effective charging energy. The large geometric capacitance

> of the CPW resonator means this is lower than typical transmons.
- $E_\text{L}$: The inductive energy provided by the CPW resonator shunting
  the junction. The unimon operates in the regime $E_\text{L} \sim E_\text{J}$.

**Similarities to Fluxonium**:
The effective single-mode circuit model of the unimon is mathematically identical
to a fluxonium qubit. The inductive shunt (provided by the CPW resonators)
guarantees there are no isolated superconducting islands, making the unimon
intrinsically immune to dephasing caused by low-frequency $1/f$ charge noise.

**Phase and Charge Operators**:
Because the unimon is inductively shunted, its potential energy features a
quadratic term $\tfrac{1}{2} E_\text{L} \hat{\varphi}^2$, meaning the potential
is **not** $2\pi$-periodic. Thus, the phase operator $\hat{\varphi}$
must be treated as an extended, non-compact variable. Consequently, the
conjugate charge variable $n$ is continuous, rather than taking discrete
integer values as it does for a transmon.

*Note on this implementation*: The Hamiltonian is represented in the
eigenbasis of the harmonic part $4 E_\text{C} \hat{n}^2
+ \tfrac{1}{2} E_\text{L} \hat{\varphi}^2$, truncated to
$2 n_{\max} + 1$ states, with
$\hat{\varphi} = \varphi_\text{zpf} (\hat{a} + \hat{a}^\dagger)$,
$\hat{n} = \tfrac{i}{2 \varphi_\text{zpf}} (\hat{a}^\dagger - \hat{a})$ and
$\varphi_\text{zpf} = (2 E_\text{C} / E_\text{L})^{1/4}$.
$\cos\hat{\varphi}$ is evaluated from the eigendecomposition of the
truncated $\hat{\varphi}$.

See [[HKC+22](#id56)] and [[TVT+24](#id92)].

* **Parameters:**
  * **ec_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Charging energy $E_\text{C}$ in GHz.
  * **el_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Inductive energy $E_\text{L}$ in GHz.
  * **ej_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Josephson energy $E_\text{J}$ in GHz.
  * **phi_ext** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – External flux bias $\varphi_{\text{ext}}$
    in radians (reduced flux-quantum units).
    The optimal operating point is $\pi$.
  * **n_max** ([*int*](https://docs.python.org/3/builtins/functions.html#int)) – Basis truncation; Hilbert-space dimension is
    $2 n_{\max} + 1$.
* **Returns:**
  A `(2*n_max+1, 2*n_max+1)` Hermitian matrix (in GHz).
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

<a id="models-perturbation"></a>

### Perturbation theory

Transmon frequency and anharmonicity, dispersive shifts, Purcell decay, linewidths and dephasing.

| [`dispersive_shift`](#qpdk.models.dispersive_shift)                     | Compute the dispersive shift numerically.                                   |
|---------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| [`dispersive_shift_to_coupling`](#qpdk.models.dispersive_shift_to_coupling)         | Compute the coupling strength from a target dispersive shift.               |
| [`ej_ec_to_frequency_and_anharmonicity`](#qpdk.models.ej_ec_to_frequency_and_anharmonicity) | Convert $E_\text{J}$ and $E_\text{C}$ to qubit frequency and anharmonicity. |
| [`measurement_induced_dephasing`](#qpdk.models.measurement_induced_dephasing)        | Estimate measurement-induced dephasing rate.                                |
| [`purcell_decay_rate`](#qpdk.models.purcell_decay_rate)                   | Estimate the Purcell decay rate of a transmon through a resonator.          |
| [`resonator_linewidth_from_q`](#qpdk.models.resonator_linewidth_from_q)           | Compute resonator linewidth from external quality factor.                   |

#### dispersive_shift

### qpdk.models.dispersive_shift(ω_t_ghz, ω_r_ghz, α_ghz, g_ghz)

Compute the dispersive shift numerically.

Evaluates the second-order dispersive shift for a transmon coupled
to a resonator. Uses the analytical formula derived from perturbation
theory (without the rotating wave approximation)
[[BGGW21](#id34), [KYG+07](#id61)]:

$$
\chi = \frac{2g^2}{\Delta - \alpha}
     - \frac{2g^2}{\Delta}
     - \frac{2g^2}{\omega_\text{t} + \omega_\text{r} + \alpha}
     + \frac{2g^2}{\omega_\text{t} + \omega_\text{r}}
$$

where $\Delta = \omega_\text{t} - \omega_\text{r}$.  The first two terms give
the rotating-wave-approximation (RWA) contribution

$$
\chi_\text{RWA} = \frac{2 \alpha g^2}{\Delta(\Delta - \alpha)}
$$

and the last two are corrections from the counter-rotating terms.

All parameters are in GHz, and the returned value is also in GHz.

* **Parameters:**
  * **ω_t_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Transmon frequency in GHz.
  * **ω_r_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Resonator frequency in GHz.
  * **α_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Transmon anharmonicity in GHz (positive value).
  * **g_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Coupling strength in GHz.
* **Returns:**
  Dispersive shift $\chi$ in GHz.
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

### Example

```pycon
>>> χ = dispersive_shift(5.0, 7.0, 0.2, 0.1)
>>> print(f"χ = {χ * 1e3:.2f} MHz")
```

#### dispersive_shift_to_coupling

### qpdk.models.dispersive_shift_to_coupling(χ_ghz, ω_t_ghz, ω_r_ghz, α_ghz)

Compute the coupling strength from a target dispersive shift.

Inverts the dispersive shift relation to find the coupling strength
$g$ required to achieve a desired $\chi$.  Uses only the
dominant rotating-wave term
[[KYG+07](#id61)]:

$$
g \approx \sqrt{\frac{-\chi\,\Delta\,(\Delta - \alpha)}{2\alpha}}
$$

where $\Delta = \omega_\text{t} - \omega_\text{r}$.

#### NOTE
The expression under the square root may be negative when the
sign of the target $\chi$ is inconsistent with the detuning
and anharmonicity (e.g., positive $\chi$ with
$\Delta < 0$).  In that case the absolute value is taken
so that the returned coupling strength is always real and
non-negative, but the caller should verify self-consistency
via [`dispersive_shift()`](#qpdk.models.dispersive_shift).

* **Parameters:**
  * **χ_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Target dispersive shift in GHz (typically negative).
  * **ω_t_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Transmon frequency in GHz.
  * **ω_r_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Resonator frequency in GHz.
  * **α_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Transmon anharmonicity in GHz (positive value;
    the physical anharmonicity of a transmon is negative, but
    following the Hamiltonian convention used throughout this
    module, $\alpha$ is taken as positive).
* **Returns:**
  Coupling strength $g$ in GHz.
* **Return type:**
  [*float*](https://docs.python.org/3/builtins/functions.html#float) | [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

### Example

```pycon
>>> g = dispersive_shift_to_coupling(-0.001, 5.0, 7.0, 0.2)
>>> print(f"g = {g * 1e3:.1f} MHz")
```

#### ej_ec_to_frequency_and_anharmonicity

### qpdk.models.ej_ec_to_frequency_and_anharmonicity(ej_ghz, ec_ghz)

Convert $E_\text{J}$ and $E_\text{C}$ to qubit frequency and anharmonicity.

Uses the standard transmon approximations
[[KYG+07](#id61)]:

$$
\begin{aligned}
\omega_\text{q} &\approx \sqrt{8 E_\text{J} E_\text{C}} - E_\text{C} \\
\alpha &\approx E_\text{C}
\end{aligned}
$$

#### NOTE
The physical anharmonicity of a transmon is *negative*
($\alpha = -E_\text{C}$), but the Hamiltonian convention used
in this module and in pymablock takes $\alpha$ as positive.

* **Parameters:**
  * **ej_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Josephson energy in GHz.
  * **ec_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Charging energy in GHz.
* **Returns:**
  Tuple of `(ω_q_ghz, α_ghz)`.
* **Return type:**
  [*tuple*](https://docs.python.org/3/builtins/stdtypes.html#tuple)[[*float*](https://docs.python.org/3/builtins/functions.html#float) | [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array), [*float*](https://docs.python.org/3/builtins/functions.html#float) | [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)]

### Example

```pycon
>>> ω_q, α = ej_ec_to_frequency_and_anharmonicity(20.0, 0.2)
>>> print(f"ω_q = {ω_q:.2f} GHz, α = {α:.1f} GHz")
```

#### measurement_induced_dephasing

### qpdk.models.measurement_induced_dephasing(χ_ghz, κ_ghz, n_bar)

Estimate measurement-induced dephasing rate.

During dispersive readout, photons in the resonator cause
additional dephasing of the qubit
[[BGGW21](#id34), [GBS+06](#id44)]:

$$
\Gamma_\phi = \frac{8 \chi^2 \bar{n}}{\kappa}
$$

where $\bar{n}$ is the mean photon number in the resonator.

* **Parameters:**
  * **χ_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Dispersive shift in GHz.
  * **κ_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Resonator linewidth in GHz.
  * **n_bar** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Mean photon number in the resonator during measurement.
* **Returns:**
  Measurement-induced dephasing rate in GHz.
* **Return type:**
  [*float*](https://docs.python.org/3/builtins/functions.html#float) | [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

### Example

```pycon
>>> Γ_φ = measurement_induced_dephasing(-0.001, 0.001, 5.0)
>>> print(f"Γ_φ = {Γ_φ * 1e6:.1f} kHz")
```

#### purcell_decay_rate

### qpdk.models.purcell_decay_rate(g_ghz, ω_t_ghz, ω_r_ghz, κ_ghz)

Estimate the Purcell decay rate of a transmon through a resonator.

The Purcell effect limits qubit lifetime when coupled to a lossy
resonator.  In the dispersive regime
[[BGGW21](#id34), [HSJ+08](#id55)]:

$$
\gamma_\text{Purcell} = \kappa \left(\frac{g}{\Delta}\right)^2
$$

where $\kappa$ is the resonator decay rate and
$\Delta = \omega_\text{t} - \omega_\text{r}$.

* **Parameters:**
  * **g_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Coupling strength in GHz.
  * **ω_t_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Transmon frequency in GHz.
  * **ω_r_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Resonator frequency in GHz.
  * **κ_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Resonator linewidth (decay rate) in GHz.
* **Returns:**
  Purcell decay rate in GHz.
* **Return type:**
  [*float*](https://docs.python.org/3/builtins/functions.html#float) | [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

### Example

```pycon
>>> γ = purcell_decay_rate(0.1, 5.0, 7.0, 0.001)
>>> T_purcell = 1 / (γ * 1e9)
>>> print(f"T_Purcell = {T_purcell * 1e6:.0f} µs")
```

#### resonator_linewidth_from_q

### qpdk.models.resonator_linewidth_from_q(ω_r_ghz, q_ext)

Compute resonator linewidth from external quality factor.

Converts external quality factor to linewidth (half-linewidth at half-maximum)
[[GFB+08](#id48), [MP12](#id68)]:

$$
\kappa = \frac{\omega_\text{r}}{Q_\text{ext}}
$$

* **Parameters:**
  * **ω_r_ghz** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – Resonator frequency in GHz.
  * **q_ext** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *TypeAliasForwardRef* *(* *'ArrayLike'* *)*) – External quality factor.
* **Returns:**
  Resonator linewidth $\kappa$ in GHz.
* **Return type:**
  [*float*](https://docs.python.org/3/builtins/functions.html#float) | [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

### Example

```pycon
>>> κ = resonator_linewidth_from_q(7.0, 10_000)
>>> print(f"κ = {κ * 1e6:.1f} kHz")
```

<a id="models-component-helpers"></a>

### Component helpers

Closed-form estimates for resonators, couplers and inductors.

| [`cpw_cpw_coupling_capacitance`](#qpdk.models.cpw_cpw_coupling_capacitance)           | Look up Palace coupling capacitance between two parallel CPWs.              |
|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| [`meander_inductor_inductance_analytical`](#qpdk.models.meander_inductor_inductance_analytical) | Analytical formula for meander inductor inductance.                         |
| [`resonator_frequency`](#qpdk.models.resonator_frequency)                    | Calculate the resonance frequency of a quarter- or half-wave CPW resonator. |

#### cpw_cpw_coupling_capacitance

### qpdk.models.cpw_cpw_coupling_capacitance(f, length, gap, cross_section)

Look up Palace coupling capacitance between two parallel CPWs.

The uniform sheet dataset supplies mutual capacitance per length. Values
outside its width, outer-slot and inter-trace-gap domain return NaN.
Its inner ground strip has width `max(gap - 2 * cpw_gap, 0)`, matching
the etch masks of `coupler_straight`.
Dielectric half-space scaling accounts for cross-section permittivity;
kinetic inductance, thickness and fringing are omitted.

* **Parameters:**
  * **f** (*FloatArrayLike*) – Frequency array in Hz.
  * **length** (*ArrayLike*) – The coupling length in µm.
  * **gap** (*ArrayLike*) – The gap between the two center conductors in µm.
  * **cross_section** (*CrossSectionSpec*) – The cross-section of the CPW.
* **Returns:**
  The total coupling capacitance in Farads.
* **Return type:**
  [*float*](https://docs.python.org/3/builtins/functions.html#float) | [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

#### NOTE
Raises `ValueError` via `get_cpw_dimensions()`
if the cross-section has no section with ‘etch’ in its name, so the
CPW gap cannot be determined, or if the conductor width or etch gap
is not positive.

#### meander_inductor_inductance_analytical

### qpdk.models.meander_inductor_inductance_analytical(n_turns, turn_length, wire_width, wire_gap, sheet_inductance, thickness=None)

Analytical formula for meander inductor inductance.

The total inductance is the sum of geometric and kinetic contributions:

$$
L_{\text{total}} = L_\text{g} + L_\text{k}
$$

The geometric inductance $L_\text{g}$ is calculated by summing the
self-inductances of all horizontal segments and the mutual inductances
between all pairs of parallel segments, following
[[CSD+23](#id37)]:

$$
L_\text{g} = N L_\text{s} + 2 \sum_{k=1}^{N-1} (N-k) (-1)^k L_\text{m}(k p)
$$

where $N$ is the number of turns and $p$ is the pitch.

The kinetic inductance $L_\text{k}$ is calculated from the sheet
inductance $L_\square$:

$$
L_\text{k} = L_\square \cdot \frac{\ell_{\text{total}}}{w}
$$

* **Parameters:**
  * **n_turns** ([*int*](https://docs.python.org/3/builtins/functions.html#int)) – Number of horizontal meander runs.
  * **turn_length** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Length of each horizontal run in µm.
  * **wire_width** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Width of the meander wire in µm.
  * **wire_gap** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Gap between adjacent meander runs in µm.
  * **sheet_inductance** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Sheet inductance per square in H/□.
  * **thickness** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *None*) – Thickness of the metal film in µm. If None, it is
    fetched from the PDK technology parameters.
* **Returns:**
  Total inductance in Henries.
* **Return type:**
  [*Array*](https://docs.jax.dev/en/latest/_autosummary/jax.Array.html#jax.Array)

#### resonator_frequency

### qpdk.models.resonator_frequency(, length, epsilon_eff=None, media=None, cross_section='cpw', is_quarter_wave=True)

Calculate the resonance frequency of a quarter- or half-wave CPW resonator.

$$
\begin{aligned}
f &= \frac{v_\text{p}}{4L}  \text{(quarter-wave resonator)} \\
f &= \frac{v_\text{p}}{2L}  \text{(half-wave resonator)}
\end{aligned}
$$

The phase velocity is $v_\text{p} = c_0 / \sqrt{\varepsilon_{\text{eff}}}$.

See [[MP12](#id68), [Sim01](#id89)] for details.

* **Parameters:**
  * **length** ([*float*](https://docs.python.org/3/builtins/functions.html#float)) – Length of the resonator in μm.
  * **epsilon_eff** ([*float*](https://docs.python.org/3/builtins/functions.html#float) *|* *None*) – Effective permittivity.  If `None` (default),
    computed from *cross_section* using [`cpw_parameters()`](#qpdk.models.cpw_parameters).
  * **media** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any)) – Deprecated. Use *epsilon_eff* or *cross_section* instead.
  * **cross_section** (*CrossSectionSpec*) – Cross-section specification (used only when
    *epsilon_eff* and *media* are not provided).
  * **is_quarter_wave** ([*bool*](https://docs.python.org/3/builtins/functions.html#bool)) – If True, calculates for a quarter-wave resonator; if False, for a half-wave resonator.
    default is True.
* **Returns:**
  Resonance frequency in Hz.
* **Return type:**
  [*float*](https://docs.python.org/3/builtins/functions.html#float)

## References
