Palace CPW Simulation — Wave Ports¶
Simulate an 800 µm IHP coplanar waveguide (CPW) with wave ports, sweep 300 frequencies from 1 to 100 GHz, and plot S-parameter magnitude and phase.
Requirements:
- IHP PDK:
uv pip install ihp-gdsfactory - GDSFactory+ account for cloud simulation
For multiple lengths and a comparison of both port types, see the CPW length sweep and de-embedding notebook.
Define GSG electrode¶
import gdsfactory as gf
from ihp import LAYER, PDK
PDK.activate()
@gf.cell
def gsg_electrode(
length: float = 800,
s_width: float = 20,
g_width: float = 40,
gap_width: float = 15,
layer=LAYER.TopMetal2drawing,
) -> gf.Component:
"""
Create a GSG (Ground-Signal-Ground) electrode.
Args:
length: horizontal length of the electrodes
s_width: width of the signal (center) electrode
g_width: width of the ground electrodes
gap_width: gap between signal and ground electrodes
layer: layer for the metal
"""
c = gf.Component()
r1 = c << gf.c.rectangle((length, g_width), centered=True, layer=layer)
r1.move((0, (g_width + s_width) / 2 + gap_width))
_r2 = c << gf.c.rectangle((length, s_width), centered=True, layer=layer)
r3 = c << gf.c.rectangle((length, g_width), centered=True, layer=layer)
r3.move((0, -(g_width + s_width) / 2 - gap_width))
c.add_port(
name="o1",
center=(-length / 2, 0),
width=s_width,
orientation=180,
port_type="electrical",
layer=layer,
)
c.add_port(
name="o2",
center=(length / 2, 0),
width=s_width,
orientation=0,
port_type="electrical",
layer=layer,
)
return c
c = gsg_electrode()
cc = c.copy()
cc.draw_ports()
cc

Configure simulation¶
The wave ports span the full meshed airbox boundary (max_size=True). Both ports are excited in separate solves to obtain the full two-port S-matrix.
from gsim.common.stack import get_stack
from gsim.palace import DrivenSim
sim = DrivenSim()
sim.set_output_dir(f"./palace-sim-cpw-waveport-default-{c.name}")
sim.set_geometry(c)
stack = get_stack() # auto-detects the active PDK
sim.set_stack(stack)
sim.set_airbox(margin_x=0.0, margin_y=50, z_above=100.0, z_below=100.0)
for port_name in ["o1", "o2"]:
sim.add_wave_port(
port_name,
layer="topmetal2",
max_size=True,
mode=1,
excited=True,
eigensolver_type="Default",
eigensolver_tol=1e-6,
eigensolver_ksp_tol=1e-8,
eigensolver_max_size=40,
eigensolver_verbose=0,
)
sim.set_driven(fmin=1e9, fmax=100e9, num_points=300)
print(sim.validate_config())
pyvirtualdisplay not available; continuing without Xvfb
Validation: PASSED
Generate mesh¶
Mesh Summary
========================================
Dimensions: 800.0 x 230.0 x 217.9 µm
Nodes: 36,019
Elements: 262,194
Tetrahedra: 192,468
Edge length: 1.16 - 76.81 µm
Quality: 0.631 (min: 0.006)
SICN: 0.682 (all valid)
Worst element distortion, κ: 419.416 (tet centers; 1 is ideal)
Estimated Field DOFs: 1,250,304 (order 2; before Palace preprocessing)
Mesh hash: sha256:c4310388fb8d5904 (gmsh 4.15.2, gsim 0.6.0)
Mesher: 2D algorithm 5, 3D algorithm 1, threads 1 (1D/2D/3D limits 1/1/1)
----------------------------------------
Volumes (3):
- sio2 [1]
- sin [2]
- air [3]
Surfaces (9):
- topmetal2_xy [4]
- topmetal2_z [5]
- P1 [6]
- P2 [7]
- sio2__None [8]
- air__sio2 [9]
- sin__sio2 [10]
- air__sin [11]
- air__None [12]
----------------------------------------
Mesh: palace-sim-cpw-waveport-default-gsg_electrode_L800_SW20_GW40_GW15_LTopMetal2drawing/palace.msh
Inspect mesh¶
sim.plot_mesh(
style="solid",
transparent_groups=["air__None", "SiO2__None", "SiO2__passive", "air__passive"],
interactive=True,
)
pyvirtualdisplay not available; continuing without Xvfb
[0m[33m2026-10-02 04:22:06.137 ( 15.152s) [ 7F8F7D168080]vtkXOpenGLRenderWindow.:1452 WARN| bad X server connection. DISPLAY=[0m
viz.py:728: UserWarning: No handler registered for notebook backend "trame".
Falling back to a static output.
Available backends: "static", "none"
Install trame for interactive backends: pip install trame-pyvista
plotter.show(jupyter_backend=_TRAME_BACKEND)

Run simulation¶
Run on GDSFactory+ cloud, reusing matching cached results when available. verbose="status" shows progress; use verbose="full" for solver diagnostics.
palace-1afcf1d9 [####################] 100% complete elapsed 0m 00s
Extracting results.tar.gz...
Downloaded 10 files to sim-data-palace-1afcf1d9
Plot S-parameters¶
Port mapping: Port 1: p1, Port 2: p2
Port mapping: Port 1: p1, Port 2: p2