# How to Select the Optimal Resonator Type (Quarter-Wave vs Half-Wave) for Qubit Applications in SQuADDS

> Choose the ideal resonator for your qubit. Learn when to use quarter-wave vs half-wave resonators in SQuADDS for optimal performance and coupling.

- Repository: [Levenson-Falk Lab/squadds](https://github.com/lfl-lab/squadds)
- Tags: how-to-guide
- Published: 2026-03-06

---

**Select quarter-wave resonators for compact, single-ended read-out lines using the CLT coupler (resonator factor N=4), and half-wave resonators for symmetric coupling configurations requiring the NCap coupler (N=2).**

Selecting the optimal resonator type in SQuADDS is a critical design-level decision that determines your coupler selection, database query paths, and the physics formulas governing qubit-resonator interactions. This choice between quarter-wave and half-wave configurations propagates through the entire simulation pipeline, from component selection in [`squadds/core/db.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/core/db.py) to coupling strength calculations in [`squadds/simulations/utils.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/simulations/utils.py).

## Resonator Type Fundamentals in SQuADDS

SQuADDS supports two primary resonator geometries that map to distinct coupler types and physical characteristics. Understanding these differences is essential for matching your qubit application to the correct electromagnetic architecture.

### Quarter-Wave Resonator Characteristics

- **Coupler type**: `CLT` (capacitive-line-to-transmon)
- **Resonator factor**: `N = 4` (λ/4 wavelength)
- **Physical footprint**: Compact, ideal for dense read-out lines
- **Best for**: Single-ended read-out resonators requiring small footprint or high impedance configurations

### Half-Wave Resonator Characteristics

- **Coupler type**: `NCap` (symmetric N-type capacitor)
- **Resonator factor**: `N = 2` (λ/2 wavelength)
- **Physical footprint**: Longer resonator enabling symmetric coupling at both ends
- **Best for**: Designs requiring symmetric coupling to multiple elements (qubit-to-cavity-to-feedline) or higher coupling capacitance

## Programmatic Selection via the Database API

In [`squadds/core/db.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/core/db.py), the `select_resonator_type()` method validates your choice and maps it to the appropriate coupler implementation. The method stores the selection in `self.selected_resonator_type` and configures the internal state for subsequent database queries.

```python
from squadds.core.db import DB

# Initialize the database object

db = DB()

# Select quarter-wave for CLT coupler and compact designs

db.select_resonator_type("quarter")  # N = 4, uses CLT

# Or select half-wave for NCap coupler and symmetric coupling

# db.select_resonator_type("half")   # N = 2, uses NCap

```

According to the source code in [[`squadds/core/db.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/core/db.py)](https://github.com/lfl-lab/squadds/blob/master/squadds/core/db.py#L24-L41), this method enforces valid inputs (`"quarter"` or `"half"`) and automatically configures the coupler selection logic used by subsequent database queries.

## Physics Implications and the Resonator Factor N

The resonator type directly impacts electromagnetic calculations through the **resonator factor** `N`, which appears in the capacitance formula `C_r = π/(N·ω_r·Z₀)`. In [`squadds/simulations/utils.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/simulations/utils.py), the `find_g_a_fq()` function uses this factor to compute anharmonicity (`a`), qubit frequency (`f_q`), and coupling strength (`g`).

```python
import numpy as np
from squadds.simulations.utils import find_g_a_fq

# Example parameters (SI units)

C_g = 30e-15    # Coupling capacitance (F)

C_B = 20e-15    # Qubit self-capacitance (F)

f_r = 5e9       # Resonator frequency (Hz)

Lj  = 10e-9     # Josephson inductance (H)

# Quarter-wave: N = 4 yields smaller C_r

a_q, f_q_q, g_q = find_g_a_fq(C_g, C_B, f_r, Lj, N=4)

# Half-wave: N = 2 yields larger C_r, typically stronger coupling

a_h, f_q_h, g_h = find_g_a_fq(C_g, C_B, f_r, Lj, N=2)

print(f"Quarter-wave: a={a_q:.2f} MHz, f_q={f_q_q:.3f} GHz, g={g_q:.2f} MHz")
print(f"Half-wave:    a={a_h:.2f} MHz, f_q={f_q_h:.3f} GHz, g={g_h:.2f} MHz")

```

As implemented in [[`squadds/simulations/utils.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/simulations/utils.py)](https://github.com/lfl-lab/squadds/blob/master/squadds/simulations/utils.py#L19-L26), the smaller `N` value for half-wave resonators produces larger resonator capacitance, which generally results in stronger coupling strength `g` for identical geometric parameters.

## Workflow Impact on Design Generation

The resonator selection propagates to the analysis pipeline in [`squadds/core/analysis.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/core/analysis.py), where the design generation logic branches based on `selected_resonator_type`.

- **Quarter-wave**: Returns a single consolidated `design_options` entry optimized for compact single-ended configurations using the `CLT` coupler.
- **Half-wave**: Constructs a merged design dictionary with separate entries for the qubit, coupler, and cavity components to accommodate the symmetric `NCap` geometry.

This branching logic appears in [[`squadds/core/analysis.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/core/analysis.py)](https://github.com/lfl-lab/squadds/blob/master/squadds/core/analysis.py#L33-L48), where the method filters target parameters differently depending on whether the design requires the `CLT` or `NCap` coupler architecture.

## Interactive Selection in the Streamlit UI

For interactive workflows, SQuADDS provides Streamlit integration in [`squadds/ui/app.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/ui/app.py). The UI mirrors the programmatic API, allowing real-time resonator type switching.

```python
import streamlit as st
from squadds.core.db import DB

db = DB()
resonator_choice = st.selectbox("Select Resonator Type", ["quarter", "half"])
db.select_resonator_type(resonator_choice)

st.success(f"Configured for **{resonator_choice}** wave resonator with appropriate coupler")

```

The implementation in [[`squadds/ui/app.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/ui/app.py)](https://github.com/lfl-lab/squadds/blob/master/squadds/ui/app.py#L121-L127) demonstrates how the database object persists this selection across UI sessions, ensuring consistent component querying.

## Decision Criteria for Specific Qubit Applications

Use this checklist to determine the optimal resonator type for your SQuADDS design:

- **Choose quarter-wave** when you need:
  - Compact, single-ended read-out resonators for dense layouts
  - The `CLT` coupler for low-loss transmon configurations
  - High impedance in a minimal physical footprint
  - The `N = 4` factor for specific coupling strength requirements

- **Choose half-wave** when you need:
  - Symmetric coupling to multiple elements (qubit-to-cavity-to-feedline)
  - The `NCap` coupler for stronger, symmetric coupling scenarios
  - Longer physical resonators to match specific frequency-length constraints on your chip layout
  - The `N = 2` factor for increased resonator capacitance

## Summary

- **Quarter-wave resonators** (`N=4`) use the `CLT` coupler and suit compact, single-ended read-out applications.
- **Half-wave resonators** (`N=2`) use the `NCap` coupler and enable symmetric coupling configurations.
- Select the resonator type programmatically via `db.select_resonator_type()` in [`squadds/core/db.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/core/db.py).
- The choice affects physics calculations through the resonator factor `N` in `find_g_a_fq()` within [`squadds/simulations/utils.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/simulations/utils.py).
- Design generation logic branches differently for each type in [`squadds/core/analysis.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/core/analysis.py), producing distinct output dictionaries.
- Interactive selection is available through the Streamlit interface in [`squadds/ui/app.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/ui/app.py).

## Frequently Asked Questions

### What is the fundamental difference between quarter-wave and half-wave resonators in SQuADDS?

Quarter-wave resonators utilize the `CLT` (capacitive-line-to-transmon) coupler with a resonator factor of `N=4`, making them ideal for compact, single-ended designs. Half-wave resonators employ the `NCap` (symmetric N-type capacitor) coupler with `N=2`, providing longer physical structures suitable for symmetric coupling to multiple circuit elements. This distinction determines the electromagnetic coupling architecture throughout the design pipeline.

### How does the resonator type selection affect coupling strength calculations?

The resonator type determines the **resonator factor** `N` used in the capacitance formula `C_r = π/(N·ω_r·Z₀)` within [`squadds/simulations/utils.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/simulations/utils.py). Quarter-wave resonators use `N=4`, yielding smaller resonator capacitance, while half-wave resonators use `N=2`, producing larger capacitance that typically results in stronger coupling strength `g` for equivalent geometric parameters. The `find_g_a_fq()` function requires explicit specification of this `N` parameter to return accurate anharmonicity, frequency, and coupling values.

### Can I switch resonator types after initializing the SQuADDS database?

Yes, you can change the resonator type at any time by calling `db.select_resonator_type()` with either `"quarter"` or `"half"`. This method updates `self.selected_resonator_type` in the database object and automatically reconfigures the internal coupler selection logic. However, existing design objects generated under a previous resonator type may need regeneration to reflect the new coupling architecture and physics parameters.

### Which coupler types correspond to each resonator type in the SQuADDS architecture?

Quarter-wave resonators automatically map to the **`CLT`** coupler, commonly used for low-loss transmon read-out lines in compact configurations. Half-wave resonators map to the **`NCap`** coupler, which provides symmetric coupling capabilities essential for complex cavity-qubit-feedline configurations. This mapping is enforced in [`squadds/core/db.py`](https://github.com/lfl-lab/squadds/blob/main/squadds/core/db.py) and propagates through the database query system to ensure component compatibility.