Skip to content

Cells

C

C geometry with ports on both ends.

based on phidl.

Parameters:

Name Type Description Default
width float

of the line.

1.0
size Size

length and height of the base.

(10.0, 20.0)
layer LayerSpec

layer spec.

'WG'
port_type str

optical or electrical.

'electrical'
     ______
    |       o1
    |   ___
    |  |
    |  |___
    ||<---> size[0]
    |______ o2

L

Generates an 'L' geometry with ports on both ends.

Based on phidl.

Parameters:

Name Type Description Default
width int | float

of the line.

1
size tuple[int, int]

length and height of the base.

(10, 20)
layer LayerSpec

spec.

'MTOP'
port_type str

for port.

'electrical'

add_electrical_pads_shortest

Returns new Component with a pad by each electrical port.

Parameters:

Name Type Description Default
component ComponentSpec

to route.

'wire_straight'
pad ComponentSpec

pad element or function.

'pad'
pad_port_spacing float

spacing between pad and port.

50.0
pad_size Size | None

pad size.

None
select_ports PortsFactory

function to select ports.

select_ports_electrical
port_names Strs | None

optional port names. Overrides select_ports.

None
port_orientation AngleInDegrees

in degrees.

90
layer LayerSpec

for the routing.

'M3'
Example
import gdsfactory as gf
c = gf.components.cross(length=100, layer=(49, 0), port_type="electrical")
c = gf.routing.add_electrical_pads_shortest(c, pad_port_spacing=200)
c.plot()

add_electrical_pads_top

Returns new component with electrical ports connected to top pad array.

Parameters:

Name Type Description Default
component ComponentSpec

to route.

required
direction Literal['top', 'right']

sets direction of the array (top or right).

'top'
spacing Float2

component to pad spacing.

(0.0, 100.0)
pad_array ComponentSpec

function for pad_array.

'pad_array'
select_ports SelectPorts

function to select electrical ports.

select_ports_electrical
port_names Strs | None

optional port names. Overrides select_ports.

None
layer LayerSpec

for the routes.

'MTOP'
kwargs Any

additional arguments.

{}

Other Parameters:

Name Type Description
ports

Dict[str, Port] a port dict {port name: port}.

prefix

select ports with port name prefix.

suffix

select ports with port name suffix.

orientation

select ports with orientation in degrees.

width

select ports with port width.

layers_excluded

List of layers to exclude.

port_type

select ports with port type (optical, electrical, vertical_te).

clockwise

if True, sort ports clockwise, False: counter-clockwise.

Example
import gdsfactory as gf

c = gf.components.wire_straight(length=200.)
cc = gf.routing.add_electrical_pads_top(component=c, spacing=(-150, 30))
cc.plot()

add_electrical_pads_top_dc

Returns new component with electrical ports connected to top pad array.

Parameters:

Name Type Description Default
component ComponentSpec

component spec to connect to.

required
spacing Float2

component to pad spacing.

(0.0, 100.0)
pad_array ComponentSpec

component factor for pad_array

'pad_array270'
select_ports SelectPorts

function to select_ports.

select_ports_electrical
route_bundle_function

function to route bundle of ports.

required
port_names Strs | None

optional port names. Overrides select_ports.

None
cross_section CrossSectionSpec

cross_section for the route.

'metal_routing'
kwargs Any

route settings.

{}
Example
import gdsfactory as gf
c = gf.components.wire_straight(length=200.)
c = gf.routing.add_electrical_pads_top_dc(c, width=10)
c.plot()

add_fiber_array

Returns component with south routes and grating_couplers.

You can also use pads or other terminations instead of grating couplers.

Parameters:

Name Type Description Default
component ComponentSpec

see :func:gdsfactory.routing.add_fiber_array.add_fiber_array for details.

'straight'
grating_coupler ComponentSpecOrList

see :func:gdsfactory.routing.add_fiber_array.add_fiber_array for details.

'grating_coupler_te'
gc_port_name str

see :func:gdsfactory.routing.add_fiber_array.add_fiber_array for details.

'o1'
select_ports PortsFactory

see :func:gdsfactory.routing.add_fiber_array.add_fiber_array for details.

select_ports_optical
cross_section CrossSectionSpec

see :func:gdsfactory.routing.add_fiber_array.add_fiber_array for details.

'strip'
start_straight_length float

see :func:gdsfactory.routing.add_fiber_array.add_fiber_array for details.

0
end_straight_length float

see :func:gdsfactory.routing.add_fiber_array.add_fiber_array for details.

0
mirror_grating_coupler bool

see :func:gdsfactory.routing.add_fiber_array.add_fiber_array for details.

False
kwargs Any

see :func:gdsfactory.routing.add_fiber_array.add_fiber_array for details.

{}

add_fiber_array_optical_south_electrical_north

Returns a fiber array with Optical gratings on South and Electrical pads on North.

This a test configuration for DC pads.

Parameters:

Name Type Description Default
component ComponentSpec

component spec to add fiber and pads.

'straight_heater_metal'
pad ComponentSpec

pad spec.

'pad'
grating_coupler ComponentSpec

grating coupler function.

'grating_coupler_te'
cross_section_metal CrossSectionSpec

metal cross section.

'metal_routing'
with_loopback bool

whether to add a loopback port.

True
pad_pitch float

spacing between pads.

100.0
pitch float

spacing between grating couplers.

127.0
pad_gc_spacing float

spacing between pads and grating couplers.

250.0
electrical_port_names list[str] | None

list of electrical port names. Defaults to all.

None
electrical_port_orientation AngleInDegrees | None

orientation of electrical ports. Defaults to 90.

90
npads int | None

number of pads. Defaults to one per electrical_port_names.

None
port_types_grating_couplers list[str] | None

port types for grating couplers. Defaults to vertical TE, TM, and dual.

None
auto_taper_pads bool

whether to add a taper to the pads.

True
kwargs Any

additional arguments.

{}

Other Parameters:

Name Type Description
layer_label

layer for settings label.

measurement

measurement name.

measurement_settings

measurement settings.

analysis

analysis name.

doe

Design of Experiment.

anchor

anchor point for the label. Defaults to south-west "sw". Valid options are: "n", "s", "e", "w", "ne", "nw", "se", "sw", "c".

gc_port_name

grating coupler input port name.

gc_port_labels

grating coupler list of labels.

component_name

optional for the label.

select_ports

function to select ports.

cross_section

cross_section function.

get_input_labels_function

function to get input labels. None skips labels.

layer_label

optional layer for grating coupler label.

bend

bend spec.

straight

straight spec.

taper

taper spec.

get_input_label_text_loopback_function

function to get input label test.

get_input_label_text_function

for labels.

fanout_length

if None, automatic calculation of fanout length.

max_y0_optical

in um.

with_loopback bool

True, adds loopback structures.

straight_separation

from edge to edge.

list_port_labels

None, adds TM labels to port indices in this list.

connected_port_list_ids

names of ports only for type 0 optical routing.

nb_optical_ports_lines

number of grating coupler lines.

force_manhattan

False

excluded_ports

list of port names to exclude when adding gratings.

grating_indices

list of grating coupler indices.

routing_straight

function to route.

routing_method

route_bundle.

gc_rotation

fiber coupler rotation in degrees. Defaults to -90.

input_port_indexes

to connect.

add_fiber_single

Returns component with south routes and grating_couplers.

You can also use pads or other terminations instead of grating couplers.

Parameters:

Name Type Description Default
component ComponentSpec

component spec to connect to grating couplers.

'straight'
grating_coupler ComponentSpecOrList

spec for route terminations.

'grating_coupler_te'
gc_port_name str

grating coupler input port name.

'o1'
gc_port_name_fiber str

grating coupler output port name.

'o2'
select_ports SelectPorts

function to select ports.

select_ports_optical
cross_section CrossSectionSpec

cross_section function.

'strip'
input_port_names Sequence[str] | None

list of input port names to connect to grating couplers.

None
pitch float

spacing between fibers.

70
with_loopback bool

adds loopback structures.

True
loopback_spacing float

spacing between loopback and test structure.

100.0
straight ComponentSpec

straight spec.

'straight'
mirror_grating_coupler bool

if True, mirrors the grating coupler.

False
kwargs Any

additional arguments.

{}

Other Parameters:

Name Type Description
bend

bend spec.

straight ComponentSpec

straight spec.

fanout_length

if None, automatic calculation of fanout length.

max_y0_optical

in um.

with_loopback bool

True, adds loopback structures.

straight_separation

from edge to edge.

list_port_labels

None, adds TM labels to port indices in this list.

connected_port_list_ids

names of ports only for type 0 optical routing.

nb_optical_ports_lines

number of grating coupler lines.

force_manhattan

False

excluded_ports

list of port names to exclude when adding gratings.

grating_indices

list of grating coupler indices.

routing_straight

function to route.

routing_method

route_bundle.

gc_rotation

fiber coupler rotation in degrees. Defaults to -90.

input_port_indexes

to connect.

Example
import gdsfactory as gf

c = gf.components.crossing()
cc = gf.routing.add_fiber_array(
component=c,
grating_coupler=gf.components.grating_coupler_elliptical_te,
with_loopback=False
)
cc.plot()

add_frame

Returns component with a frame around it.

Parameters:

Name Type Description Default
component ComponentSpec

Component to frame.

'rectangle'
width float

of the frame.

10.0
spacing float

of component to frame.

10.0
layer LayerSpec

frame layer.

'WG'

add_padding_to_size

Returns component with padding layers on each side.

New size is multiple of grid size.

Parameters:

Name Type Description Default
component ComponentSpec

to add padding.

required
layers LayerSpecs

list of layers.

('PADDING',)
xsize float | None

x size to fill up in um.

None
ysize float | None

y size to fill up in um.

None
left float

left padding in um to fill up in um.

0
bottom float

bottom padding in um to fill up in um.

0

add_padding_to_size_container

Returns new component with a component reference.

Parameters:

Name Type Description Default
component ComponentSpec

to add to container.

required
function Callable[..., Any] | None

function to apply to component.

add_padding_to_size
copy_ports bool

if True, copies ports from component to container.

True
kwargs Any

keyword arguments to pass to function.

{}

add_pads_bot

Returns new component with ports connected bottom pads.

Parameters:

Name Type Description Default
component ComponentSpec

component spec to connect to.

'interdigitated_electrodes'
select_ports SelectPorts

function to select_ports.

select_ports_electrical
port_names Strs | None

optional port names. Overrides select_ports.

None
cross_section CrossSectionSpec

cross_section spec.

'metal_routing'
get_input_labels_function

function to get input labels. None skips labels.

required
layer_label

optional layer for grating coupler label.

required
pad_port_name str

pad input port name.

'e1'
pad_port_labels

pad list of labels.

required
pad ComponentSpec

spec for route terminations.

'pad_rectangular'
bend ComponentSpec

bend spec.

'wire_corner'
straight_separation float

from wire edge to edge. Defaults to xs.width+xs.gap

15.0
pad_pitch float

in um. Defaults to pad_pitch constant from the PDK.

100.0
port_type str

port type.

'electrical'
allow_width_mismatch bool

True

True
fanout_length float | None

if None, automatic calculation of fanout length.

None
route_width float | None

width of the route. If None, defaults to cross_section.width.

None
bboxes BoundingBoxes | None

list bounding boxes to avoid for routing.

None
avoid_component_bbox bool

avoid component bbox for routing.

False
auto_taper bool

adds tapers to the routing.

True
kwargs Any

additional arguments.

{}

Other Parameters:

Name Type Description
straight

straight spec.

get_input_label_text_loopback_function

function to get input label test.

get_input_label_text_function

for labels.

max_y0_optical

in um.

with_loopback

True, adds loopback structures.

list_port_labels

None, adds TM labels to port indices in this list.

connected_port_list_ids

names of ports only for type 0 optical routing.

nb_optical_ports_lines

number of grating coupler lines.

force_manhattan

False

excluded_ports

list of port names to exclude when adding gratings.

grating_indices

list of grating coupler indices.

routing_straight

function to route.

routing_method

route_bundle.

gc_rotation

fiber coupler rotation in degrees. Defaults to -90.

input_port_indexes

to connect.

allow_width_mismatch bool

True

Example
import gdsfactory as gf
c = gf.c.nxn(
xsize=600,
ysize=200,
north=2,
south=3,
wg_width=10,
layer="M3",
port_type="electrical",
)
cc = gf.routing.add_pads_bot(component=c, port_names=("e1", "e4"), fanout_length=50)
cc.plot()

add_pads_top

Returns new component with ports connected top pads.

Parameters:

Name Type Description Default
component ComponentSpec

component spec to connect to.

'interdigitated_electrodes'
select_ports SelectPorts

function to select_ports.

select_ports_electrical
port_names Strs | None

optional port names. Overrides select_ports.

None
cross_section CrossSectionSpec

cross_section spec.

'metal_routing'
get_input_labels_function

function to get input labels. None skips labels.

required
layer_label

optional layer for grating coupler label.

required
pad_port_name str

pad input port name.

'e1'
pad_port_labels

pad list of labels.

required
pad ComponentSpec

spec for route terminations.

'pad_rectangular'
bend ComponentSpec

bend spec.

'wire_corner'
straight_separation float

from wire edge to edge. Defaults to xs.width+xs.gap

15.0
pad_pitch float

in um. Defaults to pad_pitch constant from the PDK.

100.0
port_type str

port type.

'electrical'
allow_width_mismatch bool

True

True
fanout_length float | None

if None, automatic calculation of fanout length.

None
route_width float | None

width of the route. If None, defaults to cross_section.width.

0
bboxes BoundingBoxes | None

list of bounding boxes to avoid.

None
avoid_component_bbox bool

True

False
auto_taper bool

adds tapers to the routing.

True
kwargs Any

additional arguments.

{}

Other Parameters:

Name Type Description
straight

straight spec.

get_input_label_text_loopback_function

function to get input label test.

get_input_label_text_function

for labels.

max_y0_optical

in um.

with_loopback

True, adds loopback structures.

list_port_labels

None, adds TM labels to port indices in this list.

connected_port_list_ids

names of ports only for type 0 optical routing.

nb_optical_ports_lines

number of grating coupler lines.

force_manhattan

False

excluded_ports

list of port names to exclude when adding gratings.

grating_indices

list of grating coupler indices.

routing_straight

function to route.

routing_method

route_bundle.

gc_rotation

fiber coupler rotation in degrees. Defaults to -90.

input_port_indexes

to connect.

allow_width_mismatch bool

True

Example
import gdsfactory as gf
c = gf.c.nxn(
xsize=600,
ysize=200,
north=2,
south=3,
wg_width=10,
layer="M3",
port_type="electrical",
)
cc = gf.routing.add_pads_top(component=c, port_names=("e1", "e4"), fanout_length=50)
cc.plot()

add_termination

Returns component with terminator on some ports.

Parameters:

Name Type Description Default
component ComponentSpec

to add terminator.

'straight'
port_names tuple[str, ...] | None

ports to add terminator.

None
terminator ComponentSpec

factory for the terminator.

_terminator_function
terminator_port_name str | None

for the terminator to connect to the component ports.

None

add_trenches

Return inverted component with trenches.

Parameters:

Name Type Description Default
component ComponentSpec

component to add to the trenches.

'coupler'
layer_component LayerSpec

layer of the component to invert.

'WG'
layer_trench LayerSpec

layer of the trenches.

'DEEP_ETCH'
width_trench float

width of the trenches.

2.0
cross_section CrossSectionSpec | None

spec (CrossSection, string or dict).

None
top float | None

width of the trench on the top. If None uses width_trench.

None
bot float | None

width of the trench on the bottom. If None uses width_trench.

None
right float | None

width of the trench on the right. If None uses width_trench.

0
left float | None

width of the trench on the left. If None uses width_trench.

0

add_trenches90

Return inverted component with trenches.

Parameters:

Name Type Description Default
component ComponentSpec

component to add to the trenches.

'bend_euler'
layer_component LayerSpec

layer of the component to invert.

'WG'
layer_trench LayerSpec

layer of the trenches.

'DEEP_ETCH'
width_trench float

width of the trenches.

2.0
cross_section CrossSectionSpec | None

spec (CrossSection, string or dict).

None
top float | None

width of the trench on the top. If None uses width_trench.

0
bot float | None

width of the trench on the bottom. If None uses width_trench.

None
right float | None

width of the trench on the right. If None uses width_trench.

None
left float | None

width of the trench on the left. If None uses width_trench.

0

align_wafer

Returns cross inside a frame to align wafer.

Parameters:

Name Type Description Default
width float

in um.

10.0
spacing float

in um.

10.0
cross_length float

for the cross.

80.0
layer LayerSpec

for the cross.

'WG'
layer_cladding tuple[int, int] | None

optional.

None
square_corner str

bottom_left, bottom_right, top_right, top_left.

'bottom_left'

alignment_mark_cross

Custom alignment cross mark for lithography alignment.

Creates a cross shape centered at the origin composed of two overlapping rectangles (horizontal and vertical arms).

Parameters:

Name Type Description Default
arm_width float

Width of each arm in um.

2.0
arm_length float

Length of each arm in um (full extent from tip to tip is 2 * arm_length).

20.0
layer LayerSpec

Layer specification for the cross geometry.

'WG'
port_type str | None

Optional port type. If provided, ports are added at the four arm tips.

None

anchored_flexure

Returns a flexure hinge between two pads.

Two rectangular pads connected by a thin hinge, all centered vertically.

Parameters:

Name Type Description Default
hinge_width float

width of the thin flexure hinge.

0.3
hinge_length float

length of the hinge connecting the two pads.

5.0
pad_width float

width (vertical) of each pad.

10.0
pad_length float

length (horizontal) of each pad.

10.0
layer LayerSpec

layer spec.

'WG'
port_type str

port type for electrical ports.

'electrical'

array

Returns an array of components.

Parameters:

Name Type Description Default
component ComponentSpec

to replicate.

'pad'
columns int

in x.

6
rows int

in y.

1
column_pitch float

pitch between columns.

150
row_pitch float

pitch between rows.

150
auto_rename_ports bool

True to auto rename ports.

False
add_ports bool

add ports from component into the array.

True
size Size | None

Optional x, y size. Overrides columns and rows.

None
centered bool

center the array around the origin.

False
post_process PostProcesses | None

function to apply to the array after creation.

None

Raises:

Type Description
ValueError

If columns > 1 and spacing[0] = 0.

ValueError

If rows > 1 and spacing[1] = 0.

      column_pitch
      <---------->
     ___        ___       ___        ___
    |   |      |   |     |   |      |   |
    |___|      |___|     |___|      |___|
     ___        ___       ___        ___
    |   |      |   |     |   |      |   |
    |___|      |___|     |___|      |___|

array_hexagonal

Returns a hexagonal close-packed array of components.

Even rows are placed normally, odd rows are offset by pitch/2. Row spacing is pitch * sqrt(3)/2.

Parameters:

Name Type Description Default
component ComponentSpec

component to replicate.

'circle'
columns int

number of columns.

10
rows int

number of rows.

10
pitch float

spacing between adjacent elements.

25.0
centered bool

center the array around the origin.

True
add_ports bool

add ports from each element.

True

array_polar

Returns a polar/circular array of components.

Places component refs at equal angular intervals around a circle.

Parameters:

Name Type Description Default
component ComponentSpec

component to replicate.

'C'
n_items int

number of items in the array.

6
radius float

radius of the circle.

50.0
start_angle float

starting angle in degrees.

0.0
end_angle float

ending angle in degrees.

360.0
rotate_items bool

if True, rotate each item to point radially outward.

True
add_ports bool

add ports from each element.

True

arrow_junction

Returns a microfluidic arrow (Y) junction.

A main horizontal channel on the right side with two angled branches diverging to the left at ± branch_angle from horizontal. The junction point is at the origin.

Parameters:

Name Type Description Default
main_width float

width of the main horizontal channel.

1.0
branch_width float

width of each angled branch channel.

1.0
main_length float

length of the main channel (extends to the right).

20.0
branch_length float

length of each angled branch.

10.0
branch_angle float

angle of each branch from horizontal (degrees).

35.0
reservoir_radius float

radius of circular reservoirs at endpoints (0 to disable).

0.0
n_reservoir_points int

number of polygon points for reservoir circles.

64
layer LayerSpec

layer spec.

'WG'
port_type str | None

None, optical, or electrical.

'optical'

awg

Returns an Arrayed Waveguide grating.

To simulate you can use https://github.com/dnrobin/awg-python

Parameters:

Name Type Description Default
arms int

number of arms.

10
outputs int

number of outputs.

3
free_propagation_region_input_function ComponentSpec

for input.

free_propagation_region_input
free_propagation_region_output_function ComponentSpec

for output.

free_propagation_region_output
fpr_spacing float

x separation between input/output free propagation region.

50.0
arm_spacing float

y separation between arms (used when length_increment == 0).

1.0
length_increment float

constant length step dL (um); when > 0 the arms form a nested fan where arm i is exactly i*dL longer than arm 0 -- the property that makes an AWG disperse light by wavelength.

0.0
cross_section CrossSectionSpec

cross_section function.

'strip'

bbox

Returns bounding box rectangle from coordinates.

Parameters:

Name Type Description Default
component Component | ComponentReference

component or instance to get bbox from.

required
layer LayerSpec

for bbox.

required
top float

north offset.

0
bottom float

south offset.

0
left float

west offset.

0
right float

east offset.

0

bend_circular

Returns a radial arc.

Parameters:

Name Type Description Default
radius float | None

in um. Defaults to cross_section_radius.

None
angle float

angle of arc (degrees).

90.0
npoints int | None

number of points.

None
angular_step float | None

If provided, determines the angular step (in degrees) between points. Mutually exclusive with npoints.

None
layer LayerSpec | None

layer to use. Defaults to cross_section.layer.

None
width float | None

width to use. Defaults to cross_section.width.

None
cross_section CrossSectionSpec

spec (CrossSection, string or dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False

bend_circular180

Returns a radial arc.

Parameters:

Name Type Description Default
radius float | None

in um. Defaults to cross_section_radius.

None
angle float

angle of arc (degrees).

180
npoints int | None

number of points.

None
angular_step float | None

If provided, determines the angular step (in degrees) between points. Mutually exclusive with npoints.

None
layer LayerSpec | None

layer to use. Defaults to cross_section.layer.

None
width float | None

width to use. Defaults to cross_section.width.

None
cross_section CrossSectionSpec

spec (CrossSection, string or dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False

bend_circular_all_angle

Returns a radial arc.

Parameters:

Name Type Description Default
radius float | None

in um. Defaults to cross_section_radius.

None
angle float

angle of arc (degrees).

90.0
npoints int | None

number of points.

None
angular_step float | None

If provided, determines the angular step (in degrees) between points. Mutually exclusive with npoints.

None
layer LayerSpec | None

layer to use. Defaults to cross_section.layer.

None
width float | None

width to use. Defaults to cross_section.width.

None
cross_section CrossSectionSpec

spec (CrossSection, string or dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False

bend_circular_heater

Creates an arc of arclength theta starting at angle start_angle.

Parameters:

Name Type Description Default
radius float | None

in um. Defaults to cross_section.radius.

None
angle float

angle of arc (degrees).

90
npoints int | None

Number of points used per 360 degrees.

None
heater_to_wg_distance float

in um.

1.2
heater_width float

in um.

0.5
layer_heater LayerSpec

for heater.

'HEATER'
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False

bend_euler

Regular degree euler bend.

Parameters:

Name Type Description Default
radius float | None

in um. Defaults to cross_section_radius.

None
angle float

total angle of the curve.

90.0
p float

Proportion of the curve that is an Euler curve.

0.5
with_arc_floorplan bool

if True the size of the bend will be adjusted to match an arc bend with the specified radius. If False: radius is the minimum radius of curvature.

True
npoints int | None

Number of points used per 360 degrees.

None
angular_step float | None

if not None, the angle step in degrees for the all_angle bend.

None
layer LayerSpec | None

layer to use. Defaults to cross_section.layer.

None
width float | None

width to use. Defaults to cross_section.width.

None
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False

bend_euler180

Regular degree euler bend.

Parameters:

Name Type Description Default
radius float | None

in um. Defaults to cross_section_radius.

None
angle float

total angle of the curve.

180
p float

Proportion of the curve that is an Euler curve.

0.5
with_arc_floorplan bool

if True the size of the bend will be adjusted to match an arc bend with the specified radius. If False: radius is the minimum radius of curvature.

True
npoints int | None

Number of points used per 360 degrees.

None
angular_step float | None

if not None, the angle step in degrees for the all_angle bend.

None
layer LayerSpec | None

layer to use. Defaults to cross_section.layer.

None
width float | None

width to use. Defaults to cross_section.width.

None
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False

bend_euler_all_angle

Regular degree euler bend.

Parameters:

Name Type Description Default
radius float | None

in um. Defaults to cross_section_radius.

None
angle float

total angle of the curve.

90.0
p float

Proportion of the curve that is an Euler curve.

0.5
with_arc_floorplan bool

If False: radius is the minimum radius of curvature

True
npoints int | None

Number of points used per 360 degrees.

None
angular_step float | None

if not None, the angle step in degrees for the all_angle bend.

None
layer LayerSpec | None

layer to use. Defaults to cross_section.layer.

None
width float | None

width to use. Defaults to cross_section.width.

None
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False

bend_euler_s

Sbend made of 2 euler bends.

Parameters:

Name Type Description Default
radius float | None

in um. Defaults to cross_section_radius.

None
p float

Proportion of the curve that is an Euler curve.

0.5
with_arc_floorplan bool

If False: radius is the minimum radius of curvature.

True
npoints int | None

Number of points used per 360 degrees.

None
angular_step float | None

if not None, the angle step in degrees for the all_angle bend.

None
layer LayerSpec | None

layer to use. Defaults to cross_section.layer.

None
width float | None

width to use. Defaults to cross_section.width.

None
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False
port1 str

input port name.

'o1'
port2 str

output port name.

'o2'
                    _____ o2
                   /
                  /
                 /
                /
                |
               /
              /
             /
     o1_____/

bend_modified_hermite

Modified Hermite curve, described in "Low-Loss Silicon Nitride Bent Waveguides at O-Band with Modified Hermite Curves", Donghao Li et al, https://www.mdpi.com/2304-6732/13/2/175 .

Default parameters are taken from Table 3 of https://www.mdpi.com/2304-6732/13/2/175 .

Note that the default inner_tangent_magnitude and outer_tangent_magnitude parameters will need to be changed if you change radius or angle, as optimal values for those parameters depend on radius and angle.

Parameters:

Name Type Description Default
radius float

effective bend radius

15
angle float

angle, in degrees.

90.0
inner_tangent_magnitude float

a1 parameter from Li et al.

26.5
outer_tangent_magnitude float

a2 parameter from Li et al.

30
npoints int

number of points to use for the inner wall of the curve, and the outer wall.

100
cross_section CrossSectionSpec

spec (CrossSection, string or dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False
layer LayerSpec | None

layer to use. Defaults to cross_section.layer.

None
width1 float | None

width to use at input. Defaults to cross_section.width.

None
width2 float | None

width to use at output. Defaults to cross_section.width.

None
port1 str

name of input port.

'o1'
port2 str

name of output port.

'o2'

bend_modified_hermite180

Modified Hermite curve, described in "Low-Loss Silicon Nitride Bent Waveguides at O-Band with Modified Hermite Curves", Donghao Li et al, https://www.mdpi.com/2304-6732/13/2/175 .

Default parameters are taken from Table 3 of https://www.mdpi.com/2304-6732/13/2/175 .

Note that the default inner_tangent_magnitude and outer_tangent_magnitude parameters will need to be changed if you change radius or angle, as optimal values for those parameters depend on radius and angle.

Parameters:

Name Type Description Default
radius float

effective bend radius

15
angle float

angle, in degrees.

180
inner_tangent_magnitude float

a1 parameter from Li et al.

26.5
outer_tangent_magnitude float

a2 parameter from Li et al.

30
npoints int

number of points to use for the inner wall of the curve, and the outer wall.

100
cross_section CrossSectionSpec

spec (CrossSection, string or dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False
layer LayerSpec | None

layer to use. Defaults to cross_section.layer.

None
width1 float | None

width to use at input. Defaults to cross_section.width.

None
width2 float | None

width to use at output. Defaults to cross_section.width.

None
port1 str

name of input port.

'o1'
port2 str

name of output port.

'o2'

bend_modified_hermite_all_angle

Modified Hermite curve, described in "Low-Loss Silicon Nitride Bent Waveguides at O-Band with Modified Hermite Curves", Donghao Li et al, https://www.mdpi.com/2304-6732/13/2/175 .

Default parameters are taken from Table 3 of https://www.mdpi.com/2304-6732/13/2/175 .

This is the all_angle version that can handle angles that aren't integer multiples of 90 degrees.

Note that the default inner_tangent_magnitude and outer_tangent_magnitude parameters will need to be changed if you change radius or angle, as optimal values for those parameters depend on radius and angle.

Parameters:

Name Type Description Default
radius float

effective bend radius

15
angle float

angle, in degrees.

90.0
inner_tangent_magnitude float

a1 parameter from Li et al.

26.5
outer_tangent_magnitude float

a2 parameter from Li et al.

30
npoints int

number of points to use for the inner wall of the curve, and the outer wall.

100
cross_section CrossSectionSpec

spec (CrossSection, string or dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False
layer LayerSpec | None

layer to use. Defaults to cross_section.layer.

None
width1 float | None

width to use at input. Defaults to cross_section.width.

None
width2 float | None

width to use at output. Defaults to cross_section.width.

None
port1 str

name of input port.

'o1'
port2 str

name of output port.

'o2'

bend_modified_hermite_s

Sbend made of 2 modified Hermite bends.

Parameters:

Name Type Description Default
radius float

effective bend radius

15
inner_tangent_magnitude float

a1 parameter from Li et al.

26.5
outer_tangent_magnitude float

a2 parameter from Li et al.

30
npoints int

number of points to use for the inner wall of the curve, and the outer wall.

100
cross_section CrossSectionSpec

spec (CrossSection, string or dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False
layer LayerSpec | None

layer to use. Defaults to cross_section.layer.

None
width float | None

width at input and output (the width generally varies in the interior of the bend). Defaults to cross_section.width.

None
port1 str

name of input port.

'o1'
port2 str

name of output port.

'o2'

bend_s

Return S bend with bezier curve.

stores min_bend_radius property in self.info['min_bend_radius'] min_bend_radius depends on height and length

Parameters:

Name Type Description Default
size Size

in x and y direction.

(11.0, 1.8)
npoints int

number of points.

99
cross_section CrossSectionSpec

spec.

'strip'
allow_min_radius_violation bool

bool.

False
width float | None

width to use. Defaults to cross_section.width.

None

bend_s_offset

Return S bend made of two bends with a straight section.

Parameters:

Name Type Description Default
offset float

in um.

40.0
radius float | None

in um. if None, uses cross_section_radius.

10.0
cross_section CrossSectionSpec

spec.

'strip'
width float | None

width to use. Defaults to cross_section.width.

None
with_euler bool | None

deprecated, use p=0 for circular arc instead.

None
p float

1 means standard Euler bend. 0 means circular arc.

1
with_arc_floorplan bool

if True the size of the bend will be adjusted to match an arc bend with the specified radius. If False: radius is the minimum radius of curvature.

False
npoints int | None

number of points.

None
angular_step float | None

If provided, determines the angular step (in degrees) between points. Mutually exclusive with npoints.

None

bend_topic

Returns a regular degree Third Order Polynomial Interconnected Circular (TOPIC) bend component.

The implementation follows the description in this publication https://arxiv.org/html/2411.15025v1.

The bend consists of three parts: a. Initial transition from straight to bend, known as TOP segment. b. Circular part whose center and radius are calculated analytically. c. Mirroring of TOP segment with respect to the bisection of the angle.

Parameters:

Name Type Description Default
radius float | None

radius at the start and end of bend.

None
angle float

total angle of the curve in degrees.

90.0
p float

used to calculate the angle of the bend at the end of TOP / start of circular arc, as p*angle. It should be within [0, 0.5).

0.1
npoints int

Number of points used per 360 degrees.

100
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False
layer LayerSpec | None

layer to use. Defaults to cross_section.layer.

None
width float | None

width to use. Defaults to cross_section.width.

None

bend_topic180

Returns a regular degree Third Order Polynomial Interconnected Circular (TOPIC) bend component.

The implementation follows the description in this publication https://arxiv.org/html/2411.15025v1.

The bend consists of three parts: a. Initial transition from straight to bend, known as TOP segment. b. Circular part whose center and radius are calculated analytically. c. Mirroring of TOP segment with respect to the bisection of the angle.

Parameters:

Name Type Description Default
radius float | None

radius at the start and end of bend.

None
angle float

total angle of the curve in degrees.

180
p float

used to calculate the angle of the bend at the end of TOP / start of circular arc, as p*angle. It should be within [0, 0.5).

0.1
npoints int

Number of points used per 360 degrees.

100
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False
layer LayerSpec | None

layer to use. Defaults to cross_section.layer.

None
width float | None

width to use. Defaults to cross_section.width.

None

bend_topic_all_angle

Returns a Third Order Polynomial Interconnected Circular (TOPIC) bend component of arbitrary angle.

The implementation follows the description in this publication https://arxiv.org/html/2411.15025v1.

The bend consists of three parts: a. Initial transition from straight to bend, known as TOP segment. b. Circular part whose center and radius are calculated analytically. c. Mirroring of TOP segment with respect to the bisection of the angle.

Parameters:

Name Type Description Default
radius float | None

radius at the start and end of bend.

None
angle float

total angle of the curve in degrees.

90.0
p float

used to calculate the angle of the bend at the end of TOP / start of circular arc, as p*angle. It should be within [0, 0.5).

0.1
npoints int

Number of points used per 360 degrees.

100
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False
layer LayerSpec | None

layer to use. Defaults to cross_section.layer.

None
width float | None

width to use. Defaults to cross_section.width.

None

bend_topic_s

Sbend made of 2 topic bends.

Parameters:

Name Type Description Default
radius float | None

radius at the start and end of bend.

None
p float

used to calculate the angle of the bend at the end of TOP / start of circular arc, as p*angle. It should be within [0, 0.5).

0.1
npoints int

Number of points used per 360 degrees.

100
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'
allow_min_radius_violation bool

if True allows radius to be smaller than cross_section radius.

False
layer LayerSpec | None

layer to use. Defaults to cross_section.layer.

None
width float | None

width to use. Defaults to cross_section.width.

None
port1 str

input port name.

'o1'
port2 str

output port name.

'o2'
                    _____ o2
                   /
                  /
                 /
                /
                |
               /
              /
             /
     o1_____/

bent_beam

Returns a V-shaped bent beam thermal actuator.

Two straight beam segments meeting at an apex that points upward, with anchor pads at both ends.

Parameters:

Name Type Description Default
beam_width float

width of the beam.

1.0
beam_length float

length of each beam segment (center-line).

40.0
bend_angle float

angle between the two beam segments in degrees.

170.0
anchor_width float

width (vertical) of each anchor pad.

5.0
anchor_length float

length (horizontal) of each anchor pad.

5.0
layer LayerSpec

layer spec.

'WG'
port_type str

port type for electrical ports.

'electrical'

bezier

Returns Bezier bend.

Parameters:

Name Type Description Default
control_points Coordinates

list of points.

((0.0, 0.0), (5.0, 0.0), (5.0, 1.8), (10.0, 1.8))
npoints int

number of points varying between 0 and 1.

201
with_manhattan_facing_angles bool

bool.

True
start_angle int | None

optional start angle in deg.

None
end_angle int | None

optional end angle in deg.

None
cross_section CrossSectionSpec

spec.

'strip'
bend_radius_error_type ErrorType | None

error type.

None
allow_min_radius_violation bool

bool.

False
width float | None

width to use. Defaults to cross_section.width.

None

bolometer

Returns a bolometer thermal detector.

A central absorber rectangle with thin L-shaped support legs extending outward to anchor pads distributed around the perimeter.

Parameters:

Name Type Description Default
absorber_width float

width of the central absorber.

20.0
absorber_length float

length of the central absorber.

20.0
leg_width float

width of each support leg.

0.5
leg_length float

length of each support leg.

15.0
n_legs int

number of support legs (distributed around perimeter).

4
pad_width float

width of each anchor pad.

5.0
pad_length float

length of each anchor pad.

5.0
layer LayerSpec

layer spec.

'WG'
port_type str

port type for electrical ports.

'electrical'

bump_pad

Returns rectangular pad with ports.

Parameters:

Name Type Description Default
size float

octagon edge of octagon.

36.244
layer LayerSpec

bump pad layer.

'MTOP'
port_width float

width of the port for electrical routing.

10.0
port_layer LayerSpec

layer of the port for electrical routing.

'M2'
port_type str

port type for pad port.

'pad'
add_via bool

whether to add a via stack.

True

bump_pad_grid

Returns 2D array of bump pads.

Parameters:

Name Type Description Default
columns int

number of columns.

6
rows int

number of rows.

6
column_pitch float

x pitch.

121.89
row_pitch float

y pitch.

132.66
offset float

offset for alternating columns.

66.33
port_width float

width of the port for electrical routing.

10
port_layer LayerSpec

layer of the port for electrical routing.

'M2'
size float

pad size.

36.244
layer LayerSpec

bump pad layer.

'MTOP'
auto_rename_ports bool

True to auto rename ports.

False
skip_pads list[tuple[int, int]] | None

list of (col, row) tuples to skip.

None
add_via bool

whether to add a via stack.

True

cantilever

Returns a simple cantilever beam with an anchor.

A rectangular anchor on the left with a thinner beam extending to the right.

Parameters:

Name Type Description Default
beam_width float

width of the cantilever beam.

2.0
beam_length float

length of the cantilever beam.

20.0
anchor_width float

width (vertical) of the anchor pad.

5.0
anchor_length float

length (horizontal) of the anchor pad.

5.0
layer LayerSpec

layer spec.

'WG'
port_type str

port type for electrical ports.

'electrical'

cavity

Returns cavity from a coupler and a mirror.

connects the W0 port of the mirror to E1 and W1 coupler ports creating a resonant cavity

Parameters:

Name Type Description Default
component ComponentSpec

mirror.

'dbr'
coupler ComponentSpec

coupler library.

'coupler'
length float

coupler length.

0.1
gap float

coupler gap.

0.2
kwargs Any

coupler_settings.

{}
  ml (mirror left)              mr (mirror right)
   |                               |
   |o1 - o2__             __o3 - o1|
   |         \           /         |
              \         /
            ---=========---
     o1  o1    length      o4    o2

cdsem_all

Column with all optical PCMs.

Parameters:

Name Type Description Default
widths tuple[float, ...]

for straight lines.

(0.4, 0.45, 0.5, 0.6, 0.8, 1.0)
dense_lines_width float | None

in um.

0.3
dense_lines_width_difference float

in um.

0.02
dense_lines_gap float

in um.

0.3
dense_lines_labels tuple[str, ...]

strings.

('DL', 'DM', 'DH')
straight ComponentSpec

spec.

'straight'
bend90 ComponentSpec | None

spec.

'bend_circular'
cross_section CrossSectionSpec

spec.

'strip'
text ComponentSpec

spec.

'text_rectangular'
spacing float

from group to group.

5
cdsem_bend180 ComponentSpec

spec.

'cdsem_bend180'
text_size float

in um.

1

cdsem_bend180

Returns CDSEM structures.

Parameters:

Name Type Description Default
width float

of the line.

0.5
radius float

um.

10.0
wg_length float | None

in um.

420.0
straight ComponentSpec

spec.

'straight'
bend90 ComponentSpec

spec.

'bend_circular'
cross_section CrossSectionSpec

spec.

'strip'
text ComponentSpec

spec.

'text_rectangular'
text_size float

um.

1.0

cdsem_coupler

Returns 2 coupled waveguides gap sweep.

Parameters:

Name Type Description Default
length float

for the line.

420.0
gaps Sequence[float]

list of gaps for the sweep.

(0.15, 0.2, 0.25)
cross_section CrossSectionSpec

for the lines.

'strip_no_ports'
text ComponentSpec | None

optional text for labels.

'text_rectangular'
spacing float

Optional center to center spacing.

7.0
positions Sequence[float | None] | None

Optional positions for the text labels.

None
width float | None

width of the waveguide. If None, it will use the width of the cross_section.

None
text_size float

size of the text.

1.0

cdsem_straight

Returns straight waveguide lines width sweep.

Parameters:

Name Type Description Default
widths Sequence[float]

for the sweep.

(0.4, 0.45, 0.5, 0.6, 0.8, 1.0)
length float

for the line.

420.0
cross_section CrossSectionSpec

for the lines.

'strip_no_ports'
text ComponentSpec | None

optional text for labels.

'text_rectangular'
spacing float

Optional center to center spacing.

7.0
positions Sequence[float | None] | None

Optional positions for the text labels.

None
text_size float

in um.

1

cdsem_straight_density

Returns sweep of dense straight lines.

Parameters:

Name Type Description Default
widths Floats

list of widths.

(0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3)
gaps Floats

list of gaps.

(0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3)
length float

of the lines.

420.0
label str

defaults to widths[0] gaps[0].

''
cross_section CrossSectionSpec

spec.

'strip_no_ports'
text ComponentSpec | None

optional function for text.

'text_rectangular'
text_size float

size of the text.

1.0

circle

Generate a circle geometry.

Parameters:

Name Type Description Default
radius float

of the circle.

10.0
angle_resolution float

number of degrees per point.

2.5
layer LayerSpec

layer.

'WG'

circle_wave

Returns a circle with a sinusoidal boundary variation.

The boundary radius varies as r(theta) = radius + amplitude * sin(n * theta).

Parameters:

Name Type Description Default
radius float

mean radius.

10.0
amplitude float

amplitude of sinusoidal modulation.

1.0
n_oscillations int

number of oscillations around the boundary.

8
angle_resolution float

degrees per point.

1.0
layer LayerSpec

layer spec.

'WG'

comb_drive

Returns a comb drive actuator with interdigitated fingers and folded springs.

A central shuttle with comb fingers on both sides, fixed electrodes with interleaving fingers, and folded springs connecting the shuttle to corner anchor pads.

Parameters:

Name Type Description Default
finger_width float

width of each comb finger.

0.5
finger_length float

length of each comb finger.

10.0
finger_gap float

gap between adjacent moving and fixed fingers.

0.5
n_fingers int

number of moving fingers on each side.

20
finger_overlap float

overlap length between moving and fixed fingers in the actuation direction.

5.0
shuttle_width float

width (vertical) of the shuttle mass.

5.0
shuttle_length float

length (horizontal) of the shuttle mass.

30.0
spring_width float

width of spring beam segments.

0.5
spring_length float

length of each spring fold segment.

20.0
n_spring_folds int

number of folds in each folded spring.

4
anchor_size float

size of each square anchor pad.

10.0
layer LayerSpec

layer spec.

'WG'

compass

Rectangle with ports on each edge (north, south, east, and west).

Parameters:

Name Type Description Default
size Size

rectangle size.

(4.0, 2.0)
layer LayerSpec

tuple (int, int).

'WG'
port_type str | None

optical, electrical.

'electrical'
port_inclusion float

from edge.

0.0
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)
auto_rename_ports bool

auto rename ports.

True

component_sequence

Returns component from ASCII sequence.

if you prefix a symbol with ! it mirrors the component

Parameters:

Name Type Description Default
sequence str

a string or a list of symbols.

required
symbol_to_component dict[str, tuple[Component, str, str]]

maps symbols to (component, input, output).

required
ports_map dict[str, tuple[str, str]] | None

(optional) extra port mapping using the convention.

None
port_name1 str

input port_name.

'o1'
port_name2 str

output port_name.

'o2'
start_orientation AngleInDegrees

in degrees.

0.0
**kwargs Any

additional keyword arguments passed to the connect method.

{}

Returns:

Name Type Description
component Component

containing the sequence of sub-components instantiated and connected together in the sequence order.

Example

```python import gdsfactory as gf

bend180 = gf.components.bend_circular180() wg_pin = gf.components.straight_pin(length=40) wg = gf.components.straight()

Define a map between symbols and (component, input port, output port)

symbol_to_component = { "A": (bend180, 'o1', 'o2'), "B": (bend180, 'o2', 'o1'), "H": (wg_pin, 'o1', 'o2'), "-": (wg, 'o1', 'o2'), }

Each character in the sequence represents a component

s = "AB-H-H-H-H-BA" c = gf.components.component_sequence(sequence=s, symbol_to_component=symbol_to_component) c.plot()

```

copy_layers

Returns a component with the geometry copied in different layers.

Parameters:

Name Type Description Default
factory ComponentSpec

component spec.

'cross'
layers LayerSpecs

iterable of layers.

((1, 0), (2, 0))
flatten bool

flatten the result.

False
kwargs Any

keyword arguments passed to the component.

{}

coupler

Symmetric coupler.

Parameters:

Name Type Description Default
gap float

between straights in um.

0.236
length float

of coupling region in um.

20.0
dy Delta

port to port vertical spacing in um.

4.0
dx Delta

length of bend in x direction in um.

10.0
cross_section CrossSectionSpec

spec (CrossSection, string or dict).

'strip'
allow_min_radius_violation bool

if True does not check for min bend radius.

False
bend ComponentSpec

input and output sbend components.

'bend_s'
           dx                                 dx
        |------|                           |------|
     o2 ________                           ______o3
                \                         /           |
                 \        length         /            |
                  ======================= gap         | dy
                 /                       \            |
        ________/                         \_______    |
     o1                                          o4
                coupler_straight  coupler_symmetric

coupler90

Straight coupled to a bend.

Parameters:

Name Type Description Default
gap float

um.

0.2
radius float | None

um.

None
straight ComponentSpec

for straight.

'straight'
bend ComponentSpec

bend spec.

'bend_euler'
cross_section CrossSectionSpec

cross_section spec.

'strip'
cross_section_bend CrossSectionSpec | None

optional bend cross_section spec.

None
length_straight float | None

optional length of the straight waveguide.

None
        o3
         |
        /
       /
   o2_/
   o1___o4

coupler90bend

Returns 2 coupled bends.

Parameters:

Name Type Description Default
radius float

um.

10.0
gap float

um.

0.2
bend ComponentSpec

for bend.

'bend_euler'
cross_section_inner CrossSectionSpec

spec inner bend.

'strip'
cross_section_outer CrossSectionSpec

spec outer bend.

'strip'
        r   3 4
        |   | |
        |  / /
        | / /
    2____/ /
    1_____/

coupler90circular

Straight coupled to a bend.

Parameters:

Name Type Description Default
gap float

um.

0.2
radius float | None

um.

None
straight ComponentSpec

for straight.

'straight'
bend ComponentSpec

bend spec.

'bend_circular'
cross_section CrossSectionSpec

cross_section spec.

'strip'
cross_section_bend CrossSectionSpec | None

optional bend cross_section spec.

None
length_straight float | None

optional length of the straight waveguide.

None
        o3
         |
        /
       /
   o2_/
   o1___o4

coupler_adiabatic

Returns 50/50 adiabatic coupler.

Design based on asymmetric adiabatic 3dB coupler designs, such as those. - https://doi.org/10.1364/CLEO.2010.CThAA2, - https://doi.org/10.1364/CLEO_SI.2017.SF1I.5 - https://doi.org/10.1364/CLEO_SI.2018.STh4B.4

The coupler comprises five regions:

  1. is the first half of input S-bend where input widths taper by +dw and -dw
  2. is the second half of the S-bend straight with constant, unbalanced widths
  3. is the region where the two asymmetric straights gradually come together
  4. straights taper back to the original width at a fixed distance from one another
  5. is the output S-bend straight.

Parameters:

Name Type Description Default
length1 float

region that gradually brings the two asymmetric straights together. In this region the straight widths gradually change to be different by dw.

20.0
length2 float

coupling region, where asymmetric straights gradually become the same width.

50.0
length3 float

output region where the two straights separate.

30.0
wg_sep float

Distance between center-to-center in the coupling region (Region 2).

1.0
input_wg_sep float

Separation of the two straights at the input, center-to-center.

3.0
output_wg_sep float

Separation of the two straights at the output, center-to-center.

3.0
dw float

Change in straight width. In Region 1, top arm tapers to width+dw/2.0, bottom taper to width-dw/2.0.

0.1
cross_section CrossSectionSpec

cross_section spec.

'strip'

coupler_asymmetric

Bend coupled to straight waveguide.

Parameters:

Name Type Description Default
gap float

um.

0.234
dy Delta

port to port vertical spacing.

2.5
dx Delta

bend length in x direction.

10.0
cross_section CrossSectionSpec

spec.

'strip'
                    dx
                 |-----|
                  _____ o2
                 /         |
           _____/          |
     gap o1____________    |  dy
                        o3

coupler_bend

Compact curved coupler with bezier escape.

TODO: fix for euler bends.

Parameters:

Name Type Description Default
radius float | None

um.

None
coupler_gap float

um.

0.2
coupling_angle_coverage float

degrees.

120.0
cross_section_inner CrossSectionSpec

spec inner bend.

'strip'
cross_section_outer CrossSectionSpec

spec outer bend.

'strip'
bend AnyComponentFactory

for bend.

bend_circular_all_angle
bend_output ComponentSpec

for bend.

'bend_euler'
        r   4
        |   |
        |  / ___3
        | / /
    2____/ /
    1_____/

coupler_bent

Returns Broadband SOI curved / straight directional coupler.

based on: https://doi.org/10.1038/s41598-017-07618-6.

Parameters:

Name Type Description Default
gap float

gap.

0.2
radius float

radius coupling.

26
length float

coupler_length.

8.6
width1 float

width1.

0.4
width2 float

width2.

0.4
length_straight float

input and output straight length.

10
cross_section str

cross_section.

'strip'

coupler_broadband

Returns broadband coupler component.

https://docs.flexcompute.com/projects/tidy3d/en/latest/notebooks/BroadbandDirectionalCoupler.html proposed in Zeqin Lu, Han Yun, Yun Wang, Zhitian Chen, Fan Zhang, Nicolas A. F. Jaeger, and Lukas Chrostowski, "Broadband silicon photonic directional coupler using asymmetric-waveguide based phase control," Opt. Express 23, 3795-3808 (2015), DOI: 10.1364/OE.23.003795.

Parameters:

Name Type Description Default
w_sc float

width of waveguides in the symmetric coupler section.

0.5
gap_sc float

gap size between the waveguides in the symmetric coupler section.

0.2
w_top float

width of the top waveguide in the phase control section.

0.6
gap_pc float

gap size in the phase control section.

0.3
legnth_taper float

length of the tapers.

1.0
bend ComponentSpec

bend factory.

'bend_euler'
coupler_straight ComponentSpec

coupler_straight factory.

'coupler_straight'
length_coupler_straight float

optimal L_1 from the 3d fdtd analysis.

12.4
lenght_coupler_big_gap float

optimal L_2 from the 3d fdtd analysis.

4.7
cross_section CrossSectionSpec

cross_section of the waveguides.

'strip'
radius float

bend radius.

10.0

coupler_capacitive

Creates a capacitive coupler for quantum circuits.

A capacitive coupler consists of two metal pads separated by a small gap, providing capacitive coupling between circuit elements like qubits and resonators.

                ______               ______
      _______  |      |             |      | _______
     |       | |      |             |      ||       |
     | feed1 | | pad1 | ====gap==== | pad2 || feed2 |
     |       | |      |             |      ||       |
     |_______| |      |             |      ||_______|
               |______|             |______|

Parameters:

Name Type Description Default
pad_width float

Width of each coupling pad in μm.

20.0
pad_height float

Height of each coupling pad in μm.

50.0
gap float

Gap between the coupling pads in μm.

2.0
feed_width float

Width of the feed lines in μm.

10.0
feed_length float

Length of the feed lines in μm.

30.0
layer_metal LayerSpec

Layer for the metal structures.

(1, 0)
port_type str

Type of port to add to the component.

'electrical'

Returns:

Name Type Description
Component Component

A gdsfactory component with the capacitive coupler geometry.

coupler_full

Adiabatic Full coupler.

Design based on asymmetric adiabatic full coupler designs, such as the one reported in 'Integrated Optic Adiabatic Devices on Silicon' by Y. Shani, et al (IEEE Journal of Quantum Electronics, Vol. 27, No. 3 March 1991).

  1. is the first half of the input S-bend straight where the input straights widths taper by +dw and -dw,
  2. is the second half of the S-bend straight with constant, unbalanced widths,
  3. is the coupling region where the straights from unbalanced widths to balanced widths to reverse polarity unbalanced widths,
  4. is the fixed width straight that curves away from the coupling region, 5.is the final curve where the straights taper back to the regular width specified in the straight template.

Parameters:

Name Type Description Default
coupling_length float

Length of the coupling region in um.

40.0
dx Delta

Length of the bend regions in um.

10.0
dy Delta

Port-to-port distance between the bend regions in um.

4.8
gap float

Distance between the two straights in um.

0.5
dw float

delta width. Top arm tapers to width - dw, bottom to width + dw in um.

0.1
cross_section CrossSectionSpec

cross-section spec.

'strip'
width float | None

width of the waveguide. If None, it will use the width of the cross_section.

None

coupler_interdigital

Creates an interdigital capacitive coupler.

Each side includes a base column (a vertical metal block) to which the fingers are attached.

  • The width of the base column is equal to the height of the fingers.
  • The finger_length parameter refers only to the length of the fingers extending from the base, and does NOT include the base column width

Parameters:

Name Type Description Default
fingers int

Number of fingers per side.

6
finger_length float

Length of each finger in μm (see note above).

30.0
finger_width float

Width of each finger in μm.

2.0
finger_gap_vertical float

Vertical gap between fingers in μm (g1).

2.0
finger_gap_horizontal float

Horizontal gap between fingers in μm (g2).

3.0
feed_width float

Width of the feed lines in μm.

10.0
feed_length float

Length of the feed lines in μm.

30.0
layer_metal LayerSpec

Layer for the metal structures.

(1, 0)
port_type str

Type of port to add to the component.

'electrical'

Returns:

Name Type Description
Component Component

A gdsfactory component with the interdigital coupler geometry.

                ┌────────┐
               base columns
               ↓                    ↓
     ┌────────┐                      ┌────────┐
     │        │█████████████        █│        │
     │        │█        g1          █│        │
     │        │█ <─g2─> █████████████│        │
     │        │█                    █│        │
     │ feed1  │█████████████        █│ feed2  │
     │        │█                    █│        │
     │        │█        █████████████│        │
     │        │█                    █│        │
     │        │█████████████        █│        │
     └────────┘█                    █└────────┘

coupler_pulley

Returns a disc or ring with a pulley-coupled waveguide.

A waveguide wraps symmetrically around the top of a disc/ring over coupling_angle degrees. Bezier S-curves (following the CNST discPulley construction, eq. 2.22) route the waveguide from the coupling arc down to horizontal exits on both sides.

Parameters:

Name Type Description Default
radius float

radius of the disc, or outer radius of the ring.

10.0
ring_width float | None

width of the ring annulus. None for a solid disc.

None
gap float

gap between the waveguide inner edge and the disc/ring.

0.2
coupling_angle float

total wrap angle in degrees (symmetric about top).

60.0
wg_length float

horizontal half-length of the waveguide from the disc center to the exit end. Controls S-curve extent. Corresponds to CNST parameter L.

40.0
wg_height float

vertical drop from disc center to exit waveguide level. Corresponds to CNST parameter H.

10.0
n_segments int

number of points for each curved section.

128
cross_section CrossSectionSpec

cross-section spec for the coupling waveguide.

'strip'
layer LayerSpec

layer spec for the disc/ring.

'WG'

coupler_ring

Coupler for ring.

Parameters:

Name Type Description Default
gap float

spacing between parallel coupled straight waveguides.

0.2
radius float | None

of the bends. Default is None, which uses the default radius of the cross_section.

None
length_x float

length of the parallel coupled straight waveguides.

4.0
bend ComponentSpec

90 degrees bend spec.

'bend_euler'
straight ComponentSpec

straight spec.

'straight'
cross_section CrossSectionSpec

cross_section spec.

'strip'
cross_section_bend CrossSectionSpec | None

optional bend cross_section spec.

None
length_extension float | None

straight length extension at the end of the coupler bottom ports.

None
      o2                              o3
      xx                              xx
      xx                             xx
       xx          length_x          x
        xx     ◄───────────────►    x
         xx                       xxx
           xx                   xxx
            xxx──────▲─────────xxx
                     │gap
             o1──────▼─────────◄──────────────► o4
                                length_extension

coupler_ring_bend

Two back-to-back coupler_bend.

Parameters:

Name Type Description Default
radius float | None

um. Default is None, which uses the default radius of the cross_section.

None
coupler_gap float

um.

0.2
coupling_angle_coverage float

degrees.

90.0
length_x float

horizontal straight length.

0.0
cross_section_inner CrossSectionSpec

spec inner bend.

'strip'
cross_section_outer CrossSectionSpec

spec outer bend.

'strip'
bend AnyComponentFactory

for bend.

bend_circular_all_angle
bend_output ComponentSpec

for bend.

'bend_euler'
straight ComponentSpec

for straight.

'straight'

coupler_straight

Coupler_straight with two parallel straights.

Parameters:

Name Type Description Default
length float

of straight.

10.0
gap float

between straights.

0.27
cross_section CrossSectionSpec

specification (CrossSection, string or dict).

'strip'
    o2──────▲─────────o3
            │gap
    o1──────▼─────────o4

coupler_straight_asymmetric

Coupler with two parallel straights of different widths.

Parameters:

Name Type Description Default
length float

of straight.

10.0
gap float

between straights.

0.27
width_top float

of top straight.

0.5
width_bot float

of bottom straight.

1
cross_section CrossSectionSpec

cross_section spec.

'strip'

coupler_symmetric

Two coupled straights with bends.

Parameters:

Name Type Description Default
bend ComponentSpec

bend spec.

'bend_s'
gap float

in um.

0.234
dy Delta

port to port vertical spacing.

4.0
dx Delta

bend length in x direction.

10.0
cross_section CrossSectionSpec

section.

'strip'
allow_min_radius_violation bool

if True does not check for min bend radius.

False
                   dx
                |-----|
                   ___ o3
                  /       |
         o2 _____/        |
                          |
         o1 _____         |  dy
                 \        |
                  \___    |
                       o4

coupler_tunable

Creates a tunable capacitive coupler with voltage control.

A tunable coupler includes additional electrodes that can be voltage-biased to change the coupling strength dynamically.

Parameters:

Name Type Description Default
pad_width float

Width of main coupling pads in μm.

30.0
pad_height float

Height of main coupling pads in μm.

40.0
gap float

Gap between main coupling pads in μm.

3.0
tuning_pad_width float

Width of tuning pads in μm.

15.0
tuning_pad_height float

Height of tuning pads in μm.

20.0
tuning_gap float

Gap to tuning pads in μm.

1.0
feed_width float

Width of feed lines in μm.

10.0
feed_length float

Length of feed lines in μm.

30.0
layer_metal LayerSpec

Layer for main metal structures.

(1, 0)
layer_tuning LayerSpec

Layer for tuning electrodes.

(3, 0)
port_type str

Type of port to add to the component.

'electrical'

Returns:

Name Type Description
Component Component

A gdsfactory component with the tunable coupler geometry.

                (connected to feed)
                     _______
                    |       |
                    | tpad1 |
                    |       |
                    |_______|
                    tuning gap
               ______        ______
     _______  |      |      |      | _______
    |       | |      |      |      ||       |
    | feed1 | | pad1 | gap  | pad2 || feed2 |
    |       | |      |      |      ||       |
    |_______| |      |      |      ||_______|
              |______|      |______|
                    tuning gap
                     _______
                    |       |
                    | tpad2 |
                    |       |
                    |_______|
                (connected to feed)

cross

Returns a cross from two rectangles of length and width.

Parameters:

Name Type Description Default
length float

float Length of the cross from one end to the other.

10.0
width float

float Width of the arms of the cross.

3.0
layer LayerSpec

layer for geometry.

'WG'
port_type str | None

None, optical, electrical.

None

crossing

Waveguide crossing.

Parameters:

Name Type Description Default
arm ComponentSpec

arm spec.

crossing_arm

crossing45

Returns 45deg crossing with bends.

Parameters:

Name Type Description Default
crossing ComponentSpec

crossing function.

crossing
port_spacing float

target I/O port spacing.

40.0
dx Delta | None

target length.

None
alpha float

optimization parameter. diminish it for tight bends, increase it if raises assertion angle errors

0.08
npoints int

number of points.

101
cross_section CrossSectionSpec

cross_section spec.

'strip'
cross_section_bends CrossSectionSpec

cross_section spec.

'strip'

The 45 Degree crossing CANNOT be kept as an SRef since we only allow for multiples of 90Deg rotations in SRef.

    ----   ----
        \ /
         X
        / \
    ---    ----

crossing_etched

Waveguide crossing.

Full crossing has to be on WG layer (to start with a 220nm slab). Then we etch the ellipses down to 150nm slabs and we keep linear taper at 220nm.

Parameters:

Name Type Description Default
width float

input waveguides width.

0.5
r1 float

radii.

3.0
r2 float

radii.

1.1
w float

wide width.

1.2
L float

length.

3.4
layer_wg LayerSpec

waveguide layer.

'WG'
layer_slab LayerSpec

shallow etch layer.

'SLAB150'

crossing_linear_taper

Returns Crossing based on a taper.

The default is a dummy taper.

Parameters:

Name Type Description Default
width1 float

input width.

2.5
width2 float

output width.

0.5
length float

taper length.

3
cross_section CrossSectionSpec

cross_section spec.

'strip'
taper ComponentSpec

taper spec.

'taper'

cutback_2x2

Returns a daisy chain of splitters for measuring their loss.

Parameters:

Name Type Description Default
component ComponentSpec

for cutback.

'mmi2x2'
cols int

number of columns.

4
rows int

number of rows.

5
port1 str

name of first optical port.

'o1'
port2 str

name of second optical port.

'o2'
port3 str

name of third optical port.

'o3'
port4 str

name of fourth optical port.

'o4'
bend180 ComponentSpec

ubend.

'bend_circular180'
mirror bool

Flips component. Useful when 'o2' is the port that you want to route to.

False
straight_length float | None

length of the straight section between cutbacks.

None
cross_section CrossSectionSpec

specification (CrossSection, string or dict).

'strip'
straight ComponentSpec

straight spec.

'straight'

cutback_bend

We recommend using cutback_bend90 instead for a smaller footprint.

Parameters:

Name Type Description Default
component ComponentSpec

bend spec.

'bend_euler'
straight ComponentSpec

straight spec.

'straight'
straight_length float

in um.

5.0
rows int

number of rows.

6
cols int

number of cols.

5
kwargs Any

cross_section settings.

{}

cutback_bend180

Returns cutback to measure u bend loss.

Parameters:

Name Type Description Default
component ComponentSpec

bend spec.

'bend_euler180'
straight ComponentSpec

straight spec.

'straight'
straight_length float

in um.

5.0
rows int

number of rows.

6
cols int

number of cols.

6
spacing float

in um.

3.0
kwargs Any

cross_section settings.

_

{}

cutback_bend180circular

Returns cutback to measure u bend loss.

Parameters:

Name Type Description Default
component ComponentSpec

bend spec.

'bend_circular180'
straight ComponentSpec

straight spec.

'straight'
straight_length float

in um.

5.0
rows int

number of rows.

6
cols int

number of cols.

6
spacing float

in um.

3.0
kwargs Any

cross_section settings.

_

{}

cutback_bend90

Returns bend90 cutback.

Parameters:

Name Type Description Default
component ComponentSpec

bend spec.

'bend_euler'
straight ComponentSpec

straight spec.

'straight'
straight_length float

in um.

5.0
rows int

number of rows.

6
cols int

number of cols.

6
spacing int

in um.

5
kwargs Any

cross_section settings.

_

{}

cutback_bend90circular

Returns bend90 cutback.

Parameters:

Name Type Description Default
component ComponentSpec

bend spec.

'bend_circular'
straight ComponentSpec

straight spec.

'straight'
straight_length float

in um.

5.0
rows int

number of rows.

6
cols int

number of cols.

6
spacing int

in um.

5
kwargs Any

cross_section settings.

_

{}

cutback_component

Returns a daisy chain of components for measuring their loss.

Works only for components with 2 ports (input, output).

Parameters:

Name Type Description Default
component ComponentSpec

for cutback.

'taper_0p5_to_3_l36'
cols int

number of columns.

4
rows int

number of rows.

5
port1 str

name of first optical port.

'o1'
port2 str

name of second optical port.

'o2'
bend180 ComponentSpec

ubend.

'bend_euler180'
mirror bool

Flips component. Useful when 'o2' is the port that you want to route to.

False
mirror1 bool

mirrors first component.

False
mirror2 bool

mirrors second component.

False
straight_length float | None

length of the straight section between cutbacks.

None
straight_length_pair float | None

length of the straight section between each component pair.

None
cross_section CrossSectionSpec

specification (CrossSection, string or dict).

'strip'
straight ComponentSpec

straight spec.

'straight'
radius float | None

radius for the bends. Defaults to cross_section radius.

None
kwargs Any

component settings.

{}

cutback_component_mirror

Returns a daisy chain of components for measuring their loss.

Works only for components with 2 ports (input, output).

Parameters:

Name Type Description Default
component ComponentSpec

for cutback.

'taper_0p5_to_3_l36'
cols int

number of columns.

4
rows int

number of rows.

5
port1 str

name of first optical port.

'o1'
port2 str

name of second optical port.

'o2'
bend180 ComponentSpec

ubend.

'bend_euler180'
mirror bool

Flips component. Useful when 'o2' is the port that you want to route to.

True
mirror1 bool

mirrors first component.

False
mirror2 bool

mirrors second component.

False
straight_length float | None

length of the straight section between cutbacks.

None
straight_length_pair float | None

length of the straight section between each component pair.

None
cross_section CrossSectionSpec

specification (CrossSection, string or dict).

'strip'
straight ComponentSpec

straight spec.

'straight'
radius float | None

radius for the bends. Defaults to cross_section radius.

None
kwargs Any

component settings.

{}

cutback_splitter

Returns a daisy chain of splitters for measuring their loss.

Parameters:

Name Type Description Default
component ComponentSpec

for cutback.

'mmi1x2'
cols int

number of columns.

4
rows int

number of rows.

5
port1 str

name of first optical port.

'o1'
port2 str

name of second optical port.

'o2'
port3 str

name of third optical port.

'o3'
bend180 ComponentSpec

ubend.

'bend_euler180'
mirror bool

Flips component. Useful when 'o2' is the port that you want to route to.

False
straight ComponentSpec

waveguide spec to connect both sides.

'straight'
straight_length float | None

length of the straight section between cutbacks.

None
cross_section CrossSectionSpec

specification (CrossSection, string or dict).

'strip'
kwargs Any

cross_section settings.

{}

dash

Returns a dash shape with Bezier-curved tapered tips.

An elongated shape wider in the middle (width) that tapers via Bezier curves to a narrower tip (width_end) at each end. Based on the pyNISTtoolbox Dash pattern.

Parameters:

Name Type Description Default
width float

width at the center/body of the dash.

10.0
width_end float

width at the tips.

1.0
length float

total length of the straight body section.

20.0
taper_length float

length of each tapered transition.

5.0
tip_length float

length of each rounded tip beyond the taper.

2.0
n_bezier_points int

points per Bezier curve segment.

30
layer LayerSpec

layer spec.

'WG'

dbr

Distributed Bragg Reflector.

Parameters:

Name Type Description Default
w1 float

thin width in um.

0.45
w2 float

thick width in um.

0.55
l1 float

thin length in um.

0.159
l2 float

thick length in um.

0.159
n int

number of periods.

10
cross_section CrossSectionSpec

cross_section spec.

'strip'
straight_length float

length of the straight section between cutbacks.

0.01
       l1      l2
    <-----><-------->
            _________
    _______|
      w1       w2       ...  n times
    _______
           |_________

dbr_cell

Distributed Bragg Reflector unit cell.

Parameters:

Name Type Description Default
w1 float

thin width in um.

0.45
l1 float

thin length in um.

0.159
w2 float

thick width in um.

0.55
l2 float

thick length in um.

0.159
cross_section CrossSectionSpec

cross_section spec.

'strip'
       l1      l2
    <-----><-------->
            _________
    _______|
      w1       w2
    _______
           |_________

dbr_tapered

Distributed Bragg Reflector Cell class.

Tapers the input straight to a periodic straight structure with varying width (1-D photonic crystal).

Parameters:

Name Type Description Default
length float

Length of the DBR region.

10.0
period float

Period of the repeated unit.

0.85
dc float

Duty cycle of the repeated unit (must be a float between 0 and 1.0).

0.5
w1 float

thin section width. w1 = 0 corresponds to disconnected periodic blocks.

0.4
w2 float

wide section width.

1.0
taper_length float

between the input/output straight and the DBR region.

20.0
fins bool

If True, adds fins to the input/output straights.

False
fin_size Size

Specifies the x- and y-size of the fins. Defaults to 200 nm x 50 nm

(0.2, 0.05)
cross_section CrossSectionSpec

cross_section spec.

'strip'
             period
    <-----><-------->
            _________
    _______|
      w1       w2       ...  n times
    _______
           |_________

delay_snake

Returns Snake with a starting bend and 180 bends.

Parameters:

Name Type Description Default
length float

total length.

1600.0
length0 float

start length.

0.0
length2 float

end length.

0.0
n int

number of loops.

2
bend180 ComponentSpec

ubend spec.

bend_euler180
cross_section CrossSectionSpec

cross_section spec.

'strip'
width float | None

width of the waveguide. If None, it will use the width of the cross_section.

 | length0   |
None
             >---------\
                        \bend180.info['length']
                        /
   |-------------------/
   |
   |------------------->------->|
                        length2
   |   delta_length    |        |

delay_snake2

Returns Snake with a starting straight and 180 bends.

Input faces west output faces east.

Parameters:

Name Type Description Default
length float

total length.

1600.0
length0 float

start length.

0.0
length2 float

end length.

0.0
n int

number of loops.

2
bend180 ComponentSpec

ubend spec.

'bend_euler180'
cross_section CrossSectionSpec

cross_section spec.

'strip'
width float | None

width of the waveguide. If None, it will use the width of the cross_section.

None

| length0 | length1 |

             >---------|
                       | bend180.length
   |-------------------|
   |
   |------------------->------- |
                        length2
   |   delta_length    |        |

delay_snake_sbend

Returns compact Snake with sbend in the middle.

Input port faces west and output port faces east.

Parameters:

Name Type Description Default
length float

total length.

100.0
length1 float

first straight section length in um.

0.0
length4 float

fourth straight section length in um.

0.0
radius float

u bend radius in um.

5.0
waveguide_spacing float

waveguide pitch in um.

5.0
bend ComponentSpec

bend spec.

'bend_euler'
sbend ComponentSpec

sbend spec.

'bend_s'
sbend_xsize float

sbend size.

100.0
cross_section CrossSectionSpec

cross_section spec.

'strip'
                     length1
     <----------------------------
           length2    spacing    |
            _______              |
           |        \            |
           |          \          | bend1 radius
           |            \sbend   |
      bend2|              \      |
           |                \    |
           |                  \__|
           |
           ---------------------->----------->
               length3              length4
We adjust length2 and length3

die

Returns die with optional markers marking the boundary of the die.

Parameters:

Name Type Description Default
size Size

x, y dimensions of the die.

(10000.0, 10000.0)
street_width float

Width of the corner marks for die-sawing.

100.0
street_length float

Length of the corner marks for die-sawing.

1000.0
die_name str | None

Label text. If None, no label is added.

'chip99'
text_size float

Label text size.

100.0
text_location str | Float2

{'NW', 'N', 'NE', 'SW', 'S', 'SE'} or (x, y) coordinate.

'SW'
layer LayerSpec | None

For street widths. None to not draw the street widths.

'FLOORPLAN'
bbox_layer LayerSpec | None

optional bbox layer drawn bounding box around the die.

'FLOORPLAN'
text_layer LayerSpec

Layer for the die name text.

'WG'
text ComponentSpec

function use for generating text. Needs to accept text, size, layer.

'text'
draw_corners bool

True draws only corners. False draws a square die.

False

die_frame

Returns a rectangular die floorplan.

Parameters:

Name Type Description Default
size Size

die frame size (width, height), in um.

(11200.0, 5000.0)
layer_floorplan LayerSpec

layer for the floorplan rectangle.

'FLOORPLAN'

die_frame_phix

A die_frame with grating couplers and pads.

Parameters:

Name Type Description Default
die_frame ComponentSpec

die_frame spec.

'die_frame'
nfibers int

the number of grating couplers.

32
npads int

the number of pads.

60
npads_rf int

the number of RF pads on the left side.

6
fiber_pitch float

the pitch of the grating couplers, in um.

127.0
pad_pitch float

the pitch of the pads, in um.

150.0
pad_pitch_gsg float

the pitch of the GSG pads, in um.

720.0
edge_coupler ComponentSpec | None

the grating coupler component.

'edge_coupler_silicon'
grating_coupler ComponentSpec | None

Optional grating coupler.

None
cross_section CrossSectionSpec

the cross section.

'strip'
pad ComponentSpec

the pad component.

'pad'
pad_gsg ComponentSpec

the GSG pad component.

'pad_gsg'
edge_to_pad_distance float

the distance from the edge to the pads, in um.

200.0
edge_to_pad_distance_left float | None

Optional distance from the left edge to the pads, in um. If None, uses edge_to_pad_distance for both sides.

None
pad_port_name_top str

name of the pad port name at the top facing south.

'e4'
pad_port_name_bot str

name of the pad port name at the bottom facing north.

'e2'
pad_port_name_rf str

name of the RF pad port name.

'e2'
layer_fiducial LayerSpec

layer for fiducials.

'M3'
fiducial_top_left ComponentSpec | None

optional top-left fiducial. Defaults to the legacy cross on layer_fiducial.

None
fiducial_top_right ComponentSpec | None

optional top-right fiducial. Defaults to the legacy circle on layer_fiducial.

None
fiducial_bottom_left ComponentSpec | None

optional bottom-left fiducial. Defaults to the legacy circle on layer_fiducial.

None
fiducial_bottom_right ComponentSpec | None

optional bottom-right fiducial. Defaults to the legacy circle on layer_fiducial.

None
layer_ruler LayerSpec

layer for ruler.

'WG'
ruler_bbox_layers tuple[LayerSpec, ...] | None

layers for bbox.

None
ruler_bbox_offset float

offset for bbox.

3.0
ruler_yoffset float

y-offset for ruler.

0
ruler_xoffset float

x-offset for ruler.

0
fiber_coupler_xoffset float

x-offset for fiber couplers.

0
with_right_fiber_coupler bool

if True, adds edge couplers on the right side.

True
with_left_fiber_coupler bool

if True, adds edge couplers on the left side.

True
text_offset Float2

offset for text.

(20, 10)
text ComponentSpec | None

text component spec.

'text_rectangular'
pad_side_distance float

distance from the die frame side to the first pad, in um.

1160.0
xoffset_rf_pads float

RF pads x-offset.

50
pad_rotation_dc_north float

rotation for DC pads.

0
pad_rotation_dc_south float

rotation for DC pads.

0
pad_rotation_rf float

rotation for RF pads.

0
with_loopback bool

if True, adds loopback structures.

True

die_frame_phix_dc

A PHIX die frame with DC pads only.

Parameters:

Name Type Description Default
die_frame ComponentSpec

die_frame spec.

'die_frame'
nfibers int

the number of grating couplers.

32
npads int

the number of pads.

59
npads_rf int

the number of RF pads on the left side.

6
fiber_pitch float

the pitch of the grating couplers, in um.

127.0
pad_pitch float

the pitch of the pads, in um.

150.0
pad_pitch_gsg float

the pitch of the GSG pads, in um.

720.0
edge_coupler ComponentSpec | None

the edge coupler component.

'edge_coupler_silicon'
grating_coupler ComponentSpec | None

Optional grating coupler.

None
cross_section CrossSectionSpec

the cross section.

'strip'
pad ComponentSpec

the pad component.

'pad'
pad_gsg ComponentSpec

the GSG pad component.

'pad_gsg'
edge_to_pad_distance float

the distance from the edge to the pads, in um.

200.0
pad_port_name_top str

name of the pad port name at the top facing south.

'e4'
pad_port_name_bot str

name of the pad port name at the bottom facing north.

'e2'
layer_fiducial LayerSpec

layer for fiducials.

'M3'
fiducial_top_left ComponentSpec | None

optional top-left fiducial; defaults to a cross.

None
fiducial_top_right ComponentSpec | None

optional top-right fiducial; defaults to a circle.

None
fiducial_bottom_left ComponentSpec | None

optional bottom-left fiducial; defaults to a circle.

None
fiducial_bottom_right ComponentSpec | None

optional bottom-right fiducial; defaults to a circle.

None
layer_ruler LayerSpec

layer for ruler.

'WG'
ruler_bbox_layers tuple[LayerSpec, ...] | None

layers for bbox.

None
ruler_bbox_offset float

offset for bbox.

3.0
ruler_yoffset float

y-offset for ruler.

0
ruler_xoffset float

x-offset for ruler.

0
with_right_fiber_coupler bool

if True, adds edge couplers on the right side.

True
with_left_fiber_coupler bool

if True, adds edge couplers on the left side.

True
fiber_coupler_xoffset float

x-offset for fiber couplers.

0
text_offset Float2

offset for text.

(20, 10)
text ComponentSpec | None

text component spec.

None
pad_rotation_dc_north float

rotation for DC pads.

0
pad_rotation_dc_south float

rotation for DC pads.

0
pad_side_distance float

distance from the die frame side to the first pad, in um.

1160.0

die_frame_phix_rf

A PHIX die frame with DC and RF pads.

Parameters:

Name Type Description Default
die_frame ComponentSpec

die_frame spec.

'die_frame_rf'
nfibers int

the number of grating couplers.

32
npads int

the number of pads.

59
npads_rf int

the number of RF pads on the left side.

6
fiber_pitch float

the pitch of the grating couplers, in um.

127.0
pad_pitch float

the pitch of the pads, in um.

150.0
pad_pitch_gsg float

the pitch of the GSG pads, in um.

720.0
edge_coupler ComponentSpec | None

the edge coupler component.

'edge_coupler_silicon'
grating_coupler ComponentSpec | None

Optional grating coupler.

None
cross_section CrossSectionSpec

the cross section.

'strip'
pad ComponentSpec

the pad component.

'pad'
pad_gsg ComponentSpec

the GSG pad component.

'pad_gsg'
edge_to_pad_distance float

the distance from the edge to the pads, in um.

200.0
pad_port_name_top str

name of the pad port name at the top facing south.

'e4'
pad_port_name_bot str

name of the pad port name at the bottom facing north.

'e2'
pad_port_name_rf str

name of the RF pad port name.

'e2'
layer_fiducial LayerSpec

layer for fiducials.

'M3'
fiducial_top_left ComponentSpec | None

optional top-left fiducial; defaults to a cross.

None
fiducial_top_right ComponentSpec | None

optional top-right fiducial; defaults to a circle.

None
fiducial_bottom_left ComponentSpec | None

optional bottom-left fiducial; defaults to a circle.

None
fiducial_bottom_right ComponentSpec | None

optional bottom-right fiducial; defaults to a circle.

None
layer_ruler LayerSpec

layer for ruler.

'WG'
ruler_bbox_layers tuple[LayerSpec, ...] | None

layers for bbox.

None
ruler_bbox_offset float

offset for bbox.

3.0
ruler_yoffset float

y-offset for ruler.

0
ruler_xoffset float

x-offset for ruler.

0
with_right_fiber_coupler bool

if True, adds edge couplers on the right side.

True
with_left_fiber_coupler bool

if True, adds edge couplers on the left side.

False
fiber_coupler_xoffset float

x-offset for fiber couplers.

0
text_offset Float2

offset for text.

(20, 10)
text ComponentSpec | None

text component spec.

None
pad_side_distance float

distance from the die frame side to the first pad, in um.

350.0
xoffset_rf_pads float

RF pads x-offset.

50
pad_rotation_rf float

rotation for RF pads.

0
pad_rotation_dc_north float

rotation for DC pads.

0
pad_rotation_dc_south float

rotation for DC pads.

0

die_frame_rf

Returns a rectangular die floorplan sized for RF dies.

Parameters:

Name Type Description Default
size Size

die frame size (width, height), in um.

(10400.0, 5000.0)
layer_floorplan LayerSpec

layer for the floorplan rectangle.

'FLOORPLAN'

die_frame_with_pads

A die_frame with grating couplers and pads.

Parameters:

Name Type Description Default
die_frame ComponentSpec

die_frame spec.

'die_frame'
ngratings int

the number of grating couplers.

14
npads int

the number of pads.

31
grating_pitch float

the pitch of the grating couplers, in um.

250.0
pad_pitch float

the pitch of the pads, in um.

300.0
grating_coupler ComponentSpec | None

the grating coupler component.

'grating_coupler_te'
cross_section CrossSectionSpec

the cross section.

'strip'
pad ComponentSpec

the pad component.

'pad'
edge_to_pad_distance float

the distance from the edge to the pads, in um.

150.0
edge_to_grating_distance float

the distance from the edge to the grating couplers, in um.

150.0
with_loopback bool

if True, adds a loopback between edge GCs. Only works for rotation = 90 for now.

True
loopback_radius float | None

optional radius for loopback.

None
pad_port_name_top str

name of the pad port name at the btop facing south.

'e4'
pad_port_name_bot str

name of the pad port name at the bottom facing north.

'e2'

die_with_pads

A die with grating couplers and pads.

Parameters:

Name Type Description Default
size Size

the size of the die, in um.

(11470.0, 4900.0)
ngratings int

the number of grating couplers.

14
npads int

the number of pads.

31
grating_pitch float

the pitch of the grating couplers, in um.

250.0
pad_pitch float

the pitch of the pads, in um.

300.0
grating_coupler ComponentSpec | None

the grating coupler component.

'grating_coupler_te'
cross_section CrossSectionSpec

the cross section.

'strip'
pad ComponentSpec

the pad component.

'pad'
layer_floorplan LayerSpec

the layer of the floorplan.

'FLOORPLAN'
edge_to_pad_distance float

the distance from the edge to the pads, in um.

150.0
edge_to_grating_distance float

the distance from the edge to the grating couplers, in um.

150.0
with_loopback bool

if True, adds a loopback between edge GCs. Only works for rotation = 90 for now.

True
loopback_radius float | None

optional radius for loopback.

None
pad_port_name_top str

name of the pad port name at the btop facing south.

'e4'
pad_port_name_bot str

name of the pad port name at the bottom facing north.

'e2'

disk

Disk Resonator.

Parameters:

Name Type Description Default
radius float

disk resonator radius.

10.0
gap float

Distance between the bus straight and resonator.

0.2
wrap_angle_deg float

Angle in degrees between 0 and 180. determines how much the bus straight wraps along the resonator. 0 corresponds to a straight bus straight. 180 corresponds to a bus straight wrapped around half of the resonator.

180.0
parity int

1 or -1. 1 places the resonator left from the bus straight, -1 places it to the right.

1
cross_section CrossSectionSpec

cross_section spec.

'strip'

disk_heater

Disk Resonator with top metal heater.

Parameters:

Name Type Description Default
radius float

disk resonator radius.

10.0
gap float

Distance between the bus straight and resonator.

0.2
wrap_angle_deg float

Angle in degrees between 0 and 180. determines how much the bus straight wraps along the resonator. 0 corresponds to a straight bus straight. 180 corresponds to a bus straight wrapped around half of the resonator.

180.0
parity int

1 or -1. 1 places the resonator left from the bus straight, -1 places it to the right.

1
cross_section CrossSectionSpec

cross_section spec.

'strip'
heater_layer LayerSpec

layer of the heater.

'HEATER'
via_stack ComponentSpec

via stack component.

'via_stack_heater_mtop'
heater_width float

width of the heater.

5.0
heater_extent float

length of heater beyond disk.

2.0
via_width float

size of the square via at the end of the heater.

10.0
port_orientation AngleInDegrees | None

in degrees.

90

doubly_clamped_beam

Returns a doubly clamped beam fixed at both ends.

Two anchor pads connected by a thin beam, centered at the origin.

Parameters:

Name Type Description Default
beam_width float

width of the beam.

1.0
beam_length float

length of the beam between the two anchors.

30.0
anchor_width float

width (vertical) of each anchor pad.

5.0
anchor_length float

length (horizontal) of each anchor pad.

5.0
layer LayerSpec

layer spec.

'WG'
port_type str

port type for electrical ports.

'electrical'

edge_coupler_array

Fiber array edge coupler based on an inverse taper.

Each edge coupler adds a ruler for polishing.

Parameters:

Name Type Description Default
edge_coupler ComponentSpec

edge coupler spec.

'edge_coupler_silicon'
n int

number of channels.

5
pitch float

Fiber pitch.

127.0
x_reflection bool

horizontal mirror.

False
text ComponentSpec | None

text spec.

'text_rectangular'
text_offset Float2

from edge coupler.

(10, 20)
text_rotation float

text rotation in degrees.

0

edge_coupler_array_with_loopback

Fiber array edge coupler.

Parameters:

Name Type Description Default
edge_coupler ComponentSpec

edge coupler.

'edge_coupler_silicon'
cross_section CrossSectionSpec

spec.

'strip'
radius float | None

bend radius loopback (um).

None
n int

number of channels.

8
pitch float

Fiber pitch (um).

127.0
x_reflection bool

horizontal mirror.

False
text ComponentSpec | None

Optional text spec.

'text_rectangular'
text_offset Float2

x, y.

(0, 10)
text_rotation float

text rotation in degrees.

0

edge_coupler_silicon

Edge coupler for silicon photonics.

Parameters:

Name Type Description Default
length float

length of the taper.

100
width1 float

width1 of the taper.

0.5
width2 float

width2 of the taper.

0.2
with_two_ports bool

add two ports.

True
port_names tuple[str, str]

tuple with port names.

('o1', 'o2')
port_types tuple[str, str]

tuple with port types.

('optical', 'edge_coupler')
cross_section CrossSectionSpec

cross_section spec.

'strip'

ellipse

Returns ellipse component.

Parameters:

Name Type Description Default
radii tuple[float, float]

Semimajor and semiminor axis lengths of the ellipse.

(10.0, 5.0)
angle_resolution float

number of degrees per point.

2.5
layer LayerSpec

Specific layer(s) to put polygon geometry on.

'WG'

The orientation of the ellipse is determined by the order of the radii variables; if the first element is larger, the ellipse will be horizontal and if the second element is larger, the ellipse will be vertical.

extend_ports

Returns a new component with some ports extended.

You can define extension Spec defaults to port cross_section of each port to extend.

Parameters:

Name Type Description Default
component ComponentSpec

component to extend ports.

'mmi1x2'
port_names PortNames | None

list of ports names to extend, if None it extends all ports.

None
length float

extension length, added after any automatic taper, so the total extension is taper_length + length when a taper is inserted.

5.0
extension ComponentSpec | None

function to extend ports (defaults to a straight).

None
port1 str | None

extension input port name.

None
port2 str | None

extension output port name.

None
port_type str

type of the ports to extend.

'optical'
centered bool

if True centers rectangle at (0, 0).

False
cross_section CrossSectionSpec | None

extension cross_section, defaults to port cross_section if port has no cross_section it creates one using width and layer.

None
extension_port_names list[str] | None

extension port names add to the new component.

None
allow_width_mismatch bool

allow width mismatches.

False
auto_taper bool

if True adds automatic tapers.

True
kwargs Any

cross_section settings.

{}

Other Parameters:

Name Type Description
layer

port GDS layer.

prefix

port name prefix.

orientation

in degrees.

width

port width.

layers_excluded

List of layers to exclude.

port_type str

optical, electrical, ....

clockwise

if True, sort ports clockwise, False: counter-clockwise.

extend_ports_list

Returns a component with an extension attached to a list of ports.

Parameters:

Name Type Description Default
component_spec ComponentSpec

component from which to get ports.

required
extension ComponentSpec

function for extension.

required
extension_port_name str | None

to connect extension.

None
ignore_ports Strs | None

list of port names to ignore.

None

extract

Extracts a list of layers and adds them to a new Component.

Parameters:

Name Type Description Default
component Component

to extract the layers from.

required
layers LayerSpecs

list of layers to extract.

required
recursive bool

if True, extracts the shapes recursively.

True

fanout2x2

Returns component with Sbend fanout routes.

Parameters:

Name Type Description Default
component ComponentSpec

to fanout.

'mmi2x2'
port_spacing float

for the returned component.

20.0
bend_length float | None

length of the bend (defaults to port_spacing).

None
npoints int

for sbend.

101
select_ports PortsFactory

function to select optical_ports ports.

select_ports_optical
cross_section CrossSectionSpec

cross_section spec.

'strip'
port1 str

bottom west port.

'o1'
port2 str

top west port.

'o2'
port3 str

top east port.

'o3'
port4 str

bottom east port.

'o4'
kwargs Any

cross_section settings.

{}
Example
import gdsfactory as gf
c = gf.components.nxn(west=2, east=2)

cc = gf.routing.fanout2x2(component=c, port_spacing=20)
cc.plot()

fiber

Returns a fiber.

Parameters:

Name Type Description Default
core_diameter float

in um.

10
cladding_diameter float

in um.

125
layer_core LayerSpec

layer spec for fiber core.

'WG'
layer_cladding LayerSpec

layer spec for fiber cladding.

'WGCLAD'

fiber_array

Returns a fiber array.

Parameters:

Name Type Description Default
n int

number of fibers.

8
pitch float

spacing.

127.0
core_diameter float

10um.

10
cladding_diameter float

in um.

125
layer_core LayerSpec

layer spec for fiber core.

'WG'
layer_cladding LayerSpec

layer spec for fiber cladding.

'WGCLAD'
    pitch
     <->
    _________
   |         | lid
   | o o o o |
   |         | base
   |_________|
      length

fiducial_squares

Returns fiducials with two squares.

Parameters:

Name Type Description Default
layers LayerSpecs

list of layers to draw the squares.

('WG',)
size Float2

size of each square in um.

(5, 5)
offset float

space between squares in x and y.

0.14

flux_qubit

Creates a flux qubit (persistent current qubit).

A flux qubit consists of a superconducting loop interrupted by three Josephson junctions. Two junctions are identical (beta junctions) while the third is smaller (alpha junction) with roughly 0.5-0.8 times the critical current.

Parameters:

Name Type Description Default
loop_width float

Width of the superconducting loop in μm.

50.0
loop_height float

Height of the superconducting loop in μm.

50.0
junction_width float

Width of the beta Josephson junctions in μm.

0.15
junction_height float

Height of the beta Josephson junctions in μm.

0.3
alpha_junction_width float

Width of the alpha Josephson junction in μm.

0.12
alpha_junction_height float

Height of the alpha Josephson junction in μm.

0.25
wire_width float

Width of the superconducting wires in μm.

2.0
layer_metal LayerSpec

Layer for the metal wires.

(1, 0)
layer_junction LayerSpec

Layer for the beta Josephson junctions.

(2, 0)
layer_alpha_junction LayerSpec

Layer for the alpha Josephson junction.

(3, 0)
port_type str

Type of port to add to the component.

'electrical'

Returns:

Name Type Description
Component Component

A gdsfactory component with the flux qubit geometry.

flux_qubit_asymmetric

Creates an asymmetric flux qubit for reduced flux noise sensitivity.

An asymmetric flux qubit has a loop geometry that is not perfectly symmetric, which can help reduce sensitivity to flux noise while maintaining controllability.

Parameters:

Name Type Description Default
loop_width float

Width of the superconducting loop in μm.

60.0
loop_height float

Height of the superconducting loop in μm.

40.0
junction_width float

Width of the beta Josephson junctions in μm.

0.15
junction_height float

Height of the beta Josephson junctions in μm.

0.3
alpha_junction_width float

Width of the alpha Josephson junction in μm.

0.12
alpha_junction_height float

Height of the alpha Josephson junction in μm.

0.25
wire_width float

Width of the superconducting wires in μm.

2.0
asymmetry_angle float

Angle of asymmetry in degrees.

15.0
layer_metal LayerSpec

Layer for the metal wires.

(1, 0)
layer_junction LayerSpec

Layer for the beta Josephson junctions.

(2, 0)
layer_alpha_junction LayerSpec

Layer for the alpha Josephson junction.

(3, 0)
port_type str

Type of port to add to the component.

'electrical'

Returns:

Name Type Description
Component Component

A gdsfactory component with the asymmetric flux qubit geometry.

folded_spring

Returns a folded flexure spring (serpentine meander).

Alternating horizontal beams connected at their ends forming a serpentine pattern. Starts at a bottom anchor and ends at a top anchor.

Parameters:

Name Type Description Default
beam_width float

width of each beam segment.

0.5
beam_length float

length of each horizontal beam segment.

20.0
n_folds int

number of horizontal beam segments.

4
fold_gap float

vertical gap between adjacent beams.

1.0
anchor_width float

width (horizontal) of the anchor pads.

5.0
anchor_length float

length (vertical) of the anchor pads.

3.0
layer LayerSpec

layer spec.

'WG'
port_type str

port type for electrical ports.

'electrical'

fractal

Returns a fractal pattern.

Parameters:

Name Type Description Default
fractal_type Literal['sierpinski_triangle', 'sierpinski_carpet', 'vicsek_cross', 'vicsek_saltire']

type of fractal.

'sierpinski_triangle'
depth int

recursion depth (max recommended: 6).

4
size float

overall size of the fractal.

100.0
layer LayerSpec

layer spec.

'WG'

free_propagation_region

Free propagation region.

Parameters:

Name Type Description Default
width1 float

width of the input region.

2.0
width2 float

width of the output region.

20.0
length float

length of the free propagation region.

20.0
wg_width float

waveguide width.

0.5
inputs int

number of inputs.

1
outputs int

number of outputs.

10
cross_section CrossSectionSpec

cross_section function.

 length
 <-->
   /|
  / |

width1| | width2 | |

'strip'

ge_detector_straight_si_contacts

Returns a straight Ge on Si detector with silicon contacts.

There are no contacts on the Ge. These detectors could have lower dark current and sensitivity compared to those with contacts in the Ge. See Chen et al., "High-Responsivity Low-Voltage 28-Gb/s Ge p-i-n Photodetector With Silicon Contacts", Journal of Lightwave Technology 33(4), 2015.

https://doi.org/10.1109/JLT.2014.2367134

Parameters:

Name Type Description Default
length float

pd length.

40.0
cross_section CrossSectionSpec

for the waveguide.

'pn_ge_detector_si_contacts'
via_stack ComponentSpec

for the via_stacks. First element

'via_stack_slab_m3'
via_stack_width float

width of the via_stack.

10.0
via_stack_spacing float

spacing between via_stacks.

5.0
via_stack_offset float

with respect to the detector

0.0
taper_length float

length of the taper.

20.0
taper_width float

width of the taper.

0.8
taper_cros_section CrossSectionSpec

cross_section of the taper.

'strip'

gear

Returns a gear with simplified trapezoidal teeth.

Parameters:

Name Type Description Default
n_teeth int

number of teeth.

20
module_size float

gear module (pitch diameter / number of teeth).

2.0
pressure_angle float

pressure angle in degrees.

20.0
hub_radius float | None

radius of the central hub disc. Defaults to root_radius * 0.6.

None
hub_hole_radius float

radius of a center hole (0 to disable).

0.0
layer LayerSpec

layer spec.

'WG'

grating_coupler_array

Array of grating couplers.

Parameters:

Name Type Description Default
grating_coupler ComponentSpec

ComponentSpec.

'grating_coupler_elliptical'
pitch float

x spacing.

127.0
n int

number of grating couplers.

6
port_name str

port name.

'o1'
rotation int

rotation angle for each reference.

-90
with_loopback bool

if True, adds a loopback between edge GCs. Only works for rotation = 90 for now.

False
cross_section CrossSectionSpec

cross_section for the routing.

'strip'
straight_to_grating_spacing float

spacing between the last grating coupler and the loopback.

10.0
centered bool

if True, centers the array around the origin.

True
radius float | None

optional radius for routing the loopback.

None
bend ComponentSpec

ComponentSpec for the bend used in the loopback.

'bend_euler'
mirror_grating_coupler bool

if True, mirrors the grating coupler.

False

grating_coupler_dual_pol

2 dimensional, dual polarization grating coupler.

Based on a photonic crystal with a unit cell that is usually an ellipse, a rectangle or a circle. The default values are loosely based on Taillaert et al, "A Compact Two-Dimensional Grating Coupler Used as a Polarization Splitter", IEEE Phot. Techn. Lett. 15(9), 2003.

Parameters:

Name Type Description Default
unit_cell ComponentSpec

component describing the unit cell of the photonic crystal.

_unit_cell
period_x float

spacing between unit cells in the x direction [um].

0.58
period_y float

spacing between unit cells in the y direction [um].

0.58
x_span float

full x span of the photonic crystal.

11
y_span float

full y span of the photonic crystal.

11
length_taper float

taper length [um].

150.0
width_taper float

width of the taper at the grating coupler side [um].

10.0
polarization str

polarization of the grating coupler.

'te'
wavelength float

operation wavelength [um]

1.55
taper ComponentSpec

function to generate the tapers.

'taper'
base_layer LayerSpec

layer to draw over the whole photonic crystal (necessary if the unit cells are etched into a base layer).

'WG'
cross_section CrossSectionSpec

for the routing waveguides.

'strip'
            _|-|_|-|_|-|___  --> unit_cells
               base_layer |
        o1  ______________|
top view
               -------------
           // | o   o   o  |
    o1 __ //  | o   o   o  |
          \\  | o   o   o  |
           \\ | o   o   o  |
               -------------
               \\         //
                \\       //
                     |
                     o2

grating_coupler_elliptical

Grating coupler with parametrization based on Lumerical FDTD simulation.

Parameters:

Name Type Description Default
polarization str

te or tm.

'te'
taper_length float

taper length from input.

16.6
taper_angle float

grating flare angle.

40.0
wavelength float

grating transmission central wavelength (um).

1.554
fiber_angle float

fibre angle in degrees determines ellipticity.

15.0
grating_line_width float

in um.

0.343
neff float

tooth effective index.

2.638
nclad float

cladding effective index.

1.443
n_periods int

number of periods.

30
big_last_tooth bool

adds a big_last_tooth.

False
layer_slab LayerSpec | None

layer that protects the slab under the grating.

'SLAB150'
slab_xmin float

where 0 is at the start of the taper.

-1.0
slab_offset float

in um.

2.0
spiked bool

grating teeth have sharp spikes to avoid non-manhattan drc errors.

True
cross_section CrossSectionSpec

specification (CrossSection, string or dict).

      fiber

   /  /  /  /
  /  /  /  /
'strip'
            _|-|_|-|_|-|___ layer
               layer_slab |
        o1  ______________|

grating_coupler_elliptical_arbitrary

Grating coupler with parametrization based on Lumerical FDTD simulation.

The ellipticity is derived from Lumerical knowledge base it depends on fiber_angle (degrees), neff, and nclad

Parameters:

Name Type Description Default
gaps Floats

list of gaps.

(0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1)
widths Floats

list of widths.

(0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5)
taper_length float

taper length from input.

16.6
taper_angle float

grating flare angle.

60.0
wavelength float

grating transmission central wavelength (um).

1.554
fiber_angle float

fibre angle in degrees determines ellipticity.

15.0
nclad float

cladding effective index to compute ellipticity.

1.443
layer_slab LayerSpec | None

Optional slab.

'SLAB150'
layer_grating LayerSpec | None

Optional layer for grating. by default None uses cross_section.layer. if different from cross_section.layer expands taper.

None
taper_to_slab_offset float

0 is where taper ends.

-3.0
polarization str

te or tm.

'te'
spiked bool

grating teeth have spikes to avoid drc errors.

True
bias_gap float

etch gap (um). Positive bias increases gap and reduces width to keep period constant.

0
cross_section CrossSectionSpec

cross_section spec for waveguide port.

'strip'
Notes

Ellipse conventions, see https://en.wikipedia.org/wiki/Ellipse

c = (a1 ** 2 - b1 ** 2) ** 0.5 e = (1 - (b1 / a1) ** 2) ** 0.5

                  fiber

               /  /  /  /
              /  /  /  /

            _|-|_|-|_|-|___ layer
               layer_slab |
        o1  ______________|

grating_coupler_elliptical_lumerical

Returns a grating coupler from lumerical inverse design 3D optimization.

this is a wrapper of components.grating_coupler_elliptical_arbitrary https://support.lumerical.com/hc/en-us/articles/1500000306621 https://support.lumerical.com/hc/en-us/articles/360042800573

Here are the simulation settings used in lumerical

n_bg=1.44401 #Refractive index of the background material (cladding)
wg=3.47668   # Refractive index of the waveguide material (core)
lambda0=1550e-9
bandwidth = 0e-9
polarization = 'TE'
wg_width=500e-9 # Waveguide width
wg_height=220e-9 # Waveguide height
etch_depth=80e-9 # etch depth
theta_fib_mat = 5 # Angle of the fiber mode in material
theta_taper=30
efficiency=0.55 # 5.2 dB

Parameters:

Name Type Description Default
parameters Floats

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

(-2.4298362615732447, 0.1, 0.48007023217536954, 0.1, 0.607397685752365, 0.1, 0.4498844003086115, 0.1, 0.4274116312627637, 0.1, 0.4757904248387285, 0.1, 0.5026649898504233, 0.10002922416240886, 0.5100366774007897, 0.1, 0.494399635363353, 0.1079599958465788, 0.47400592737426483, 0.14972685326277918, 0.43272750134545823, 0.1839530796530385, 0.3872023336708212, 0.2360175325711591, 0.36032212454768675, 0.24261846353500535, 0.35770350120764394, 0.2606637836858316, 0.3526104381544335, 0.24668202254540886, 0.3717488388788273, 0.22920754299702897, 0.37769616507688464, 0.2246528336925301, 0.3765437598650894, 0.22041773376471022, 0.38047596041838994, 0.21923601658169187, 0.3798873698864591, 0.21700438236445285, 0.38291698672245644, 0.21827768053295463, 0.3641322152037017, 0.23729077006065105, 0.3676834419346081, 0.24865079519725933, 0.34415050295044936, 0.2733570818755685, 0.3306230780901629, 0.27350446437732157)
layer_slab LayerSpec | None

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

'SLAB150'
taper_angle float

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

55
taper_length float

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

12.6
fiber_angle float

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

5
info dict[str, Any] | None

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

None
bias_gap float

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

0
cross_section CrossSectionSpec

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

'strip'

grating_coupler_elliptical_lumerical_etch70

Returns a grating coupler from lumerical inverse design 3D optimization.

this is a wrapper of components.grating_coupler_elliptical_arbitrary https://support.lumerical.com/hc/en-us/articles/1500000306621 https://support.lumerical.com/hc/en-us/articles/360042800573

Here are the simulation settings used in lumerical

n_bg=1.44401 #Refractive index of the background material (cladding)
wg=3.47668   # Refractive index of the waveguide material (core)
lambda0=1550e-9
bandwidth = 0e-9
polarization = 'TE'
wg_width=500e-9 # Waveguide width
wg_height=220e-9 # Waveguide height
etch_depth=80e-9 # etch depth
theta_fib_mat = 5 # Angle of the fiber mode in material
theta_taper=30
efficiency=0.55 # 5.2 dB

Parameters:

Name Type Description Default
parameters Floats

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

(-2.4298362615732447, 0.1, 0.48007023217536954, 0.1, 0.607397685752365, 0.1, 0.4498844003086115, 0.1, 0.4274116312627637, 0.1, 0.4757904248387285, 0.1, 0.5026649898504233, 0.10002922416240886, 0.5100366774007897, 0.1, 0.494399635363353, 0.1079599958465788, 0.47400592737426483, 0.14972685326277918, 0.43272750134545823, 0.1839530796530385, 0.3872023336708212, 0.2360175325711591, 0.36032212454768675, 0.24261846353500535, 0.35770350120764394, 0.2606637836858316, 0.3526104381544335, 0.24668202254540886, 0.3717488388788273, 0.22920754299702897, 0.37769616507688464, 0.2246528336925301, 0.3765437598650894, 0.22041773376471022, 0.38047596041838994, 0.21923601658169187, 0.3798873698864591, 0.21700438236445285, 0.38291698672245644, 0.21827768053295463, 0.3641322152037017, 0.23729077006065105, 0.3676834419346081, 0.24865079519725933, 0.34415050295044936, 0.2733570818755685, 0.3306230780901629, 0.27350446437732157)
layer_slab LayerSpec | None

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

'SLAB150'
taper_angle float

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

55
taper_length float

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

12.6
fiber_angle float

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

5
info dict[str, Any] | None

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

{'etch_depth': 0.08, 'link': 'https://support.lumerical.com/hc/en-us/articles/1500000306621', 'fiber_angle': 5, 'width_min': 0.1, 'gap_min': 0.1, 'efficiency': 0.55}
bias_gap float

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

0
cross_section CrossSectionSpec

see :func:gdsfactory.components.grating_couplers.grating_coupler_elliptical_lumerical.grating_coupler_elliptical_lumerical for details.

'strip'

grating_coupler_elliptical_te

Grating coupler with parametrization based on Lumerical FDTD simulation.

Parameters:

Name Type Description Default
polarization str

te or tm.

'te'
taper_length float

taper length from input.

16.6
taper_angle float

grating flare angle.

40.0
wavelength float

grating transmission central wavelength (um).

1.554
fiber_angle float

fibre angle in degrees determines ellipticity.

15.0
grating_line_width float

in um.

0.343
neff float

tooth effective index.

2.638
nclad float

cladding effective index.

1.443
n_periods int

number of periods.

30
big_last_tooth bool

adds a big_last_tooth.

False
layer_slab LayerSpec | None

layer that protects the slab under the grating.

'SLAB150'
slab_xmin float

where 0 is at the start of the taper.

-1.0
slab_offset float

in um.

2.0
spiked bool

grating teeth have sharp spikes to avoid non-manhattan drc errors.

True
cross_section CrossSectionSpec

specification (CrossSection, string or dict).

      fiber

   /  /  /  /
  /  /  /  /
'strip'
            _|-|_|-|_|-|___ layer
               layer_slab |
        o1  ______________|

grating_coupler_elliptical_tm

Grating coupler with parametrization based on Lumerical FDTD simulation.

Parameters:

Name Type Description Default
polarization str

te or tm.

'tm'
taper_length float

taper length from input.

30
taper_angle float

grating flare angle.

40.0
wavelength float

grating transmission central wavelength (um).

1.554
fiber_angle float

fibre angle in degrees determines ellipticity.

15.0
grating_line_width float

in um.

0.707
neff float

tooth effective index.

1.8
nclad float

cladding effective index.

1.443
n_periods int

number of periods.

16
big_last_tooth bool

adds a big_last_tooth.

False
layer_slab LayerSpec | None

layer that protects the slab under the grating.

'SLAB150'
slab_xmin float

where 0 is at the start of the taper.

-2
slab_offset float

in um.

2.0
spiked bool

grating teeth have sharp spikes to avoid non-manhattan drc errors.

True
cross_section CrossSectionSpec

specification (CrossSection, string or dict).

      fiber

   /  /  /  /
  /  /  /  /
'strip'
            _|-|_|-|_|-|___ layer
               layer_slab |
        o1  ______________|

grating_coupler_elliptical_trenches

Returns Grating coupler with defined trenches.

Some foundries define the grating coupler by a shallow etch step (trenches) Others define the slab that they keep (see grating_coupler_elliptical)

Parameters:

Name Type Description Default
polarization str

'te' or 'tm'.

'te'
taper_length float

taper length from straight I/O.

16.6
taper_angle float

grating flare angle.

30.0
trenches_extra_angle float

extra angle for the trenches.

9.0
wavelength float

grating transmission central wavelength.

1.53
fiber_angle float

fibre polish angle in degrees.

15.0
grating_line_width float

of the 220 ridge.

0.343
neff float

tooth effective index.

2.638
ncladding float

cladding index.

1.443
layer_trench LayerSpec

for the trench.

'SHALLOW_ETCH'
p_start int

first tooth.

26
n_periods int

number of grating teeth.

30
end_straight_length float

at the end of straight.

0.2
taper ComponentSpec

taper function.

'taper'
cross_section CrossSectionSpec

cross_section spec.

      fiber
'strip'
               /  /  /  /
              /  /  /  /
            _|-|_|-|_|-|___
    WG  o1  ______________|

grating_coupler_elliptical_uniform

Grating coupler with parametrization based on Lumerical FDTD simulation.

The ellipticity is derived from Lumerical knowledge base it depends on fiber_angle (degrees), neff, and nclad

Parameters:

Name Type Description Default
n_periods int

number of grating periods.

20
period float

grating pitch in um.

0.75
fill_factor float

ratio of grating width vs gap.

0.5

Other Parameters:

Name Type Description
taper_length

taper length from input.

taper_angle

grating flare angle.

wavelength

grating transmission central wavelength (um).

fiber_angle

fibre angle in degrees determines ellipticity.

neff

tooth effective index to compute ellipticity.

nclad

cladding effective index to compute ellipticity.

layer_slab

Optional slab.

taper_to_slab_offset

where 0 is at the start of the taper.

polarization

te or tm.

spiked

grating teeth have spikes to avoid drc errors..

bias_gap

etch gap (um). Positive bias increases gap and reduces width to keep period constant.

cross_section

cross_section spec for waveguide port.

kwargs Any

cross_section settings.

      fiber

   /  /  /  /
  /  /  /  /
            _|-|_|-|_|-|___ layer
               layer_slab |
        o1  ______________|

grating_coupler_loss

Grating coupler test structure for de-embeding fiber array.

Connects channel 1->3, 1->5 ... 1->nfibers with grating couplers.

Only odd channels are connected to the grating couplers as even channels in the align_tree.

Parameters:

Name Type Description Default
pitch float

um.

127.0
grating_coupler ComponentSpec

spec.

'grating_coupler_elliptical_trenches'
cross_section CrossSectionSpec

spec.

'strip'
port_name str

for the grating_coupler port.

'o1'
rotation float

degrees.

-90
nfibers int

number of fibers to connect.

10
grating_coupler_spacing float

um.

5.0

grating_coupler_rectangular

Grating coupler with rectangular shapes (not elliptical).

Needs longer taper than elliptical. Grating teeth are straight. For a focusing grating take a look at grating_coupler_elliptical.

Parameters:

Name Type Description Default
n_periods int

number of grating teeth.

20
period float

grating pitch.

0.75
fill_factor float

ratio of grating width vs gap.

0.5
width_grating float

11.

11.0
length_taper float

150.

150.0
polarization str

'te' or 'tm'.

'te'
wavelength float

in um.

1.55
taper ComponentSpec

function.

'taper'
layer_slab LayerSpec | None

layer that protects the slab under the grating.

'SLAB150'
layer_grating LayerSpec | None

layer for the grating.

None
fiber_angle float

in degrees.

15
slab_xmin float

where 0 is at the start of the taper.

-1.0
slab_offset float

from edge of grating to edge of the slab.

1.0
cross_section CrossSectionSpec

for input waveguide port.

'strip'
            _|-|_|-|_|-|___ layer
               layer_slab |
        o1  ______________|
    top view     _________
                /| | | | |
               / | | | | |
              /taper_angle
             /_ _| | | | |
    wg_width |   | | | | |
             \   | | | | |
              \  | | | | |
               \ | | | | |
                \|_|_|_|_|
             <-->
            taper_length

grating_coupler_rectangular_arbitrary

Grating coupler uniform with rectangular shape (not elliptical).

Therefore it needs a longer taper. Grating teeth are straight instead of elliptical.

Parameters:

Name Type Description Default
gaps Floats

list of gaps between grating teeth.

(0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2)
widths Floats

list of grating widths.

(0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5)
width_grating float

grating teeth width.

11.0
length_taper float

taper length (um).

150.0
polarization str

'te' or 'tm'.

'te'
wavelength float

in um.

1.55
layer_grating LayerSpec | None

Optional layer for grating. \ by default None uses cross_section.layer. \ if different from cross_section.layer expands taper.

None
layer_slab LayerSpec | None

layer that protects the slab under the grating.

None
slab_xmin float

where 0 is at the start of the taper.

-1.0
slab_offset float

from edge of grating to edge of the slab.

1.0
fiber_angle float

in degrees.

15
cross_section CrossSectionSpec

for input waveguide port.

      fiber

   /  /  /  /
  /  /  /  /
'strip'
            _|-|_|-|_|-|___ layer
               layer_slab |
        o1  ______________|
    top view     _________
                /| | | | |
               / | | | | |
              /taper_angle
             /_ _| | | | |
    wg_width |   | | | | |
             \   | | | | |
              \  | | | | |
               \ | | | | |
                \|_|_|_|_|
             <-->
            taper_length

grating_coupler_te

Returns Grating coupler with defined trenches.

Some foundries define the grating coupler by a shallow etch step (trenches) Others define the slab that they keep (see grating_coupler_elliptical)

Parameters:

Name Type Description Default
polarization str

'te' or 'tm'.

'te'
taper_length float

taper length from straight I/O.

16.6
taper_angle float

grating flare angle.

35
trenches_extra_angle float

extra angle for the trenches.

9.0
wavelength float

grating transmission central wavelength.

1.53
fiber_angle float

fibre polish angle in degrees.

15.0
grating_line_width float

of the 220 ridge.

0.343
neff float

tooth effective index.

2.638
ncladding float

cladding index.

1.443
layer_trench LayerSpec

for the trench.

'SHALLOW_ETCH'
p_start int

first tooth.

26
n_periods int

number of grating teeth.

30
end_straight_length float

at the end of straight.

0.2
taper ComponentSpec

taper function.

'taper'
cross_section CrossSectionSpec

cross_section spec.

      fiber
'strip'
               /  /  /  /
              /  /  /  /
            _|-|_|-|_|-|___
    WG  o1  ______________|

grating_coupler_tm

Returns Grating coupler with defined trenches.

Some foundries define the grating coupler by a shallow etch step (trenches) Others define the slab that they keep (see grating_coupler_elliptical)

Parameters:

Name Type Description Default
polarization str

'te' or 'tm'.

'tm'
taper_length float

taper length from straight I/O.

16.6
taper_angle float

grating flare angle.

30.0
trenches_extra_angle float

extra angle for the trenches.

9.0
wavelength float

grating transmission central wavelength.

1.53
fiber_angle float

fibre polish angle in degrees.

15.0
grating_line_width float

of the 220 ridge.

0.6
neff float

tooth effective index.

1.8
ncladding float

cladding index.

1.443
layer_trench LayerSpec

for the trench.

'SHALLOW_ETCH'
p_start int

first tooth.

26
n_periods int

number of grating teeth.

30
end_straight_length float

at the end of straight.

0.2
taper ComponentSpec

taper function.

'taper'
cross_section CrossSectionSpec

cross_section spec.

      fiber
'strip'
               /  /  /  /
              /  /  /  /
            _|-|_|-|_|-|___
    WG  o1  ______________|

grating_coupler_tree

Array of straights connected with grating couplers.

useful to align the 4 corners of the chip

Parameters:

Name Type Description Default
n int

number of gratings.

4
straight_spacing float

in um.

4.0
grating_coupler ComponentSpec

spec.

'grating_coupler_elliptical_te'
with_loopback bool

adds loopback.

False
bend ComponentSpec

bend spec.

'bend_euler'
fanout_length float

in um.

0.0
cross_section CrossSectionSpec

cross_section function.

'strip'
kwargs Any

additional arguments.

{}

greek_cross

Simple greek cross with via stacks at the endpoints.

Process control monitor for dopant sheet resistivity and linewidth variation.

Parameters:

Name Type Description Default
length float

length of cross arms.

30
layers LayerSpecs

list of layers.

('WG', 'N')
widths Floats

list of widths (same order as layers).

(2.0, 3.0)
offsets Floats | None

how much to extend each layer beyond the cross length negative shorter, positive longer.

None
via_stack ComponentSpec

via component to attach to the cross.

'via_stack_npp_m1'
layer_index int

index of the layer to connect the via_stack to.

0
        via_stack
        <------->
        _________       length          ________
        |       |<-------------------->|        |
    2x  |       |     |   ↓       |<-->|        |
        |       |======== width =======|        |
        |_______|<--> |   ↑       |<-->|________|
                offset            offset

References: - Walton, Anthony J.. “MICROELECTRONIC TEST STRUCTURES.” (1999). - W. Versnel, Analysis of the Greek cross, a Van der Pauw structure with finite contacts, Solid-State Electronics, Volume 22, Issue 11, 1979, Pages 911-914, ISSN 0038-1101, https://doi.org/10.1016/0038-1101(79)90061-3. - S. Enderling et al., "Sheet resistance measurement of non-standard cleanroom materials using suspended Greek cross test structures," IEEE Transactions on Semiconductor Manufacturing, vol. 19, no. 1, pp. 2-9, Feb. 2006, doi: 10.1109/TSM.2005.863248. - https://download.tek.com/document/S530_VanDerPauwSheetRstnce.pdf

greek_cross_with_pads

Greek cross under 4 DC pads, ready to test.

Parameters:

Name Type Description Default
pad ComponentSpec

component to use for probe pads.

'pad'
pad_pitch float

spacing between pads.

150.0
greek_cross_component ComponentSpec

component to use for greek cross.

'greek_cross'
pad_via ComponentSpec

via to add to the pad.

'via_stack_m1_mtop'
cross_section CrossSectionSpec

cross-section for cross via to pad via wiring.

metal1
pad_port_name str

name of the port to connect to the greek cross.

'e4'

Parameters:

Name Type Description Default
pad ComponentSpec

see :func:gdsfactory.components.pcms.greek_cross.greek_cross_with_pads for details.

'pad'
pad_pitch float

see :func:gdsfactory.components.pcms.greek_cross.greek_cross_with_pads for details.

150.0
greek_cross_component ComponentSpec

see :func:gdsfactory.components.pcms.greek_cross.greek_cross_with_pads for details.

'greek_cross'
pad_via ComponentSpec

see :func:gdsfactory.components.pcms.greek_cross.greek_cross_with_pads for details.

'via_stack_m1_mtop'
cross_section CrossSectionSpec

see :func:gdsfactory.components.pcms.greek_cross.greek_cross_with_pads for details.

metal1
pad_port_name str

see :func:gdsfactory.components.pcms.greek_cross.greek_cross_with_pads for details.

'e4'

h_junction

Returns a microfluidic H-junction.

A horizontal main channel with two vertical branches extending up and down from the center. Optionally adds circular reservoirs at the four endpoints.

Parameters:

Name Type Description Default
main_width float

width of the main horizontal channel.

1.0
branch_width float

width of the vertical branch channels.

1.0
main_length float

total length of the main channel.

20.0
branch_length float

length of each vertical branch.

10.0
reservoir_radius float

radius of circular reservoirs at endpoints (0 to disable).

0.0
n_reservoir_points int

number of polygon points for reservoir circles.

64
layer LayerSpec

layer spec.

'WG'
port_type str | None

None, optical, or electrical.

'optical'

hexagon

Returns a regular N-sided polygon, with ports on each edge.

Parameters:

Name Type Description Default
sides int

number of sides for the polygon.

6
side_length float

of the edges.

10
layer LayerSpec

Specific layer to put polygon geometry on.

'WG'
port_width float | None

the width of port of the polygon (in electrical pads, the port width may not equal to the side length).

None
port_type str | None

optical, electrical.

'placement'

hline

Creates a horizontal straight line component with ports on east and west sides.

This component is commonly used in photonic and superconducting circuits as a basic waveguide or transmission line element. It creates a rectangular polygon with ports at both ends for easy connection to other components.

Parameters:

Name Type Description Default
length float

Length of the line in microns. Must be positive.

10.0
width float

Width of the line in microns. Must be positive.

0.5
layer LayerSpec

Layer specification for the line (default: "WG"). Can be a string or a tuple of (layer, datatype).

'WG'
port_type str

Type of port to create (default: "optical"). Common values are "optical" for photonic circuits or "electrical" for superconducting circuits.

'optical'

Returns:

Name Type Description
Component Component

A gdsfactory Component object containing: - A rectangular polygon representing the line - Two ports named "o1" (west) and "o2" (east) - Component info with width and length values

Note
  • The line is centered vertically at y=0
  • Port "o1" is at x=0 with orientation 180° (west)
  • Port "o2" is at x=length with orientation 0° (east)
  • If length or width is 0 or negative, no polygon is created but ports are still added

inductor

Create a 2-turn inductor.

Parameters:

Name Type Description Default
width float

Width of the inductor trace in micrometers.

2.0
space float

Space between turns in micrometers.

2.1
diameter float

Inner diameter in micrometers.

25.35
resistance float

Resistance in ohms.

0.5777
inductance float

Inductance in henries.

3.3303e-11
turns int

Number of turns (default 1 for inductor2).

1
layer_metal LayerSpec

Layer for the metal trace.

'M3'
layer_inductor LayerSpec

Layer for the inductor region.

'M1'
layer_metal_pin LayerSpec

Layer for the metal pins.

'WG_PIN'
layers_no_fill LayerSpecs

Layers to exclude from fill.

('DEVREC', 'NO_TILE_SI')

Returns:

Type Description
Component

Component with inductor layout.

interdigital_capacitor

Generate an interdigital capacitor component with ports on both ends.

An interdigital capacitor consists of interleaved metal fingers that create a distributed capacitance. This component creates a planar capacitor with two sets of interleaved fingers extending from opposite ends.

See for example Zhu et al., Accurate circuit model of interdigital capacitor and its application to design of new quasi-lumped miniaturized filters with suppression of harmonic resonance, doi: 10.1109/22.826833.

Note

finger_length=0 effectively provides a parallel plate capacitor. The capacitance scales approximately linearly with the number of fingers and finger length.

Parameters:

Name Type Description Default
fingers int

Total number of fingers of the capacitor (must be >= 1).

4
finger_length float | int

Length of each finger in μm.

20.0
finger_gap float | int

Gap between adjacent fingers in μm.

2.0
thickness float | int

Thickness of fingers and the base section in μm.

5.0
layer LayerSpec

Layer specification for the capacitor geometry.

'M1'

Returns:

Name Type Description
Component Component

A gdsfactory component with the interdigital capacitor geometry

Component

and two electrical ports ('e1' and 'e2') on opposing sides.

interdigitated_electrodes

Interdigitated electrode pattern.

Two horizontal bus bars (top and bottom) with alternating fingers extending from each bus toward the opposite one. Fingers from the top bus extend downward and fingers from the bottom bus extend upward, interleaving with a gap between the finger tips and the opposite bus.

Parameters:

Name Type Description Default
n_fingers int

Total number of fingers (split between top and bottom buses).

10
finger_width float

Width of each finger in um.

0.5
finger_length float

Length of each finger in um.

10.0
finger_gap float

Gap between adjacent fingers (edge to edge) in um.

0.5
bus_width float

Width (height) of each bus bar in um.

2.0
bus_length float | None

Length of each bus bar in um. Defaults to the total width needed to accommodate all fingers.

None
layer LayerSpec

Layer specification for all geometry.

'MTOP'
port_type str

Port type for electrical ports at bus bar ends.

'electrical'

litho_calipers

Vernier caliper structure to test lithography alignment.

Only the middle finger is aligned and the rest are offset. adapted from phidl

Parameters:

Name Type Description Default
notch_size Size

[xwidth, yheight].

(2.0, 5.0)
notch_spacing float

in um.

2.0
num_notches int

number of notches.

11
offset_per_notch float

in um.

0.1
row_spacing float

0

0.0
layer1 LayerSpec

layer.

'WG'
layer2 LayerSpec

layer.

'SLAB150'

litho_ruler

Ruler structure for lithographic measurement.

Includes marks of varying scales to allow for easy reading by eye.

based on phidl.geometry

Parameters:

Name Type Description Default
height float

Height of the ruling marks in um.

2
width float

Width of the ruling marks in um.

0.5
spacing float

Center-to-center spacing of the ruling marks in um.

2.0
scale tuple[float, ...]

Height scale pattern of marks.

(3, 1, 1, 1, 1, 2, 1, 1, 1, 1)
num_marks int

Total number of marks to generate.

21
layer LayerSpec

Specific layer to put the ruler geometry on.

'WG'

litho_steps

Positive + negative tone linewidth test.

used for lithography resolution test patterning based on phidl

Parameters:

Name Type Description Default
line_widths tuple[float, ...]

in um.

(1.0, 2.0, 4.0, 8.0, 16.0)
line_spacing float

in um.

10.0
height float

in um.

100.0
layer LayerSpec

Specific layer to put the ruler geometry on.

'WG'

loop_mirror

Returns Sagnac loop_mirror.

Parameters:

Name Type Description Default
component ComponentSpec

1x2 splitter.

'mmi1x2'
bend90 ComponentSpec

90 deg bend.

'bend_euler'
cross_section CrossSectionSpec

cross_section settings.

'strip'

marker_te

Returns a rectangle.

Parameters:

Name Type Description Default
size Size

(tuple) Width and height of rectangle.

(10.4, 10.4)
layer LayerSpec

Specific layer to put polygon geometry on.

'TE'
centered bool

True sets center to (0, 0), False sets south-west to (0, 0).

True
port_type str | None

optical, electrical.

'electrical'
port_orientations Ints | None

list of port_orientations to add. None adds no ports.

(180, 90, 0, -90)

marker_tm

Returns a rectangle.

Parameters:

Name Type Description Default
size Size

(tuple) Width and height of rectangle.

(10.4, 10.4)
layer LayerSpec

Specific layer to put polygon geometry on.

'TM'
centered bool

True sets center to (0, 0), False sets south-west to (0, 0).

True
port_type str | None

optical, electrical.

'electrical'
port_orientations Ints | None

list of port_orientations to add. None adds no ports.

(180, 90, 0, -90)

meander_channel

Returns a microfluidic meander (serpentine) channel.

Builds a series of connected rectangles forming a serpentine path. Starts from the left, goes right for straight_length, turns up/down by turn_spacing, goes back left, and repeats for n_turns. Rectangular reservoirs are added at the inlet and outlet when reservoir_length > 0.

Parameters:

Name Type Description Default
channel_width float

width of the channel.

1.0
n_turns int

number of straight segments (horizontal passes).

5
turn_spacing float

center-to-center vertical spacing between passes.

5.0
straight_length float

length of each horizontal segment.

20.0
reservoir_length float

length of the reservoirs at inlet/outlet.

5.0
reservoir_height float

height of the reservoirs at inlet/outlet.

5.0
layer LayerSpec

layer spec.

'WG'
port_type str | None

None, optical, or electrical.

'optical'

mmi

Mxn MultiMode Interferometer (MMI).

Parameters:

Name Type Description Default
inputs int

number of inputs.

1
outputs int

number of outputs.

4
width float | None

input and output straight width. Defaults to cross_section.

None
width_taper float

interface between input straights and mmi region.

1.0
length_taper float

into the mmi region.

10.0
length_mmi float

in x direction.

5.5
width_mmi float

in y direction.

5
gap_input_tapers float

gap between input tapers from edge to edge.

0.25
gap_output_tapers float

gap between output tapers from edge to edge.

0.25
taper ComponentSpec

taper function.

'taper'
straight ComponentSpec

straight function.

'straight'
cross_section CrossSectionSpec

specification (CrossSection, string or dict).

'strip'
input_positions list[float] | None

optional positions of the inputs.

None
output_positions list[float] | None

optional positions of the outputs.

None
               length_mmi
                <------>
                ________
               |        |
            __/          \__
        o2  __            __  o3
              \          /_ _ _ _
              |         | _ _ _ _| gap_output_tapers
            __/          \__
        o1  __            __  o4
              \          /
               |________|
             | |
             <->
        length_taper

mmi1x2

1x2 MultiMode Interferometer (MMI).

Parameters:

Name Type Description Default
width float | None

input and output straight width. Defaults to cross_section width.

None
width_taper float

interface between input straights and mmi region.

1.0
length_taper float

into the mmi region.

10.0
length_mmi float

in x direction.

5.5
width_mmi float

in y direction.

2.5
gap_mmi float

gap between tapered wg.

0.25
taper ComponentSpec

taper function.

taper_function
straight ComponentSpec

straight function.

straight_function
cross_section CrossSectionSpec

specification (CrossSection, string or dict).

'strip'
           length_mmi
            <------>
            ________
           |        |
           |         \__
           |          __  o2
        __/          /_ _ _ _
     o1 __          | _ _ _ _| gap_mmi
          \          \__
           |          __  o3
           |         /
           |________|
     <->
length_taper

mmi1x2_with_sbend

Returns 1x2 splitter for Cband.

https://opg.optica.org/oe/fulltext.cfm?uri=oe-21-1-1310&id=248418

Parameters:

Name Type Description Default
with_sbend bool

add sbend.

True
s_bend ComponentFactory

S-bend spec.

bend_s
cross_section CrossSectionSpec

spec.

'strip'

mmi2x2

Mmi 2x2.

Parameters:

Name Type Description Default
width float | None

input and output straight width.

None
width_taper float

interface between input straights and mmi region.

1.0
length_taper float

into the mmi region.

10.0
length_mmi float

in x direction.

5.5
width_mmi float

in y direction.

2.5
gap_mmi float

(width_taper + gap between tapered wg)/2.

0.25
taper ComponentSpec

taper function.

taper_function
straight ComponentSpec

straight function.

straight_function
cross_section CrossSectionSpec

spec.

'strip'
               length_mmi
                <------>
                ________
               |        |
            __/          \__
        o2  __            __  o3
              \          /_ _ _ _
              |         | _ _ _ _| gap_mmi
            __/          \__
        o1  __            __  o4
              \          /
               |________|
         <->
    length_taper

mmi2x2_with_sbend

Returns mmi2x2 for Cband.

C_band 2x2MMI in 220nm thick silicon https://opg.optica.org/oe/fulltext.cfm?uri=oe-25-23-28957&id=376719

Parameters:

Name Type Description Default
with_sbend bool

add sbend.

True
s_bend ComponentFactory

S-bend function.

bend_s
cross_section CrossSectionSpec

spec.

'strip'

mmi_90degree_hybrid

90 degree hybrid based on a 4x4 MMI.

Default values from Watanabe et al., "Coherent few mode demultiplexer realized as a 2D grating coupler array in silicon", Optics Express 28(24), 2020

It could be interesting to consider the design in Guan et al., "Compact and low loss 90° optical hybrid on a silicon-on-insulator platform", Optics Express 25(23), 2017

Parameters:

Name Type Description Default
width float

input and output straight width.

0.5
width_taper float

interface between input straights and mmi region.

1.7
length_taper float

into the mmi region.

40.0
length_mmi float

in x direction.

175.0
width_mmi float

in y direction.

10.0
gap_mmi float

(width_taper + gap between tapered wg)/2.

0.8
straight ComponentSpec

straight function.

'straight'
cross_section CrossSectionSpec

spec.

'strip'
               length_mmi
                <------>
                ________
               |        |
            __/          \__
 signal_in  __            __  I_out1
              \          /_ _ _ _
              |         | _ _ _ _| gap_mmi
              |          \__
              |           __  Q_out1
              |          /
              |        |
              |
            __/          \__
    LO_in   __            __  Q_out2
              \          /_ _ _ _
              |         | _ _ _ _| gap_mmi
              |          \__
              |           __  I_out2
              |          /
              | ________|
         <->
    length_taper

mmi_tapered

Mxn MultiMode Interferometer (MMI).

This is jut a more general version of the mmi component. Make sure you simulate and optimize the component before using it.

Parameters:

Name Type Description Default
inputs int

number of inputs.

1
outputs int

number of outputs.

2
width float | None

input and output straight width. Defaults to cross_section.

None
width_taper_in float

interface between input straights and mmi region.

2.0
length_taper_in float

into the mmi region.

1.0
width_taper_out float | None

interface between mmi region and output straights.

None
length_taper_out float | None

into the mmi region.

None
width_taper float

interface between mmi region and output straights.

1.0
length_taper float

into the mmi region.

10.0
length_taper_start float | None

length of the taper at the start. Defaults to length_taper.

None
length_taper_end float | None

length of the taper at the end. Defaults to length_taper.

None
length_mmi float

in x direction.

5.5
width_mmi float

in y direction.

5
width_mmi_inner float | None

allows adding a different width for the inner mmi region.

None
gap_input_tapers float

gap between input tapers from edge to edge.

0.25
gap_output_tapers float

gap between output tapers from edge to edge.

0.25
taper ComponentFactory

taper function.

taper_function
cross_section CrossSectionSpec

specification (CrossSection, string or dict).

'strip'
input_positions list[float] | None

optional positions of the inputs.

None
output_positions list[float] | None

optional positions of the outputs.

None
                                   ┌───────────┐
                                   │           ├───────────────┐
                                   │           │               ├────────────┐
           width_taper             │           │               │            │
                ▲ ┌────────────────┤           │               ├────────────┘
                │ │                │           ├───────────────┘
    ┌───────────┼─┤                │           │
    │           │ │                │           │
    ◄───────────┼─►                │           ├───────────────┐
    └───────────┼─┐                │           │               ├─────────────┐
                ▼ └────────────────┤           │               │             │
                  ◄───────────────►│           │               ├─────────────┘
    length_taper    length_taper_in│           ├───────────────┘ length_taper
    ◄────────────►                 └───────────┘◄────────────►  ◄────────────►
        start                                  length_taper_out      end
                                   ◄───────────►
                                    length_mmi

mode_converter

Returns Mode converter from TE0 to TE1.

By matching the effective indices of two waveguides with different widths, light can couple from different transverse modes e.g. TE0 <-> TE1. https://doi.org/10.1109/JPHOT.2019.2941742

Parameters:

Name Type Description Default
gap float

directional coupler gap.

0.3
length float

coupler length interaction.

10
coupler_straight_asymmetric ComponentSpec

spec.

'coupler_straight_asymmetric'
bend ComponentSpec

spec.

partial(bend_s, size=(25, 3))
taper ComponentSpec

spec.

'taper'
mm_width float

input/output multimode waveguide width.

1.2
mc_mm_width float

mode converter multimode waveguide width

1
sm_width float

single mode waveguide width.

0.5
taper_length float

taper length.

25
cross_section CrossSectionSpec

cross_section spec.

'strip'
    o2 ---           --- o4
          \         /
           \       /
            -------
    o1 -----=======----- o3
            |-----|
            length
= : multimode width
- : singlemode width

move_port_to_zero

Return a container that contains a reference to the original component.

The new component has port_name in (0, 0).

Parameters:

Name Type Description Default
component Component

to move the port to (0, 0).

required
port_name str

to move to (0, 0).

'o1'
mirror bool

if True, mirrors the component.

False

mzi

Mzi.

Parameters:

Name Type Description Default
delta_length float

bottom arm vertical extra length.

10.0
length_y float

vertical length for both and top arms.

2.0
length_x float | None

horizontal length. None uses to the straight_x_bot/top defaults.

0.1
bend ComponentSpec

90 degrees bend library.

'bend_euler'
straight ComponentSpec

straight function.

'straight'
straight_y ComponentSpec | None

straight for length_y and delta_length.

None
straight_x_top ComponentSpec | None

top straight for length_x.

None
straight_x_bot ComponentSpec | None

bottom straight for length_x.

None
splitter ComponentSpec

splitter function.

'mmi1x2'
combiner ComponentSpec | None

combiner function.

None
with_splitter bool

if False removes splitter.

True
port_e1_splitter str

east top splitter port.

'o2'
port_e0_splitter str

east bot splitter port.

'o3'
port_e1_combiner str

east top combiner port.

'o2'
port_e0_combiner str

east bot combiner port.

'o3'
port1 str

input port name.

'o1'
port2 str

output port name.

'o2'
nbends int

from straight top/bot to combiner (at least 2).

2
cross_section CrossSectionSpec

for routing (sxtop/sxbot to combiner).

'strip'
cross_section_x_top CrossSectionSpec | None

optional top cross_section (defaults to cross_section).

None
cross_section_x_bot CrossSectionSpec | None

optional bottom cross_section (defaults to cross_section).

None
mirror_bot bool

if true, mirrors the bottom arm.

False
add_optical_ports_arms bool

add all other optical ports in the arms with top\_ and bot\_ prefix.

False
min_length float

minimum length for the straight.

0.01
auto_rename_ports bool

if True, renames ports.

True
auto_detect_port_names bool

whether to auto detect ports names. Ignores port_e* arguments if True.

False
                   b2______b3
                  |  sxtop  |
          straight_y        |
                  |         |
                  b1        b4
        splitter==|         |==combiner
                  b5        b8
                  |         |
          straight_y        |
                  |         |
    delta_length/2          |
                  |         |
                 b6__sxbot__b7
                      Lx

mzi1x2

Mzi.

Parameters:

Name Type Description Default
delta_length float

bottom arm vertical extra length.

10.0
length_y float

vertical length for both and top arms.

2.0
length_x float | None

horizontal length. None uses to the straight_x_bot/top defaults.

0.1
bend ComponentSpec

90 degrees bend library.

'bend_euler'
straight ComponentSpec

straight function.

'straight'
straight_y ComponentSpec | None

straight for length_y and delta_length.

None
straight_x_top ComponentSpec | None

top straight for length_x.

None
straight_x_bot ComponentSpec | None

bottom straight for length_x.

None
splitter ComponentSpec

splitter function.

'mmi1x2'
combiner ComponentSpec | None

combiner function.

'mmi1x2'
with_splitter bool

if False removes splitter.

True
port_e1_splitter str

east top splitter port.

'o2'
port_e0_splitter str

east bot splitter port.

'o3'
port_e1_combiner str

east top combiner port.

'o2'
port_e0_combiner str

east bot combiner port.

'o3'
port1 str

input port name.

'o1'
port2 str

output port name.

'o2'
nbends int

from straight top/bot to combiner (at least 2).

2
cross_section CrossSectionSpec

for routing (sxtop/sxbot to combiner).

'strip'
cross_section_x_top CrossSectionSpec | None

optional top cross_section (defaults to cross_section).

None
cross_section_x_bot CrossSectionSpec | None

optional bottom cross_section (defaults to cross_section).

None
mirror_bot bool

if true, mirrors the bottom arm.

False
add_optical_ports_arms bool

add all other optical ports in the arms with top\_ and bot\_ prefix.

False
min_length float

minimum length for the straight.

0.01
auto_rename_ports bool

if True, renames ports.

True
auto_detect_port_names bool

whether to auto detect ports names. Ignores port_e* arguments if True.

False
                   b2______b3
                  |  sxtop  |
          straight_y        |
                  |         |
                  b1        b4
        splitter==|         |==combiner
                  b5        b8
                  |         |
          straight_y        |
                  |         |
    delta_length/2          |
                  |         |
                 b6__sxbot__b7
                      Lx

mzi1x2_2x2

Mzi.

Parameters:

Name Type Description Default
delta_length float

bottom arm vertical extra length.

10.0
length_y float

vertical length for both and top arms.

2.0
length_x float | None

horizontal length. None uses to the straight_x_bot/top defaults.

0.1
bend ComponentSpec

90 degrees bend library.

'bend_euler'
straight ComponentSpec

straight function.

'straight'
straight_y ComponentSpec | None

straight for length_y and delta_length.

None
straight_x_top ComponentSpec | None

top straight for length_x.

None
straight_x_bot ComponentSpec | None

bottom straight for length_x.

None
splitter ComponentSpec

splitter function.

'mmi1x2'
combiner ComponentSpec | None

combiner function.

'mmi2x2'
with_splitter bool

if False removes splitter.

True
port_e1_splitter str

east top splitter port.

'o2'
port_e0_splitter str

east bot splitter port.

'o3'
port_e1_combiner str

east top combiner port.

'o3'
port_e0_combiner str

east bot combiner port.

'o4'
port1 str

input port name.

'o1'
port2 str

output port name.

'o2'
nbends int

from straight top/bot to combiner (at least 2).

2
cross_section CrossSectionSpec

for routing (sxtop/sxbot to combiner).

'strip'
cross_section_x_top CrossSectionSpec | None

optional top cross_section (defaults to cross_section).

None
cross_section_x_bot CrossSectionSpec | None

optional bottom cross_section (defaults to cross_section).

None
mirror_bot bool

if true, mirrors the bottom arm.

False
add_optical_ports_arms bool

add all other optical ports in the arms with top\_ and bot\_ prefix.

False
min_length float

minimum length for the straight.

0.01
auto_rename_ports bool

if True, renames ports.

True
auto_detect_port_names bool

whether to auto detect ports names. Ignores port_e* arguments if True.

False
                   b2______b3
                  |  sxtop  |
          straight_y        |
                  |         |
                  b1        b4
        splitter==|         |==combiner
                  b5        b8
                  |         |
          straight_y        |
                  |         |
    delta_length/2          |
                  |         |
                 b6__sxbot__b7
                      Lx

mzi2x2_2x2

Mzi.

Parameters:

Name Type Description Default
delta_length float

bottom arm vertical extra length.

10.0
length_y float

vertical length for both and top arms.

2.0
length_x float | None

horizontal length. None uses to the straight_x_bot/top defaults.

None
bend ComponentSpec

90 degrees bend library.

'bend_euler'
straight ComponentSpec

straight function.

'straight'
straight_y ComponentSpec | None

straight for length_y and delta_length.

None
straight_x_top ComponentSpec | None

top straight for length_x.

None
straight_x_bot ComponentSpec | None

bottom straight for length_x.

None
splitter ComponentSpec

splitter function.

'mmi2x2'
combiner ComponentSpec | None

combiner function.

'mmi2x2'
with_splitter bool

if False removes splitter.

True
port_e1_splitter str

east top splitter port.

'o3'
port_e0_splitter str

east bot splitter port.

'o4'
port_e1_combiner str

east top combiner port.

'o3'
port_e0_combiner str

east bot combiner port.

'o4'
port1 str

input port name.

'o1'
port2 str

output port name.

'o2'
nbends int

from straight top/bot to combiner (at least 2).

2
cross_section CrossSectionSpec

for routing (sxtop/sxbot to combiner).

'strip'
cross_section_x_top CrossSectionSpec | None

optional top cross_section (defaults to cross_section).

None
cross_section_x_bot CrossSectionSpec | None

optional bottom cross_section (defaults to cross_section).

None
mirror_bot bool

if true, mirrors the bottom arm.

False
add_optical_ports_arms bool

add all other optical ports in the arms with top\_ and bot\_ prefix.

False
min_length float

minimum length for the straight.

0.01
auto_rename_ports bool

if True, renames ports.

True
auto_detect_port_names bool

whether to auto detect ports names. Ignores port_e* arguments if True.

False
                   b2______b3
                  |  sxtop  |
          straight_y        |
                  |         |
                  b1        b4
        splitter==|         |==combiner
                  b5        b8
                  |         |
          straight_y        |
                  |         |
    delta_length/2          |
                  |         |
                 b6__sxbot__b7
                      Lx

mzi2x2_2x2_phase_shifter

Mzi.

Parameters:

Name Type Description Default
delta_length float

bottom arm vertical extra length.

10.0
length_y float

vertical length for both and top arms.

2.0
length_x float | None

horizontal length. None uses to the straight_x_bot/top defaults.

200
bend ComponentSpec

90 degrees bend library.

'bend_euler'
straight ComponentSpec

straight function.

'straight'
straight_y ComponentSpec | None

straight for length_y and delta_length.

None
straight_x_top ComponentSpec | None

top straight for length_x.

'straight_heater_metal'
straight_x_bot ComponentSpec | None

bottom straight for length_x.

None
splitter ComponentSpec

splitter function.

'mmi2x2'
combiner ComponentSpec | None

combiner function.

'mmi2x2'
with_splitter bool

if False removes splitter.

True
port_e1_splitter str

east top splitter port.

'o3'
port_e0_splitter str

east bot splitter port.

'o4'
port_e1_combiner str

east top combiner port.

'o3'
port_e0_combiner str

east bot combiner port.

'o4'
port1 str

input port name.

'o1'
port2 str

output port name.

'o2'
nbends int

from straight top/bot to combiner (at least 2).

2
cross_section CrossSectionSpec

for routing (sxtop/sxbot to combiner).

'strip'
cross_section_x_top CrossSectionSpec | None

optional top cross_section (defaults to cross_section).

None
cross_section_x_bot CrossSectionSpec | None

optional bottom cross_section (defaults to cross_section).

None
mirror_bot bool

if true, mirrors the bottom arm.

False
add_optical_ports_arms bool

add all other optical ports in the arms with top\_ and bot\_ prefix.

False
min_length float

minimum length for the straight.

0.01
auto_rename_ports bool

if True, renames ports.

True
auto_detect_port_names bool

whether to auto detect ports names. Ignores port_e* arguments if True.

False
                   b2______b3
                  |  sxtop  |
          straight_y        |
                  |         |
                  b1        b4
        splitter==|         |==combiner
                  b5        b8
                  |         |
          straight_y        |
                  |         |
    delta_length/2          |
                  |         |
                 b6__sxbot__b7
                      Lx

mzi_coupler

Mzi.

Parameters:

Name Type Description Default
delta_length float

bottom arm vertical extra length.

10.0
length_y float

vertical length for both and top arms.

2.0
length_x float | None

horizontal length. None uses to the straight_x_bot/top defaults.

None
bend ComponentSpec

90 degrees bend library.

'bend_euler'
straight ComponentSpec

straight function.

'straight'
straight_y ComponentSpec | None

straight for length_y and delta_length.

None
straight_x_top ComponentSpec | None

top straight for length_x.

None
straight_x_bot ComponentSpec | None

bottom straight for length_x.

None
splitter ComponentSpec

splitter function.

'coupler'
combiner ComponentSpec | None

combiner function.

'coupler'
with_splitter bool

if False removes splitter.

True
port_e1_splitter str

east top splitter port.

'o3'
port_e0_splitter str

east bot splitter port.

'o4'
port_e1_combiner str

east top combiner port.

'o3'
port_e0_combiner str

east bot combiner port.

'o4'
port1 str

input port name.

'o1'
port2 str

output port name.

'o2'
nbends int

from straight top/bot to combiner (at least 2).

2
cross_section CrossSectionSpec

for routing (sxtop/sxbot to combiner).

'strip'
cross_section_x_top CrossSectionSpec | None

optional top cross_section (defaults to cross_section).

None
cross_section_x_bot CrossSectionSpec | None

optional bottom cross_section (defaults to cross_section).

None
mirror_bot bool

if true, mirrors the bottom arm.

False
add_optical_ports_arms bool

add all other optical ports in the arms with top\_ and bot\_ prefix.

False
min_length float

minimum length for the straight.

0.01
auto_rename_ports bool

if True, renames ports.

True
auto_detect_port_names bool

whether to auto detect ports names. Ignores port_e* arguments if True.

False
                   b2______b3
                  |  sxtop  |
          straight_y        |
                  |         |
                  b1        b4
        splitter==|         |==combiner
                  b5        b8
                  |         |
          straight_y        |
                  |         |
    delta_length/2          |
                  |         |
                 b6__sxbot__b7
                      Lx

mzi_lattice

Mzi lattice filter.

Parameters:

Name Type Description Default
coupler_lengths Sequence[float]

list of length for each coupler.

(10.0, 20.0)
coupler_gaps Sequence[float]

list of coupler gaps.

(0.2, 0.3)
delta_lengths Sequence[float]

list of length differences.

(10.0,)
mzi str

function for the mzi.

'mzi_coupler'
splitter str

splitter function.

'coupler'
kwargs Any

additional settings.

{}

Other Parameters:

Name Type Description
length_y

vertical length for both and top arms.

length_x

horizontal length.

bend

90 degrees bend library.

straight

straight function.

straight_y

straight for length_y and delta_length.

straight_x_top

top straight for length_x.

straight_x_bot

bottom straight for length_x.

cross_section

for routing (sxtop/sxbot to combiner).

           ______             ______
          |      |           |      |
          |      |           |      |
     cp1==|      |===cp2=====|      |=== .... ===cp_last===
          |      |           |      |
          |      |           |      |
         DL1     |          DL2     |
          |      |           |      |
          |______|           |      |
                             |______|

mzi_lattice_mmi

Mzi lattice filter, with MMI couplers.

Parameters:

Name Type Description Default
coupler_widths tuple[float | None, float | None]

(for each MMI coupler, list of) input and output straight width.

(None, None)
coupler_widths_tapers tuple[float, ...]

(for each MMI coupler, list of) interface between input straights and mmi region.

(1.0, 1.0)
coupler_lengths_tapers tuple[float, ...]

(for each MMI coupler, list of) into the mmi region.

(10.0, 10.0)
coupler_lengths_mmis tuple[float, ...]

(for each MMI coupler, list of) in x direction.

(5.5, 5.5)
coupler_widths_mmis tuple[float, ...]

(for each MMI coupler, list of) in y direction.

(2.5, 2.5)
coupler_gaps_mmis tuple[float, ...]

(for each MMI coupler, list of) (width_taper + gap between tapered wg)/2.

(0.25, 0.25)
taper_functions_mmis tuple[str, ...]

(for each MMI coupler, list of) taper function.

('taper', 'taper')
straight_functions_mmis tuple[str, ...]

(for each MMI coupler, list of) straight function.

('straight', 'straight')
cross_sections_mmis tuple[str, ...]

(for each MMI coupler, list of) spec.

('strip', 'strip')
delta_lengths tuple[float, ...]

list of length differences.

(10.0,)
mzi str

function for the mzi.

'mzi2x2_2x2'
splitter str

splitter function.

'mmi2x2'
kwargs Any

additional settings.

{}

Other Parameters:

Name Type Description
length_y

vertical length for both and top arms.

length_x

horizontal length.

bend

90 degrees bend library.

straight

straight function.

straight_y

straight for length_y and delta_length.

straight_x_top

top straight for length_x.

straight_x_bot

bottom straight for length_x.

cross_section

for routing (sxtop/sxbot to combiner).

           ______             ______
          |      |           |      |
          |      |           |      |
     cp1==|      |===cp2=====|      |=== .... ===cp_last===
          |      |           |      |
          |      |           |      |
         DL1     |          DL2     |
          |      |           |      |
          |______|           |      |
                             |______|

mzi_pads_center

Return Mzi phase shifter with pads in the middle.

GND is the middle pad and is shared between top and bottom phase shifters.

Parameters:

Name Type Description Default
ps_top ComponentSpec

phase shifter top.

'straight_heater_metal'
ps_bot ComponentSpec

phase shifter bottom.

'straight_heater_metal'
mzi ComponentSpec

interferometer.

'mzi'
pad ComponentSpec

pad function.

'pad_small'
length_x float

horizontal length.

500
length_y float

vertical length.

40
mzi_sig_top str | None

port name for top phase shifter signal. None if no connection.

'top_r_e2'
mzi_gnd_top str | None

port name for top phase shifter GND. None if no connection.

'top_l_e2'
mzi_sig_bot str | None

port name for top phase shifter signal. None if no connection.

'bot_l_e2'
mzi_gnd_bot str | None

port name for top phase shifter GND. None if no connection.

'bot_r_e2'
pad_sig_bot str

port name for top pad.

'e1_1_1'
pad_sig_top str

port name for top pad.

'e3_1_3'
pad_gnd_bot str

port name for top pad.

'e4_1_2'
pad_gnd_top str

port name for top pad.

'e2_1_2'
delta_length float

mzi length imbalance.

40.0
cross_section CrossSectionSpec

for the mzi.

'strip'
cross_section_metal CrossSectionSpec

for routing metal.

'metal_routing'
pad_pitch float | str

pad pitch in um.

'pad_pitch'
auto_taper bool

add taper if cross_section width is different between mzi and pad.

False
kwargs Any

routing settings.

{}

mzi_phase_shifter

Mzi.

Parameters:

Name Type Description Default
delta_length float

bottom arm vertical extra length.

10.0
length_y float

vertical length for both and top arms.

2.0
length_x float | None

horizontal length. None uses to the straight_x_bot/top defaults.

200
bend ComponentSpec

90 degrees bend library.

'bend_euler'
straight ComponentSpec

straight function.

'straight'
straight_y ComponentSpec | None

straight for length_y and delta_length.

None
straight_x_top ComponentSpec | None

top straight for length_x.

'straight_heater_metal'
straight_x_bot ComponentSpec | None

bottom straight for length_x.

None
splitter ComponentSpec

splitter function.

'mmi1x2'
combiner ComponentSpec | None

combiner function.

None
with_splitter bool

if False removes splitter.

True
port_e1_splitter str

east top splitter port.

'o2'
port_e0_splitter str

east bot splitter port.

'o3'
port_e1_combiner str

east top combiner port.

'o2'
port_e0_combiner str

east bot combiner port.

'o3'
port1 str

input port name.

'o1'
port2 str

output port name.

'o2'
nbends int

from straight top/bot to combiner (at least 2).

2
cross_section CrossSectionSpec

for routing (sxtop/sxbot to combiner).

'strip'
cross_section_x_top CrossSectionSpec | None

optional top cross_section (defaults to cross_section).

None
cross_section_x_bot CrossSectionSpec | None

optional bottom cross_section (defaults to cross_section).

None
mirror_bot bool

if true, mirrors the bottom arm.

False
add_optical_ports_arms bool

add all other optical ports in the arms with top\_ and bot\_ prefix.

False
min_length float

minimum length for the straight.

0.01
auto_rename_ports bool

if True, renames ports.

True
auto_detect_port_names bool

whether to auto detect ports names. Ignores port_e* arguments if True.

False
                   b2______b3
                  |  sxtop  |
          straight_y        |
                  |         |
                  b1        b4
        splitter==|         |==combiner
                  b5        b8
                  |         |
          straight_y        |
                  |         |
    delta_length/2          |
                  |         |
                 b6__sxbot__b7
                      Lx

mzi_phase_shifter_top_heater_metal

Mzi.

Parameters:

Name Type Description Default
delta_length float

bottom arm vertical extra length.

10.0
length_y float

vertical length for both and top arms.

2.0
length_x float | None

horizontal length. None uses to the straight_x_bot/top defaults.

200
bend ComponentSpec

90 degrees bend library.

'bend_euler'
straight ComponentSpec

straight function.

'straight'
straight_y ComponentSpec | None

straight for length_y and delta_length.

None
straight_x_top ComponentSpec | None

top straight for length_x.

'straight_heater_metal'
straight_x_bot ComponentSpec | None

bottom straight for length_x.

None
splitter ComponentSpec

splitter function.

'mmi1x2'
combiner ComponentSpec | None

combiner function.

None
with_splitter bool

if False removes splitter.

True
port_e1_splitter str

east top splitter port.

'o2'
port_e0_splitter str

east bot splitter port.

'o3'
port_e1_combiner str

east top combiner port.

'o2'
port_e0_combiner str

east bot combiner port.

'o3'
port1 str

input port name.

'o1'
port2 str

output port name.

'o2'
nbends int

from straight top/bot to combiner (at least 2).

2
cross_section CrossSectionSpec

for routing (sxtop/sxbot to combiner).

'strip'
cross_section_x_top CrossSectionSpec | None

optional top cross_section (defaults to cross_section).

None
cross_section_x_bot CrossSectionSpec | None

optional bottom cross_section (defaults to cross_section).

None
mirror_bot bool

if true, mirrors the bottom arm.

False
add_optical_ports_arms bool

add all other optical ports in the arms with top\_ and bot\_ prefix.

False
min_length float

minimum length for the straight.

0.01
auto_rename_ports bool

if True, renames ports.

True
auto_detect_port_names bool

whether to auto detect ports names. Ignores port_e* arguments if True.

False
                   b2______b3
                  |  sxtop  |
          straight_y        |
                  |         |
                  b1        b4
        splitter==|         |==combiner
                  b5        b8
                  |         |
          straight_y        |
                  |         |
    delta_length/2          |
                  |         |
                 b6__sxbot__b7
                      Lx

mzi_pin

Mzi.

Parameters:

Name Type Description Default
delta_length float

bottom arm vertical extra length.

0.0
length_y float

vertical length for both and top arms.

2.0
length_x float | None

horizontal length. None uses to the straight_x_bot/top defaults.

100
bend ComponentSpec

90 degrees bend library.

'bend_euler'
straight ComponentSpec

straight function.

'straight'
straight_y ComponentSpec | None

straight for length_y and delta_length.

None
straight_x_top ComponentSpec | None

top straight for length_x.

'straight_pin'
straight_x_bot ComponentSpec | None

bottom straight for length_x.

None
splitter ComponentSpec

splitter function.

'mmi1x2'
combiner ComponentSpec | None

combiner function.

None
with_splitter bool

if False removes splitter.

True
port_e1_splitter str

east top splitter port.

'o2'
port_e0_splitter str

east bot splitter port.

'o3'
port_e1_combiner str

east top combiner port.

'o2'
port_e0_combiner str

east bot combiner port.

'o3'
port1 str

input port name.

'o1'
port2 str

output port name.

'o2'
nbends int

from straight top/bot to combiner (at least 2).

2
cross_section CrossSectionSpec

for routing (sxtop/sxbot to combiner).

'strip'
cross_section_x_top CrossSectionSpec | None

optional top cross_section (defaults to cross_section).

'pin'
cross_section_x_bot CrossSectionSpec | None

optional bottom cross_section (defaults to cross_section).

None
mirror_bot bool

if true, mirrors the bottom arm.

False
add_optical_ports_arms bool

add all other optical ports in the arms with top\_ and bot\_ prefix.

False
min_length float

minimum length for the straight.

0.01
auto_rename_ports bool

if True, renames ports.

True
auto_detect_port_names bool

whether to auto detect ports names. Ignores port_e* arguments if True.

False
                   b2______b3
                  |  sxtop  |
          straight_y        |
                  |         |
                  b1        b4
        splitter==|         |==combiner
                  b5        b8
                  |         |
          straight_y        |
                  |         |
    delta_length/2          |
                  |         |
                 b6__sxbot__b7
                      Lx

mzit

Mzi tolerant to fabrication variations.

based on Yufei Xing thesis http://photonics.intec.ugent.be/publications/PhD.asp?ID=250

Parameters:

Name Type Description Default
w0 float

input waveguide width (um).

0.5
w1 float

narrow waveguide width (um).

0.45
w2 float

wide waveguide width (um).

0.55
dy Delta

port to port vertical spacing.

2.0
delta_length float

length difference between arms (um).

10.0
length float

shared length for w1 and w2.

1.0
coupler_length1 float

length of coupler1.

5.0
coupler_length2 float

length of coupler2.

10.0
coupler_gap1 float

coupler1.

0.2
coupler_gap2 float

coupler2.

0.3
taper ComponentSpec

taper spec.

'taper'
taper_length float

from w0 to w1.

5.0
bend90 ComponentSpec

bend spec.

'bend_euler'
straight ComponentSpec

spec.

'straight'
coupler1 ComponentSpec | None

coupler1 spec (optional).

'coupler'
coupler2 ComponentSpec

coupler2 spec.

'coupler'
cross_section str

cross_section spec.

'strip'
                       cp1
        4   2 __                  __  3___w0_t2   _w2___
                \                /                      \
                 \    length1   /                        |
                  ============== gap1                    |
                 /              \                        |
              __/                \_____w0___t1   _w1     |
        3   1                        4               \   |
                                                     |   |
        2   2                                        |   |
              __                  __w0____t1____w1___/   |
                \                /                       |
                 \    length2   /                        |
                  ============== gap2                    |
                 /               \                       |                       |
              __/                 \ E0_w0__t2 __w1______/
        1   1
                       cp2

mzit_lattice

Mzi fab tolerant lattice filter.

Parameters:

Name Type Description Default
coupler_lengths Sequence[float]

list of coupler lengths, in um. One per coupler.

(10.0, 20.0)
coupler_gaps Sequence[float]

list of coupler gaps, in um. One per coupler.

(0.2, 0.3)
delta_lengths Sequence[float]

list of length differences between the MZI arms, in um. One per MZI, so one less than the number of couplers.

(10.0,)
mzi ComponentSpec

MZI component spec.

mzit
                cp1
o4  o2 __                  __ o3___w0_t2   _w2___
         \                /                      \
                 \    length1   /                        |
           ============== gap1                    |
          /              \                        |
       __/                \_____w0___t1   _w1     |
o3  o1                       o4               \   | .
                 ...                          |   | .
o2  o2                    o3                  |   | .
       __                  _____w0___t1___w1__/   |
         \                /                       |
          \    lengthN   /                        |
           ============== gapN                    |
          /               \                       |
       __/                 \_                     |
o1  o1                      \___w0___t2___w1_____/
                cpN       o4

mzm

Mzi.

Parameters:

Name Type Description Default
delta_length float

bottom arm vertical extra length.

10.0
length_y float

vertical length for both and top arms.

2.0
length_x float | None

horizontal length. None uses to the straight_x_bot/top defaults.

200
bend ComponentSpec

90 degrees bend library.

'bend_euler'
straight ComponentSpec

straight function.

'straight'
straight_y ComponentSpec | None

straight for length_y and delta_length.

None
straight_x_top ComponentSpec | None

top straight for length_x.

'straight_pin'
straight_x_bot ComponentSpec | None

bottom straight for length_x.

'straight_pin'
splitter ComponentSpec

splitter function.

'mmi1x2'
combiner ComponentSpec | None

combiner function.

None
with_splitter bool

if False removes splitter.

True
port_e1_splitter str

east top splitter port.

'o2'
port_e0_splitter str

east bot splitter port.

'o3'
port_e1_combiner str

east top combiner port.

'o2'
port_e0_combiner str

east bot combiner port.

'o3'
port1 str

input port name.

'o1'
port2 str

output port name.

'o2'
nbends int

from straight top/bot to combiner (at least 2).

2
cross_section CrossSectionSpec

for routing (sxtop/sxbot to combiner).

'strip'
cross_section_x_top CrossSectionSpec | None

optional top cross_section (defaults to cross_section).

None
cross_section_x_bot CrossSectionSpec | None

optional bottom cross_section (defaults to cross_section).

None
mirror_bot bool

if true, mirrors the bottom arm.

False
add_optical_ports_arms bool

add all other optical ports in the arms with top\_ and bot\_ prefix.

False
min_length float

minimum length for the straight.

0.01
auto_rename_ports bool

if True, renames ports.

True
auto_detect_port_names bool

whether to auto detect ports names. Ignores port_e* arguments if True.

False
                   b2______b3
                  |  sxtop  |
          straight_y        |
                  |         |
                  b1        b4
        splitter==|         |==combiner
                  b5        b8
                  |         |
          straight_y        |
                  |         |
    delta_length/2          |
                  |         |
                 b6__sxbot__b7
                      Lx

nxn

Returns a nxn component with nxn ports (west, east, north, south).

Parameters:

Name Type Description Default
west int

number of west ports.

1
east int

number of east ports.

4
north int

number of north ports.

0
south int

number of south ports.

0
xsize float

size in X.

8.0
ysize float

size in Y.

8.0
wg_width float

width of the straight ports.

0.5
layer LayerSpec

layer.

'WG'
wg_margin float

margin from straight to component edge.

1.0
kwargs Any

port_settings.

{}
        3   4
        |___|_
    2 -|      |- 5
       |      |
    1 -|______|- 6
        |   |
        8   7

octagon

Returns a regular N-sided polygon, with ports on each edge.

Parameters:

Name Type Description Default
sides int

number of sides for the polygon.

8
side_length float

of the edges.

10
layer LayerSpec

Specific layer to put polygon geometry on.

'WG'
port_width float | None

the width of port of the polygon (in electrical pads, the port width may not equal to the side length).

None
port_type str | None

optical, electrical.

'placement'

optimal_90deg

Returns optimally-rounded 90 degree bend that is sharp on the outer corner.

Parameters:

Name Type Description Default
width float

Width of the ports on either side of the bend.

100
num_pts int

The number of points comprising the curved section of the bend.

15
length_adjust float

Adjusts the length of the non-curved portion of the bend.

1
layer LayerSpec

Specific layer(s) to put polygon geometry on.

(1, 0)
Notes

Optimal structure from https://doi.org/10.1103/PhysRevB.84.174510 Clem, J., & Berggren, K. (2011). Geometry-dependent critical currents in superconducting nanocircuits. Physical Review B, 84(17), 1-27.

optimal_hairpin

Returns an optimally-rounded hairpin geometry, with a 180 degree turn.

based on phidl.geometry

Parameters:

Name Type Description Default
width float

Width of the hairpin leads.

0.2
pitch float

Distance between the two hairpin leads. Must be greater than width.

0.6
length float

Length of the hairpin from the connectors to the opposite end of the curve.

10
turn_ratio float

int or float Specifies how much of the hairpin is dedicated to the 180 degree turn. A turn_ratio of 10 will result in 20% of the hairpin being comprised of the turn.

4
num_pts int

Number of points constituting the 180 degree turn.

50
layer LayerSpec

Specific layer(s) to put polygon geometry on.

(1, 0)
Notes

Hairpin pitch must be greater than width.

Optimal structure from https://doi.org/10.1103/PhysRevB.84.174510 Clem, J., & Berggren, K. (2011). Geometry-dependent critical currents in superconducting nanocircuits. Physical Review B, 84(17), 1-27.

optimal_step

Returns an optimally-rounded step geometry.

Parameters:

Name Type Description Default
start_width float

Width of the connector on the left end of the step.

10
end_width float

Width of the connector on the right end of the step.

22
num_pts int

number of points comprising the entire step geometry.

50
width_tol float

Point at which to terminate the calculation of the optimal step

0.001
anticrowding_factor float

Factor to reduce current crowding by elongating the structure and reducing the curvature

1.2
symmetric bool

If True, adds a mirrored copy of the step across the x-axis to the geometry and adjusts the width of the ports.

False
layer LayerSpec

layer spec to put polygon geometry on.

(1, 0)

based on phidl.geometry Optimal structure from https://doi.org/10.1103/PhysRevB.84.174510 Clem, J., & Berggren, K. (2011). Geometry-dependent critical currents in superconducting nanocircuits. Physical Review B, 84(17), 1-27.

pack_doe

Packs a component DOE (Design of Experiment) using pack.

Parameters:

Name Type Description Default
doe ComponentSpec | None

function to return Components.

None
settings Mapping[str, Sequence[MetaData]] | None

component settings.

None
do_permutations bool

for each setting.

False
function CellSpec | None

to apply (add padding, grating couplers).

None
kwargs Any

for pack.

{}

Other Parameters:

Name Type Description
spacing

Minimum distance between adjacent shapes.

aspect_ratio

(width, height) ratio of the rectangular bin.

max_size

Limits the size into which the shapes will be packed.

sort_by_area

Pre-sorts the shapes by area.

density

Values closer to 1 pack tighter but require more computation.

precision

Desired precision for rounding vertex coordinates.

text

Optional function to add text labels.

text_prefix

for labels. For example. 'A' for 'A1', 'A2'...

text_offsets

relative to component size info anchor. Defaults to center.

text_anchors

relative to component (ce cw nc ne nw sc se sw center cc).

name_prefix

for each packed component (avoids the Unnamed cells warning). Note that the suffix contains a uuid so the name will not be deterministic.

rotation

for each component in degrees.

h_mirror

horizontal mirror in y axis (x, 1) (1, 0). This is the most common.

v_mirror

vertical mirror using x axis (1, y) (0, y).

pack_doe_grid

Packs a component DOE (Design of Experiment) using grid.

Parameters:

Name Type Description Default
doe ComponentSpec | None

function to return Components.

None
settings Mapping[str, Sequence[MetaData]] | None

component settings.

None
do_permutations bool

for each setting.

False
function CellSpec | None

to apply to component (add padding, grating couplers).

None
with_text bool

includes text label.

False
kwargs Any

for grid.

{}

Other Parameters:

Name Type Description
spacing

between adjacent elements on the grid, can be a tuple for

separation

If True, guarantees elements are separated with fixed spacing

shape

x, y shape of the grid (see np.reshape).

align_x

{'x', 'xmin', 'xmax'} for x (column) alignment along.

align_y

{'y', 'ymin', 'ymax'} for y (row) alignment along.

edge_x

{'x', 'xmin', 'xmax'} for x (column) (ignored if separation = True).

edge_y

{'y', 'ymin', 'ymax'} for y (row) (ignored if separation = True).

rotation

for each component in degrees.

h_mirror

horizontal mirror y axis (x, 1) (1, 0). most common mirror.

v_mirror

vertical mirror using x axis (1, y) (0, y).

pad

Returns rectangular pad with ports.

Parameters:

Name Type Description Default
size Size | str

x, y size.

(100.0, 100.0)
layer LayerSpec

pad layer.

'MTOP'
bbox_layers tuple[LayerSpec, ...] | None

list of layers.

None
bbox_offsets tuple[float, ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size.

None
port_inclusion float

from edge.

0
port_orientation AngleInDegrees | None

in degrees for the center port.

0
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)
port_type str

port type for pad port.

'pad'

pad_array

Returns 2D array of pads.

Parameters:

Name Type Description Default
pad ComponentSpec

pad element.

'pad'
columns int

number of columns.

6
rows int

number of rows.

1
column_pitch float

x pitch.

150.0
row_pitch float

y pitch.

150.0
port_orientation AngleInDegrees

port orientation in deg. None for low speed DC ports.

0
size Float2 | None

pad size.

None
layer LayerSpec | None

pad layer.

'MTOP'
centered_ports bool

True add ports to center. False add ports to the edge.

False
auto_rename_ports bool

True to auto rename ports.

False

pad_array0

Returns 2D array of pads.

Parameters:

Name Type Description Default
pad ComponentSpec

pad element.

'pad'
columns int

number of columns.

1
rows int

number of rows.

3
column_pitch float

x pitch.

150.0
row_pitch float

y pitch.

150.0
port_orientation AngleInDegrees

port orientation in deg. None for low speed DC ports.

0
size Float2 | None

pad size.

None
layer LayerSpec | None

pad layer.

'MTOP'
centered_ports bool

True add ports to center. False add ports to the edge.

False
auto_rename_ports bool

True to auto rename ports.

False

pad_array180

Returns 2D array of pads.

Parameters:

Name Type Description Default
pad ComponentSpec

pad element.

'pad'
columns int

number of columns.

1
rows int

number of rows.

3
column_pitch float

x pitch.

150.0
row_pitch float

y pitch.

150.0
port_orientation AngleInDegrees

port orientation in deg. None for low speed DC ports.

180
size Float2 | None

pad size.

None
layer LayerSpec | None

pad layer.

'MTOP'
centered_ports bool

True add ports to center. False add ports to the edge.

False
auto_rename_ports bool

True to auto rename ports.

False

pad_array270

Returns 2D array of pads.

Parameters:

Name Type Description Default
pad ComponentSpec

pad element.

'pad'
columns int

number of columns.

6
rows int

number of rows.

1
column_pitch float

x pitch.

150.0
row_pitch float

y pitch.

150.0
port_orientation AngleInDegrees

port orientation in deg. None for low speed DC ports.

270
size Float2 | None

pad size.

None
layer LayerSpec | None

pad layer.

'MTOP'
centered_ports bool

True add ports to center. False add ports to the edge.

False
auto_rename_ports bool

True to auto rename ports.

False

pad_array90

Returns 2D array of pads.

Parameters:

Name Type Description Default
pad ComponentSpec

pad element.

'pad'
columns int

number of columns.

6
rows int

number of rows.

1
column_pitch float

x pitch.

150.0
row_pitch float

y pitch.

150.0
port_orientation AngleInDegrees

port orientation in deg. None for low speed DC ports.

90
size Float2 | None

pad size.

None
layer LayerSpec | None

pad layer.

'MTOP'
centered_ports bool

True add ports to center. False add ports to the edge.

False
auto_rename_ports bool

True to auto rename ports.

False

pad_gs

Returns a ground-signal pad.

Parameters:

Name Type Description Default
length float

length of the GS transmission line, in um.

100
cross_section str

GS cross_section spec.

'gs'

pad_gsg

Returns a ground-signal-ground pad with electrical pins.

Parameters:

Name Type Description Default
length float

length of the GSG transmission line, in um.

100
cross_section str

GSG cross_section spec.

'gsg'

pad_gsg_open

Returns high speed GSG pads for calibrating the RF probes.

Parameters:

Name Type Description Default
size Float2

for the short.

(22, 7)
layer_metal LayerSpec

for the short.

'MTOP'
metal_spacing float

in um.

5.0
short bool

if False returns an open.

False
pad ComponentSpec

function for pad.

'pad'
pad_pitch float

in um.

150
route_xsize float

in um.

50

pad_gsg_short

Returns high speed GSG pads for calibrating the RF probes.

Parameters:

Name Type Description Default
size Float2

for the short.

(22, 7)
layer_metal LayerSpec

for the short.

'MTOP'
metal_spacing float

in um.

5.0
short bool

if False returns an open.

True
pad ComponentSpec

function for pad.

'pad'
pad_pitch float

in um.

150
route_xsize float

in um.

50

pad_rectangular

Returns rectangular pad with ports.

Parameters:

Name Type Description Default
size Size | str

x, y size.

'pad_size'
layer LayerSpec

pad layer.

'MTOP'
bbox_layers tuple[LayerSpec, ...] | None

list of layers.

None
bbox_offsets tuple[float, ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size.

None
port_inclusion float

from edge.

0
port_orientation AngleInDegrees | None

in degrees for the center port.

0
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)
port_type str

port type for pad port.

'pad'

pad_small

Returns rectangular pad with ports.

Parameters:

Name Type Description Default
size Size | str

x, y size.

(80, 80)
layer LayerSpec

pad layer.

'MTOP'
bbox_layers tuple[LayerSpec, ...] | None

list of layers.

None
bbox_offsets tuple[float, ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size.

None
port_inclusion float

from edge.

0
port_orientation AngleInDegrees | None

in degrees for the center port.

0
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)
port_type str

port type for pad port.

'pad'

pads_shorted

Returns a 1D array of shorted_pads.

Parameters:

Name Type Description Default
pad ComponentSpec

pad spec.

'pad'
columns int

number of columns.

8
pad_pitch float

in um

150.0
layer_metal LayerSpec

for the short.

'MTOP'
metal_width float

for the short.

10

pie_arc

Returns a pie-shaped arc (sector/wedge), centered at origin.

The shape is a closed polygon from the origin along two radial lines connected by an elliptical arc.

Parameters:

Name Type Description Default
radius float

x-radius (or uniform radius if radius_y is None).

10.0
radius_y float | None

y-radius for elliptical arc. Defaults to radius.

None
start_angle float

start angle in degrees.

0.0
end_angle float

end angle in degrees.

90.0
angle_resolution float

degrees per arc point.

2.5
layer LayerSpec

layer spec.

'WG'

pixel

Returns a square pixel, the building block of the QR code.

Parameters:

Name Type Description Default
size int

side length of the square, in um.

1
layer LayerSpec

layer to use.

'WG'

pixel_array

Returns a pixel component from a string representing the pixels.

Parameters:

Name Type Description Default
pixels str

string representing the pixels

'\n XXX\nX X\nXXXXX\nX X\nX X\n\n'
pixel_size float

width/height for each pixel

10.0
layer LayerSpec

layer for each pixel

'M1'

polarization_splitter_rotator

Returns polarization splitter rotator.

"Novel concept for ultracompact polarization splitter-rotator based on silicon nanowires." By D. Dai, and J. E. Bowers (Optics express vol 19, no. 11 pp. 10940-10949 (2011)).

Parameters:

Name Type Description Default
width_taper_in Float3

Three west widths of the input tapers in um.

(0.54, 0.69, 0.83)
length_taper_in Float2 | Float3

Two or three length of the bend regions in um.

(4.0, 44.0)
width_coupler Float2

Top and bottom widths of the coupling region in um.

(0.9, 0.404)
length_coupler float

Length of the coupling region in um.

7.0
gap float

Distance between the coupler in um.

0.15
width_out float

Width of the splitter region in um.

0.54
length_out float

Length of the splitter region in um.

14.33
dy Delta

Port-to-port distance between the splitter region in um.

5.0
cross_section CrossSectionSpec

cross-section spec.

'strip'
Notes

The length of third input taper is automatically determined if only two lengths are in arguments.

qrcode

Returns QRCode.

Parameters:

Name Type Description Default
data str

string to encode.

'mask01'
psize int

pixel size.

1
layer LayerSpec

layer to use.

'WG'

ramp

Return a ramp component.

Based on phidl.

Parameters:

Name Type Description Default
length float

Length of the ramp section.

10.0
width1 float

Width of the start of the ramp section.

5.0
width2 float | None

Width of the end of the ramp section (defaults to width1).

8.0
layer LayerSpec

Specific layer to put polygon geometry on.

'WG'

rect_su_shape

Returns a rectangular S- or U-shaped routing structure.

The shape consists of three connected rectangular segments forming an S or U pattern. Positive and negative values of L1, L2, L3 produce different orientations (S-shape, U-shape, etc.).

Parameters:

Name Type Description Default
L1 float

length of first vertical segment.

10.0
L2 float

length of horizontal segment.

10.0
L3 float

length of second vertical segment.

20.0
width float

width of all segments.

1.0
layer LayerSpec

layer spec.

'WG'
port_type str | None

None, optical, or electrical.

'electrical'

rect_taper

Returns a rectangle connected to a linear taper.

The rectangle of width rect_width and length rect_length is connected on the right to a taper that linearly expands from rect_width to taper_width over taper_length.

Parameters:

Name Type Description Default
rect_width float

width of the rectangular section.

1.0
rect_length float

length of the rectangular section.

10.0
taper_length float

length of the taper section.

5.0
taper_width float

end width of the taper.

4.0
layer LayerSpec

layer spec.

'WG'
port_type str | None

None, optical, or electrical.

'optical'

rectangle

Returns a rectangle.

Parameters:

Name Type Description Default
size Size

(tuple) Width and height of rectangle.

(4.0, 2.0)
layer LayerSpec

Specific layer to put polygon geometry on.

'WG'
centered bool

True sets center to (0, 0), False sets south-west to (0, 0).

False
port_type str | None

optical, electrical.

'electrical'
port_orientations Ints | None

list of port_orientations to add. None adds no ports.

(180, 90, 0, -90)

rectangle_with_slits

Returns a rectangle with slits.

Metal slits reduce stress.

Parameters:

Name Type Description Default
size Size

(tuple) Width and height of rectangle.

(100.0, 200.0)
layer LayerSpec

Specific layer to put polygon geometry on.

'WG'
layer_slit LayerSpec | None

does a boolean NOT when None.

None
centered bool

True sets center to (0, 0), False sets south-west to (0, 0)

False
port_type str | None

for the rectangle.

None
slit_size Size

x, y slit size.

(1.0, 1.0)
slit_column_pitch float

pitch for columns of slits.

20
slit_row_pitch float

pitch for rows of slits.

20
slit_enclosure float

from slit to rectangle edge.

10
    slit_enclosure
    _____________________________________
    |<--->                              |
    |                                   |
    |      ______________________       |
    |     |                      |      |
    |     |                      | slit_size[1]
    |  _  |______________________|      |
    |  |                                |
    |  | slit_row_pitch                 |
    |  |                                |  size[1]
    |  |   ______________________       |
    |  |  |                      |      |
    |  |  |                      |      |
    |  _  |______________________|      |
    |     <--------------------->       |
    |            slit_size[0]           |
    |___________________________________|
                    size[0]

rectangles

Returns overimposed rectangles.

Parameters:

Name Type Description Default
size Size

(tuple) Width and height of rectangle.

(4.0, 2.0)
layers LayerSpecs

Specific layer to put polygon geometry on.

('WG', 'SLAB150')
offsets Sequence[float] | None

list of offsets. If None, all rectangles have a zero offset.

None
centered bool

True sets center to (0, 0), False sets south-west of first rectangle to (0, 0).

True
kwargs Any

additional arguments to pass to rectangle.

{}

Other Parameters:

Name Type Description
port_type

optical, electrical.

port_orientations

list of port_orientations to add.

        ┌──────────────┐
        │              │
        │   ┌──────┐   │
        │   │      │   │
        │   │      ├───►
        │   │      │offset
        │   └──────┘   │
        │              │
        └──────────────┘

regular_polygon

Returns a regular N-sided polygon, with ports on each edge.

Parameters:

Name Type Description Default
sides int

number of sides for the polygon.

6
side_length float

of the edges.

10
layer LayerSpec

Specific layer to put polygon geometry on.

'WG'
port_width float | None

the width of port of the polygon (in electrical pads, the port width may not equal to the side length).

None
port_type str | None

optical, electrical.

'placement'

resistance_meander

Return meander to test resistance.

based on phidl.geometry

Parameters:

Name Type Description Default
name str

Name of the component.

'net'
pad_size Size

Size of the two matched impedance pads (microns).

(50.0, 50.0)
num_squares int

Number of squares comprising the resonator wire.

1000
width float

The width of the squares (microns).

1.0
res_layer LayerSpec

resistance layer.

'MTOP'
pad_layer LayerSpec

pad layer.

'MTOP'

resistance_sheet

Returns Sheet resistance.

keeps connectivity for pads and first layer in layers

Parameters:

Name Type Description Default
width float

in um.

10.0
layers LayerSpecs

for the middle part.

('HEATER',)
layer_offsets Floats

from edge, positive: over, negative: inclusion.

(0, 0.2)
pad ComponentSpec

function to create a pad.

'via_stack_heater_mtop'
pad_size Size

in um.

(50.0, 50.0)
pad_pitch float

in um.

100.0
ohms_per_square float | None

optional sheet resistance to compute info.resistance.

None
pad_port_name str

port name for the pad.

'e4'

resolution_test_pattern

Radial Siemens star resolution test pattern.

Creates a circle of alternating filled/empty pie-shaped wedges. The pattern is useful for evaluating lithographic resolution, as the feature size decreases toward the center.

Parameters:

Name Type Description Default
radius float

Outer radius of the star pattern in um.

50.0
n_spokes int

Total number of spokes (filled + empty). Must be even.

36
width float

Target outer edge width of each spoke in um (informational; actual angular width is 360/n_spokes degrees).

1.0
layer LayerSpec

Layer specification for the filled wedges.

'WG'

resonator_cpw

Creates a half-wave coplanar waveguide (CPW) resonator.

The resonator is a meandered coplanar waveguide: a center conductor on layer_metal flanked by two slots on layer_gap which are etched out of the surrounding ground plane. Both ends are straight coupling arms whose slots are widened (or narrowed) to coupling_gap so the coupling to a feedline or qubit can be tuned independently of the resonator impedance.

Parameters:

Name Type Description Default
length float

Target length of the meandered section in μm. The number of meander turns is rounded to fit; the length actually drawn is reported in component.info["length"].

1000.0
width float

Width of the center conductor in μm.

10.0
gap float

Slot width on each side of the center conductor in μm.

6.0
meander_pitch float

Pitch between meander runs in μm. Sets the bend radius to meander_pitch / 2.

50.0
meander_width float

Span of each meander run in μm. Must exceed meander_pitch.

200.0
coupling_gap float

Slot width in the coupling arms in μm.

5.0
coupling_length float

Length of each coupling arm in μm.

100.0
layer_metal LayerSpec

Layer for the metal center conductor.

(1, 0)
layer_gap LayerSpec

Layer for the slots etched out of the ground plane.

(2, 0)
port_type str

Type of port to add to the component.

'electrical'

Returns:

Name Type Description
Component Component

A gdsfactory component with the CPW resonator geometry.

resonator_lumped

Creates a lumped element resonator: an interdigital capacitor in series with a meander inductor.

The interdigital capacitor and the meander inductor are galvanically connected by a straight interconnect, so the component is a two terminal series LC with ports on the outer terminal of each element.

Parameters:

Name Type Description Default
capacitor_fingers int

Number of fingers in the interdigital capacitor.

4
capacitor_finger_length float

Length of each capacitor finger in μm.

20.0
capacitor_finger_gap float

Gap between capacitor fingers in μm.

2.0
capacitor_thickness float

Thickness of capacitor fingers in μm.

5.0
inductor_width float

Width of the inductor wire in μm.

2.0
inductor_turns int

Number of 180 degree turns in the meander inductor.

3
inductor_radius float

Bend radius of the meander inductor in μm.

20.0
inductor_run float

Length of each straight run of the meander inductor in μm.

60.0
coupling_gap float

Length of the interconnect between capacitor and inductor in μm.

5.0
layer_metal LayerSpec

Layer for the metal structures.

(1, 0)
port_type str

Type of port to add to the component.

'electrical'

Returns:

Name Type Description
Component Component

A gdsfactory component with the lumped resonator geometry.

resonator_quarter_wave

Creates a quarter-wave coplanar waveguide resonator.

A quarter-wave resonator is shorted at one end and has maximum electric field at the open end, making it suitable for capacitive coupling.

Parameters:

Name Type Description Default
length float

Length of the quarter-wave resonator in μm.

2500.0
width float

Width of the center conductor in μm.

10.0
gap float

Gap width on each side of the center conductor in μm.

6.0
short_stub_length float

Length of the shorting stub in μm.

50.0
coupling_gap float

Gap for capacitive coupling in μm.

5.0
coupling_length float

Length of the coupling region in μm.

100.0
layer_metal LayerSpec

Layer for the metal conductor.

(1, 0)
layer_gap LayerSpec

Layer for the gaps.

(2, 0)
port_type str

Type of port to add to the component.

'electrical'

Returns:

Name Type Description
Component Component

A gdsfactory component with the quarter-wave resonator geometry.

ring

Returns a ring.

Parameters:

Name Type Description Default
radius float

ring radius.

10.0
width float

of the ring.

0.5
angle_resolution float

max number of degrees per point.

2.5
layer LayerSpec

layer.

'WG'
angle float

angular coverage of the ring

360
distance_resolution float | None

max distance between points. This is an alternate way to describe the resolution besides setting angle_resolution. If distance_resolution and angle_resolution are both set, distance_resolution determines the resolution.

None

ring_asymmetric

An asymmetric ring with straight waveguides between the bends.

Parameters:

Name Type Description Default
radius float

of the ring.

10.0
length_x float

horizontal straight length.

2.0
length_y float

vertical straight length.

4.0
straight ComponentSpec

straight component spec.

'straight'
bend ComponentSpec

bend component spec.

'bend_circular'
cross_section CrossSectionSpec

cross_section spec.

'strip'

ring_crow

Coupled ring resonators.

Parameters:

Name Type Description Default
gaps tuple[float, ...]

gap between rings.

(0.2, 0.2, 0.2, 0.2)
radius tuple[float, ...]

for each ring.

(10.0, 10.0, 10.0)
bends tuple[ComponentSpec, ...] | None

bend spec for each ring.

None
ring_cross_sections tuple[CrossSectionSpec, ...]

cross_section spec for each ring.

('strip', 'strip', 'strip')
length_x float

ring coupler length.

0
lengths_y tuple[float, ...]

vertical straight length.

(0, 0, 0)
input_straight_cross_section CrossSectionSpec | None

cross_section spec for input and output straight. Defaults to cross_section.

None
output_straight_cross_section CrossSectionSpec | None

cross_section spec for input and output straight. Defaults to cross_section.

None
cross_section CrossSectionSpec

cross_section spec for input and output straight.

--ct-- gap[N-1] | | sl sr ring[N-1] | | --cb-- gap[N-2]

. . .

--ct-- | | sl sr lengths_y[1], ring[1] | | --cb-- gap[1]

--ct-- | | sl sr lengths_y[0], ring[0] | | --cb-- gap[0]

length_x

'strip'

ring_crow_couplers

Coupled ring resonators with coupler components between gaps.

Parameters:

Name Type Description Default
radius Sequence[float]

for the bend and coupler.

(10.0, 10.0, 10.0)
bends Sequence[ComponentSpec]

bend specs.

('bend_circular', 'bend_circular', 'bend_circular')
ring_cross_sections Sequence[CrossSectionSpec]

cross_section for the ring.

('strip', 'strip', 'strip')
couplers Sequence[ComponentSpec]

coupling component between rings and bus.

('coupler', 'coupler', 'coupler', 'coupler')
     --==ct==-- gap[N-1]   <------- couplers[N-1]
      |      |
      sl     sr ring[N-1]
      |      |
     --==cb==-- gap[N-2]   <------- couplers[N-2]
     .
     .
     .
     --==ct==--
      |      |
      sl     sr lengths_y[1], ring[1]
      |      |
     --==cb==-- gap[1]
                            <------- couplers[1]
     --==ct==--
      |      |
      sl     sr lengths_y[0], ring[0]
      |      |
     --==cb==-- gap[0]      <------- couplers[0]
  length_x

ring_double

Returns a double bus ring.

two couplers (ct: top, cb: bottom) connected with two vertical straights (sl: left, sr: right)

Parameters:

Name Type Description Default
gap float

gap between for coupler.

0.2
gap_top float | None

gap for the top coupler. Defaults to gap.

None
gap_bot float | None

gap for the bottom coupler. Defaults to gap.

None
radius float | None

for the bend and coupler.

None
length_x float

ring coupler length.

0.01
length_y float

vertical straight length.

0.01
bend ComponentSpec

90 degrees bend spec.

'bend_euler'
straight ComponentSpec

straight spec.

'straight'
coupler_ring ComponentSpec

ring coupler spec.

'coupler_ring'
coupler_ring_top ComponentSpec | None

top ring coupler spec. Defaults to coupler_ring.

None
cross_section CrossSectionSpec

cross_section spec.

'strip'
length_extension float | None

straight length extension at the end of the coupler bottom ports.

None
       o2──────▲─────────o3
               │gap_top
       xx──────▼─────────xxx
      xxx                   xxx
    xxx                       xxx
   xx                           xxx
   x                             xxx
  xx                              xx▲
  xx                              xx│length_y
  xx                              xx▼
  xx                             xx
   xx          length_x          x
    xx     ◄───────────────►    x
     xx                       xxx
       xx                   xxx
        xxx──────▲─────────xxx
                 │gap
         o1──────▼─────────◄──────────────► o4
                            length_extension

ring_double_bend_coupler

Returns ring with double curved couplers.

Parameters:

Name Type Description Default
radius float

um.

5.0
gap float

um.

0.2
coupling_angle_coverage float

degrees.

70.0
bend ComponentAllAngleFactory

for bend.

bend_circular_all_angle
length_x float

horizontal straight length.

0.6
length_y float

vertical straight length.

0.6
cross_section_inner CrossSectionSpec

spec inner bend.

'strip'
cross_section_outer CrossSectionSpec

spec outer bend.

'strip'

ring_double_heater

Returns a double bus ring with heater on top.

two couplers (ct: top, cb: bottom) connected with two vertical straights (sl: left, sr: right)

Parameters:

Name Type Description Default
gap float

gap between for coupler.

0.2
gap_top float | None

gap for the top coupler. Defaults to gap.

None
gap_bot float | None

gap for the bottom coupler. Defaults to gap.

None
radius float | None

for the bend and coupler.

None
length_x float

ring coupler length.

1.0
length_y float

vertical straight length.

0.01
coupler_ring ComponentSpec

ring coupler spec.

'coupler_ring'
coupler_ring_top ComponentSpec | None

ring coupler spec for coupler away from vias (defaults to coupler_ring)

None
straight ComponentSpec

straight spec.

'straight'
bend ComponentSpec

bend spec.

'bend_euler'
cross_section_heater CrossSectionSpec

for heater.

'heater_metal'
cross_section_waveguide_heater CrossSectionSpec

for waveguide with heater.

'strip_heater_metal'
cross_section CrossSectionSpec

for regular waveguide.

'strip'
via_stack ComponentSpec

for heater to routing metal.

'via_stack_heater_mtop_mini'
port_orientation AngleInDegrees | None

for electrical ports to promote from via_stack.

None
via_stack_size Float2 | None

size of via_stack.

None
via_stack_offset Float2

x,y offset for via_stack.

(1, 0)
with_drop bool

adds drop ports.

True
length_extension float | None

straight length extension at the end of the coupler bottom ports.

None
length_extension_top float | None

straight length extension at the end of the coupler top ports.

None
length_extension_bot float | None

straight length extension at the end of the coupler bottom ports.

None
       o2──────▲─────────o3
               │gap_top
       xx──────▼─────────xxx
      xxx                   xxx
    xxx                       xxx
   xx                           xxx
   x                             xxx
  xx                              xx▲
  xx                              xx│length_y
  xx                              xx▼
  xx                             xx
   xx          length_x          x
    xx     ◄───────────────►    x
     xx                       xxx
       xx                   xxx
        xxx──────▲─────────xxx
                 │gap
         o1──────▼─────────o4

ring_double_pn

Returns add-drop pn ring with optional doped heater.

Parameters:

Name Type Description Default
add_gap float

gap to add waveguide. Bottom gap.

0.3
drop_gap float

gap to drop waveguide. Top gap.

0.3
radius float

for the bend and coupler.

5.0
doping_angle float

angle in degrees representing portion of ring that is doped.

85
cross_section CrossSectionFactory

cross_section spec for non-PN doped rib waveguide sections.

rib
pn_cross_section CrossSectionFactory

cross section of pn junction.

cross_section_pn
doped_heater bool

boolean for if we include doped heater or not.

True
doped_heater_angle_buffer float

angle in degrees buffering heater from pn junction.

10
doped_heater_layer LayerSpec

doping layer for heater.

'NPP'
doped_heater_width float

width of doped heater.

0.5
doped_heater_waveguide_offset float

distance from the center of the ring waveguide to the center of the doped heater.

2.175
heater_vias ComponentSpec

components specifications for heater vias

_heater_vias
with_drop bool

boolean for if we include drop waveguide or not.

True
kwargs Any

cross_section settings.

{}

ring_single

Returns a single ring resonator with a directional coupler.

This component creates a ring resonator that consists of: - A directional coupler (cb) at the bottom - Two vertical straights (sl, sr) on the left and right sides - Two bends (bl, br) connecting the vertical straights - A horizontal straight (st) at the top

The ring resonator is commonly used in photonic integrated circuits for: - Wavelength filtering - Optical modulation - Sensing applications - Optical switching

Parameters:

Name Type Description Default
gap float

Gap between the ring and the straight waveguide in the coupler (μm).

0.2
radius float | None

Radius of the ring bends (μm). If None, it will use the radius from the cross section.

None
length_x float

Length of the horizontal straight section (μm).

4.0
length_y float

Length of the vertical straight sections (μm).

0.6
bend ComponentSpec

Component spec for the 90-degree bends. Default is "bend_euler".

'bend_euler'
straight ComponentSpec

Component spec for the straight waveguides. Default is "straight".

'straight'
coupler_ring ComponentSpec

Component spec for the ring coupler. Default is "coupler_ring".

'coupler_ring'
cross_section CrossSectionSpec

Cross section spec for all waveguides. Default is "strip".

'strip'
length_extension float | None

straight length extension at the end of the coupler bottom ports.

None

Returns:

Name Type Description
Component Component

A gdsfactory Component containing the ring resonator with: - Two ports: "o1" (input) and "o2" (through) - All waveguide sections properly connected - Cross section applied to all waveguides

Raises:

Type Description
ValueError

If length_x or length_y is negative.

                xxxxxxxxxxxxx
            xxxxx           xxxx
          xxx                   xxx
        xxx                       xxx
       xx                           xxx
       x                             xxx
      xx                              xx▲
      xx                              xx│length_y
      xx                              xx▼
      xx                             xx
       xx          length_x          x
        xx     ◄───────────────►    x
         xx                       xxx
           xx                   xxx
            xxx──────▲─────────xxx
                     │gap
             o1──────▼─────────o2◄──────────────►
                                 length_extension

ring_single_array

Ring of single bus connected with straights.

Parameters:

Name Type Description Default
ring ComponentSpec

ring spec.

'ring_single'
spacing float

between rings.

15.0
list_of_dicts tuple[dict[str, Any], ...] | None

settings for each ring.

None
cross_section CrossSectionSpec

spec.

'strip'
       ______               ______
      |      |             |      |
      |      |  length_y   |      |
      |      |             |      |
     --======-- spacing ----==gap==--
  length_x

ring_single_bend_coupler

Returns ring with curved coupler.

TODO: enable euler bends.

Parameters:

Name Type Description Default
radius float

um.

5.0
gap float

um.

0.2
coupling_angle_coverage float

degrees.

180.0
bend_all_angle AnyComponentFactory

for bend.

bend_circular_all_angle
bend ComponentSpec

for bend.

'bend_circular'
bend_output ComponentSpec

for bend.

'bend_euler'
length_x float

horizontal straight length.

0.6
length_y float

vertical straight length.

0.6
cross_section_inner CrossSectionSpec

spec inner bend.

'strip'
cross_section_outer CrossSectionSpec

spec outer bend.

'strip'
kwargs Any

cross_section settings.

{}

ring_single_dut

Single bus ring made of two couplers (ct: top, cb: bottom) connected.

with two vertical straights (wyl: left, wyr: right) (Component Under Test) in the middle to extract loss from quality factor.

Parameters:

Name Type Description Default
component ComponentSpec

see :func:gdsfactory.components.rings.ring_single_dut.ring_single_dut for details.

'straight'
gap float

see :func:gdsfactory.components.rings.ring_single_dut.ring_single_dut for details.

0.2
length_x float

see :func:gdsfactory.components.rings.ring_single_dut.ring_single_dut for details.

4
length_y float

see :func:gdsfactory.components.rings.ring_single_dut.ring_single_dut for details.

0
radius float | None

see :func:gdsfactory.components.rings.ring_single_dut.ring_single_dut for details.

None
coupler ComponentSpec

see :func:gdsfactory.components.rings.ring_single_dut.ring_single_dut for details.

'coupler_ring'
bend ComponentSpec

see :func:gdsfactory.components.rings.ring_single_dut.ring_single_dut for details.

'bend_euler'
with_component bool

see :func:gdsfactory.components.rings.ring_single_dut.ring_single_dut for details.

True
port_name str

see :func:gdsfactory.components.rings.ring_single_dut.ring_single_dut for details.

'o1'
length_extension float | None

see :func:gdsfactory.components.rings.ring_single_dut.ring_single_dut for details.

None
kwargs Any

see :func:gdsfactory.components.rings.ring_single_dut.ring_single_dut for details.

{}

ring_single_heater

Returns a double bus ring with heater on top.

two couplers (ct: top, cb: bottom) connected with two vertical straights (sl: left, sr: right)

Parameters:

Name Type Description Default
gap float

gap between for coupler.

0.2
gap_top float | None

gap for the top coupler. Defaults to gap.

None
gap_bot float | None

gap for the bottom coupler. Defaults to gap.

None
radius float | None

for the bend and coupler.

None
length_x float

ring coupler length.

1.0
length_y float

vertical straight length.

0.01
coupler_ring ComponentSpec

ring coupler spec.

'coupler_ring'
coupler_ring_top ComponentSpec | None

ring coupler spec for coupler away from vias (defaults to coupler_ring)

None
straight ComponentSpec

straight spec.

'straight'
bend ComponentSpec

bend spec.

'bend_euler'
cross_section_heater CrossSectionSpec

for heater.

'heater_metal'
cross_section_waveguide_heater CrossSectionSpec

for waveguide with heater.

'strip_heater_metal'
cross_section CrossSectionSpec

for regular waveguide.

'strip'
via_stack ComponentSpec

for heater to routing metal.

'via_stack_heater_mtop_mini'
port_orientation AngleInDegrees | None

for electrical ports to promote from via_stack.

None
via_stack_size Float2 | None

size of via_stack.

None
via_stack_offset Float2

x,y offset for via_stack.

(1, 0)
with_drop bool

adds drop ports.

False
length_extension float | None

straight length extension at the end of the coupler bottom ports.

None
length_extension_top float | None

straight length extension at the end of the coupler top ports.

None
length_extension_bot float | None

straight length extension at the end of the coupler bottom ports.

None
       o2──────▲─────────o3
               │gap_top
       xx──────▼─────────xxx
      xxx                   xxx
    xxx                       xxx
   xx                           xxx
   x                             xxx
  xx                              xx▲
  xx                              xx│length_y
  xx                              xx▼
  xx                             xx
   xx          length_x          x
    xx     ◄───────────────►    x
     xx                       xxx
       xx                   xxx
        xxx──────▲─────────xxx
                 │gap
         o1──────▼─────────o4

ring_single_pn

Returns single pn ring with optional doped heater.

Parameters:

Name Type Description Default
gap float

gap between for coupler.

0.3
radius float

for the bend and coupler.

5.0
doping_angle float

angle in degrees representing portion of ring that is doped.

250
cross_section CrossSectionSpec

cross_section spec for non-PN doped rib waveguide sections.

rib
pn_cross_section CrossSectionSpec

cross section of pn junction.

cross_section_pn
doped_heater bool

boolean for if we include doped heater or not.

True
doped_heater_angle_buffer float

angle in degrees buffering heater from pn junction.

10
doped_heater_layer LayerSpec

doping layer for heater.

'NPP'
doped_heater_width float

width of doped heater.

0.5
doped_heater_waveguide_offset float

distance from the center of the ring waveguide to the center of the doped heater.

1.175
heater_vias ComponentSpec

components specifications for heater vias.

_heater_vias
pn_vias ComponentSpec

components specifications for pn vias.

'via_stack_slab_m3'
pn_vias_width float

width of pn vias.

3

rotate180

Rotate a component by an angle in degrees.

Parameters:

Name Type Description Default
component Component

to rotate.

required
angle float

in increments of 90°.

180

Returns: Rotated component.

rotate270

Rotate a component by an angle in degrees.

Parameters:

Name Type Description Default
component Component

to rotate.

required
angle float

in increments of 90°.

270

Returns: Rotated component.

rotate90

Rotate a component by an angle in degrees.

Parameters:

Name Type Description Default
component Component

to rotate.

required
angle float

in increments of 90°.

90

Returns: Rotated component.

rounded_rectangle

Returns a rectangle with rounded corners, centered at origin.

Parameters:

Name Type Description Default
width float

total width of the rectangle.

20.0
height float

total height of the rectangle.

10.0
corner_radius_x float

x-radius of the corner arcs.

3.0
corner_radius_y float | None

y-radius of the corner arcs. Defaults to corner_radius_x.

None
n_corner_points int

number of points per corner arc.

20
layer LayerSpec

layer spec.

'WG'
port_type str | None

None, optical, or electrical.

None

ruler

Ruler structure for lithographic measurement.

Includes marks of varying scales to allow for easy reading by eye.

Parameters:

Name Type Description Default
height_long float

Height of the long ruling marks in um.

55
height_short float

Height of the short ruling marks in um.

5
height_numbered float

Height of the numbered ruling marks in um.

10
width float

Width of the ruling marks in um.

2
spacing float

Center-to-center spacing of the ruling marks in um.

5.0
marks tuple[float | None, ...]

Height scale pattern of marks.

(-100, None, -90, None, -80, None, -70, None, -60, None, -50, None, -40, None, -30, None, -20, None, -10, None, 0)
layer LayerSpec

Specific layer to put the ruler geometry on.

'WG'
bbox_layers tuple[LayerSpec, ...] | None

Layers to include in the bounding box.

None
bbox_offset float

Offsets for each bounding box layer.

3.0
long_marks tuple[float, ...]

Marks that are long.

(-50, 0)
text_size float

Size of the text in um.

3.5

seal_ring

Returns a continuous seal ring boundary at the chip/die.

Prevents cracks from spreading and shields when connected to ground.

Parameters:

Name Type Description Default
size Float2

of the seal.

(500, 500)
seal ComponentSpec

function for the seal.

'via_stack'
width float

of the seal.

10
padding float

from component to seal.

10.0
with_north bool

includes seal.

True
with_south bool

includes seal.

True
with_east bool

includes seal.

True
with_west bool

includes seal.

True

seal_ring_segmented

Segmented Seal ring.

Parameters:

Name Type Description Default
size Float2

of the seal ring.

(500, 500)
length_segment float

length of each segment.

10
width_segment float

width of each segment.

3
spacing_segment float

spacing between segments.

2
corner ComponentSpec

corner component.

'via_stack_corner45_extended'
via_stack ComponentSpec

via_stack component.

'via_stack_m1_mtop'
with_north bool

includes seal.

True
with_south bool

includes seal.

True
with_east bool

includes seal.

True
with_west bool

includes seal.

True

snspd

Creates an optimally-rounded SNSPD.

Parameters:

Name Type Description Default
wire_width float

Width of the wire.

0.2
wire_pitch float

Distance between two adjacent wires. Must be greater than width.

0.6
size Size

Float2 (width, height) of the rectangle formed by the outer boundary of the SNSPD.

(10, 8)
num_squares int | None

int | None = None Total number of squares inside the SNSPD length.

None
turn_ratio float

float Specifies how much of the SNSPD width is dedicated to the 180 degree turn. A turn_ratio of 10 will result in 20% of the width being comprised of the turn.

4
terminals_same_side bool

If True, both ports will be located on the same side of the SNSPD.

False
layer LayerSpec

layer spec to put polygon geometry on.

(1, 0)
port_type str

type of port to add to the component.

'electrical'

spiral

Returns a spiral double (spiral in, and then out).

Parameters:

Name Type Description Default
length float

length of the spiral straight section.

100
bend ComponentSpec

bend component.

'bend_euler'
straight ComponentSpec

straight component.

'straight'
cross_section CrossSectionSpec

cross_section component.

'strip'
spacing float

spacing between the spiral loops.

3.0
n_loops int

number of loops.

6

spiral_archimedes

Returns an Archimedes spiral: r = (separation + width) / (2 * pi) * theta.

Parameters:

Name Type Description Default
width float

width of the spiral trace.

1.0
n_turns int

number of turns.

5
separation float

gap between adjacent traces.

2.0
angle_resolution float

degrees per point.

2.0
layer LayerSpec

layer spec.

'WG'

spiral_double

Returns a spiral double (spiral in, and then out).

Parameters:

Name Type Description Default
min_bend_radius float

inner radius of the spiral.

10.0
separation float

separation between the loops.

2.0
number_of_loops float

number of loops per spiral.

3
npoints int

points for the spiral.

1000
cross_section CrossSectionSpec

cross-section to extrude the structure with.

'strip'
bend ComponentSpec

factory for the bends in the middle of the double spiral.

'bend_circular'

spiral_fermat

Returns a Fermat spiral: r = a * sqrt(theta).

Parameters:

Name Type Description Default
width float

width of the spiral trace.

1.0
n_turns int

number of turns.

5
a float

scaling factor.

5.0
angle_resolution float

degrees per point.

2.0
layer LayerSpec

layer spec.

'WG'

spiral_inductor

Generates a spiral inductor for superconducting resonator applications, particularly in qubit readout circuits.

This component creates a spiral inductor pattern commonly used in superconducting quantum circuits. The inductor is designed with a square spiral geometry, featuring inner and outer connection tails.

See J. M. Hornibrook, J. I. Colless, A. C. Mahoney, X. G. Croot, S. Blanvillain, H. Lu, A. C. Gossard, D. J. Reilly; Frequency multiplexing for readout of spin qubits. Appl. Phys. Lett. 10 March 2014; 104 (10): 103108. https://doi.org/10.1063/1.4868107

Parameters:

Name Type Description Default
width float

Width of the inductor track in microns. Determines the cross-sectional area of the inductor.

3.0
pitch float

Distance between adjacent inductor tracks in microns. Affects the coupling between turns.

3.0
turns int

Number of complete spiral turns. Higher values increase inductance but require more space.

16
outer_diameter float

Overall size of the inductor in microns. Defines the maximum extent of the spiral.

800
tail float

Length of the inner and outer connection tails in microns. Used for connecting to other circuit elements.

50.0
layer LayerSpec

Metal layer for the inductor geometry and ports.

'M1'

Returns:

Name Type Description
Component Component

A GDSFactory component containing the spiral inductor pattern.

spiral_logarithmic

Returns a logarithmic spiral: r = a * exp(b * theta).

Parameters:

Name Type Description Default
width float

width of the spiral trace.

0.5
n_turns int

number of turns.

4
a float

initial radius scaling factor.

1.0
b float

growth rate.

0.1
angle_resolution float

degrees per point.

2.0
layer LayerSpec

layer spec.

'WG'

spiral_racetrack

Returns Racetrack-Spiral.

Parameters:

Name Type Description Default
min_radius float | None

smallest radius in um.

None
straight_length float

length of the straight segments in um.

20.0
spacings Floats

space between the center of neighboring waveguides in um.

(2, 2, 3, 3, 2, 2)
straight ComponentSpec

factory to generate the straight segments.

straight
bend ComponentSpec

factory to generate the bend segments.

bend_euler
bend_s ComponentSpec

factory to generate the s-bend segments.

'bend_s'
cross_section CrossSectionSpec

cross-section of the waveguides.

'strip'
cross_section_s CrossSectionSpec | None

cross-section of the s bend waveguide (optional).

None
extra_90_deg_bend bool

if True, we add an additional straight + 90 degree bent at the output, so the output port is looking down.

False
allow_min_radius_violation bool

if True, will allow the s-bend to have a smaller radius than the minimum radius.

False

spiral_racetrack_fixed_length

Returns Racetrack-Spiral with a specified total length.

The input and output ports are aligned in y. This class is meant to be used for generating interferometers with long waveguide lengths, where the most important parameter is the length difference between the arms.

Parameters:

Name Type Description Default
length float

total length of the spiral from input to output ports in um.

1000
in_out_port_spacing float

spacing between input and output ports of the spiral in um.

150
n_straight_sections int

total number of straight sections for the racetrack spiral. Has to be even.

8
min_radius float | None

smallest radius in um.

None
min_spacing float

minimum center-center spacing between adjacent waveguides.

5.0
straight ComponentSpec

factory to generate the straight segments.

straight
bend ComponentSpec

factory to generate the bend segments.

'bend_circular'
bend_s ComponentSpec

factory to generate the s-bend segments.

'bend_s'
cross_section CrossSectionSpec

cross-section of the waveguides.

'strip'
cross_section_s CrossSectionSpec | None

cross-section of the s bend waveguide (optional).

None

spiral_racetrack_heater_doped

Returns spiral racetrack with a heater between the loops.

based on https://doi.org/10.1364/OL.400230 but with the heater between the loops.

Parameters:

Name Type Description Default
min_radius float | None

smallest radius in um. Defaults to the radius of the cross-section.

None
straight_length float

length of the straight segments in um.

30
spacing float

space between the center of neighboring waveguides in um.

2
num int

number.

8
straight ComponentSpec

factory to generate the straight segments.

straight
bend ComponentSpec

factory to generate the bend segments.

bend_euler
bend_s ComponentSpec

factory to generate the s-bend segments.

'bend_s'
waveguide_cross_section CrossSectionSpec

cross-section of the waveguides.

'strip'
heater_cross_section CrossSectionSpec

cross-section of the heater.

'npp'

spiral_racetrack_heater_metal

Returns spiral racetrack with a heater above.

based on https://doi.org/10.1364/OL.400230 .

Parameters:

Name Type Description Default
min_radius float | None

smallest radius. Defaults to the radius of the cross-section.

None
straight_length float

length of the straight segments.

30
spacing float

space between the center of neighboring waveguides.

2
num int

number of loops.

8
straight ComponentSpec

factory to generate the straight segments.

straight
bend ComponentSpec

factory to generate the bend segments.

bend_euler
bend_s ComponentSpec

factory to generate the s-bend segments.

'bend_s'
waveguide_cross_section CrossSectionSpec

cross-section of the waveguides.

'strip'
heater_cross_section CrossSectionSpec

cross-section of the heater.

'heater_metal'
via_stack ComponentSpec | None

via stack to connect the heater to the metal layer.

'via_stack_heater_mtop'

spiral_rectangular

Returns a rectangular/Manhattan spiral as a polygon.

Each segment grows by pitch per half-turn, building an expanding rectangular spiral. The outline is created with the given width offset.

Parameters:

Name Type Description Default
n_turns int

number of full turns.

4
width float

width of the spiral trace.

1.0
start_length float

initial segment length.

10.0
pitch float

spacing between adjacent turns (center-to-center).

3.0
layer LayerSpec

layer spec.

'WG'

splitter_chain

Chain of splitters.

Parameters:

Name Type Description Default
splitter ComponentSpec

splitter to chain.

'mmi1x2'
columns int

number of splitters to chain.

3
bend ComponentSpec

bend to connect splitters.

'bend_s'
             __o5
          __|
       __|  |__o4
  o1 _|  |__o3
      |__o2
       __o2
  o1 _|
      |__o3

splitter_tree

Tree of power splitters.

Parameters:

Name Type Description Default
coupler ComponentSpec

coupler factory.

'mmi1x2'
noutputs int

number of outputs.

4
spacing Spacing

x, y spacing between couplers.

(90.0, 50.0)
bend_s ComponentSpec | None

Sbend function for termination.

'bend_s'
bend_s_xsize float | None

xsize for the sbend.

None
cross_section CrossSectionSpec

cross_section.

| __| |

'strip'

stacked_transformer

Stacked transformer.

The primary winding sits on layer_winding_primary with its crossings on layer_crossing_primary (connected by via_primary); the secondary winding sits on layer_winding_secondary with its crossings on layer_crossing_secondary (connected by via_secondary), mirrored to sit on the opposite side of d_out so the two windings stack vertically over the same footprint.

LAYER STACK: this gdsfactory generic PDK only has 3 real metals (M1/M2/M3). A fully isolated stacked transformer needs 4 independent metals (primary winding, primary crossing, secondary winding, secondary crossing), so the defaults here use an EXTRA, non-native 4th metal registered via gf.kcl.layer() at import time (M4_LAYER, layer (53, 0)) with its own via (via3(), VIA3_LAYER, layer (48, 0)) connecting it to M3. This gives full primary/secondary isolation by default: layer_winding_primary=M4_LAYER, layer_crossing_primary="M3", via_primary=via3 layer_winding_secondary="M2", layer_crossing_secondary="M1", via_secondary="via1"

M4_LAYER/VIA3_LAYER are valid GDS layers but are NOT part of this PDK's real, fabricatable metal stack. If you need this component to be simulation-ready (Palace/gsim meshing) ortape-out-accurate, call get_extended_layer_stack() instead of the PDK's default stack, e.g. sim.set_stack(stack=get_extended_layer_stack()).

If your ACTUAL target PDK has a genuine 4th metal, pass its real layer name/via in place of M4_LAYER/via3 instead of relying on this synthetic one.

layers_pgs defaults to an empty tuple: even with M4 in play, all of M1/M2/M3/M4 are live signal layers in the default configuration, so there's still no obviously-safe spare metal for a patterned ground shield — pass an explicit LayerSpecs of your own (accepting whatever coupling that implies) if you need one anyway.

Parameters:

Name Type Description Default
d_out float

Outer diameter of each winding, in micrometers.

150.0
N1 int

Number of turns in the primary winding.

3
N2 int

Number of turns in the secondary winding.

3
sides int

Number of polygon sides per full turn (8 = octagonal).

8
width float

Metal trace width in micrometers.

10.0
spacing float

Gap between adjacent turns in micrometers.

2.0
center_tap_primary bool

When True, add a center-tap bridge and CT_P port to the primary winding.

False
center_tap_secondary bool

When True, add a center-tap bridge and CT_S port to the secondary winding.

False
via_extent float | None

Length crossing routes extend past their crossing box, and the box size used to size the crossing/centertap via arrays, for both halves. If None, it's derived independently for each half from that half's own via geometry (same derivation spiral_inductor/symmetric_inductor use).

None
port_spacing float | None

Horizontal spacing of both differential port pairs. Defaults to spacing.

None
via_primary ComponentSpec

via ComponentSpec connecting layer_winding_primary <-> layer_crossing_primary.

via3
via_secondary ComponentSpec

via ComponentSpec connecting layer_winding_secondary <-> layer_crossing_secondary.

'via1'
resistance float

Series resistance in ohms, stored as metadata only.

0.5777
inductance float

Inductance in henries, stored as metadata only.

3.3303e-11
add_pgs bool

When True, add a patterned ground shield on layers_pgs. See the layer-stack caveat above before enabling this.

False
pgs_diameter float

Bounding size D of the ground shield square, in micrometers.

180.0
pgs_width float

Strip width w of each ground shield finger, in micrometers.

4.0
pgs_spacing float

Gap s between adjacent ground shield fingers, in micrometers.

2.0
layer_winding_primary LayerSpec | None

Metal layer for the primary winding.

None
layer_crossing_primary LayerSpec

Metal layer for the primary crossings.

'M3'
layer_winding_secondary LayerSpec

Metal layer for the secondary winding.

'M2'
layer_crossing_secondary LayerSpec

Metal layer for the secondary crossings.

'M1'
layers_pgs LayerSpecs

Layers on which the patterned ground shield is drawn.

()

Returns:

Type Description
Component

Component with 4-6 ports: P+ / P- -> primary differential terminals (layer_winding_primary) S+ / S- -> secondary differential terminals (layer_winding_secondary) CT_P -> present if center_tap_primary=True CT_S -> present if center_tap_secondary=True

staircase

Returns staircase.

Parameters:

Name Type Description Default
component ComponentSpec | Component

bend spec.

'bend_euler'
straight ComponentSpec

straight spec.

'straight'
length_v float

vertical length.

5.0
length_h float

vertical length.

5.0
rows int

number of rows.

4
cols

number of cols.

required
kwargs Any

cross_section settings.

{}

star

Returns a star shape with alternating inner and outer radii.

Parameters:

Name Type Description Default
inner_radius float

radius of inner vertices.

5.0
outer_radius float

radius of outer vertices.

10.0
n_points int

number of star points.

5
layer LayerSpec

layer spec.

'WG'

straight

Returns a Straight waveguide.

Parameters:

Name Type Description Default
length float

straight length (um).

10.0
npoints int

number of points.

2
cross_section CrossSectionSpec

specification (CrossSection, string or dict).

'strip'
width float | None

width of the waveguide. If None, it will use the width of the cross_section.

None
    o1  ──────────────── o2
            length

straight_all_angle

Returns a Straight waveguide with offgrid ports.

Parameters:

Name Type Description Default
length float

straight length (um).

10.0
npoints int

number of points.

2
cross_section CrossSectionSpec

specification (CrossSection, string or dict).

'strip'
width float | None

width of the waveguide. If None, it will use the width of the cross_section.

None
    o1  ──────────────── o2
            length

straight_array

Array of straights connected with grating couplers.

useful to align the 4 corners of the chip

Parameters:

Name Type Description Default
n int

number of straights.

4
spacing float

edge to edge straight spacing.

4.0
length float

straight length (um).

10.0
cross_section CrossSectionSpec

specification (CrossSection, string or dict).

'strip'

straight_heater_doped_rib

Returns a doped thermal phase shifter.

dimensions from https://doi.org/10.1364/OE.27.010456

Parameters:

Name Type Description Default
length float

of the waveguide in um.

320.0
nsections int

between via_stacks.

3
cross_section CrossSectionSpec

for the input/output ports.

'strip_rib_tip'
cross_section_heater CrossSectionSpec

for the heater.

'rib_heater_doped'
via_stack ComponentSpec | None

optional function to connect the heater strip.

'via_stack_slab_npp_m3'
via_stack_metal ComponentSpec | None

function to connect the metal area.

'via_stack_m1_mtop'
via_stack_metal_size Size

x, y size in um.

(10.0, 10.0)
via_stack_size Size

x, y size in um.

(10.0, 10.0)
taper ComponentSpec | None

optional taper spec.

'taper_cross_section'
heater_width float

in um.

2.0
heater_gap float

in um.

0.8
via_stack_gap float

from edge of via_stack to waveguide.

0.0
width float

waveguide width on the ridge.

0.5
xoffset_tip1 float

distance in um from input taper to via_stack.

0.2
xoffset_tip2 float

distance in um from output taper to via_stack.

0.4
                          length
    |<--------------------------------------------->|
    |              length_section                   |
    |    <--------------------------->              |
    |  length_via_stack                             |
    |    <------->                             taper|
    |    __________                   _________     |
    |   |          |                  |        |    |
    |   | via_stack|__________________|        |    |
    |   |  size    |  heater width    |        |    |
    |  /|__________|__________________|________|\   |
    | / |             heater_gap               | \  |
    |/  |______________________________________|  \ |
     \  |_______________width__________________|  /
      \ |                                      | /
       \|_____________heater_gap______________ |/
        |        |                    |        |
        |        |____heater_width____|        |
        |        |                    |        |
        |________|                    |________|
taper         cross_section_heater
                               |<------width------>|
                                ____________________ heater_gap             slab_gap
         top_via_stack         |                   |<---------->| bot_via_stack   <-->
     ___ ______________________|                   |___________________________|___
    |   |            |               undoped Si                 |              |   |
    |   |layer_heater|               intrinsic region           |layer_heater  |   |
    |___|____________|__________________________________________|______________|___|
                                                                 <------------>
                                                                  heater_width
    <------------------------------------------------------------------------------>
                                   slab_width

straight_heater_doped_strip

Top view.

Parameters:

Name Type Description Default
length float

of the waveguide in um.

320.0
nsections int

between via_stacks.

3
cross_section CrossSectionSpec

for the input/output ports.

'strip_heater_doped'
cross_section_heater CrossSectionSpec

for the heater.

'rib_heater_doped'
via_stack ComponentSpec | None

optional function to connect the heater strip.

'via_stack_npp_m1'
via_stack_metal ComponentSpec | None

function to connect the metal area.

'via_stack_m1_mtop'
via_stack_metal_size Size

x, y size in um.

(10.0, 10.0)
via_stack_size Size

x, y size in um.

(10.0, 10.0)
taper ComponentSpec | None

optional taper spec.

'taper_cross_section'
heater_width float

in um.

2.0
heater_gap float

in um.

0.8
via_stack_gap float

from edge of via_stack to waveguide.

0.0
width float

waveguide width on the ridge.

0.5
xoffset_tip1 float

distance in um from input taper to via_stack.

0.2
xoffset_tip2 float

distance in um from output taper to via_stack.

0.4
                          length
      <-|--------|--------------------------------->
        |        | length_section
        |<--------------------------->
       length_via_stack
        |<------>|
        |________|_______________________________
       /|        |____________________|          |
      / |viastack|                    |via_stack |
      \ | size   |____________________|          |
       \|________|____________________|__________|
                                      |          |
                  cross_section_heater|          |
                                      |          |
                                      |          |
                                      |__________|

cross_section

                              |<------width------>|
      ____________             ___________________               ______________
     |            |           |     undoped Si    |             |              |
     |layer_heater|           |  intrinsic region |<----------->| layer_heater |
     |____________|           |___________________|             |______________|
                                                                 <------------>
                                                    heater_gap     heater_width

straight_heater_meander

Returns a meander based heater.

based on SungWon Chung, Makoto Nakai, and Hossein Hashemi, Low-power thermo-optic silicon modulator for large-scale photonic integrated systems Opt. Express 27, 13430-13459 (2019) https://www.osapublishing.org/oe/abstract.cfm?URI=oe-27-9-13430

Parameters:

Name Type Description Default
length float

total length of the optical path.

300.0
spacing float

waveguide spacing (center to center).

2.0
cross_section CrossSectionSpec

for waveguide.

'strip'
heater_width float

for heater.

2.5
extension_length float

of input and output optical ports.

15.0
layer_heater LayerSpec

for top heater, if None, it does not add a heater.

'HEATER'
radius float | None

for the meander bends. Defaults to cross_section radius.

None
via_stack ComponentSpec | None

for the heater to via_stack metal.

'via_stack_heater_mtop'
port_orientation1 float | None

in degrees. None adds all orientations.

None
port_orientation2 float | None

in degrees. None adds all orientations.

None
heater_taper_length float

minimizes current concentrations from heater to via_stack.

10.0
straight_widths Floats | None

widths of the straight sections.

None
taper_length float

from the cross_section.

10.0
n int | None

number of straight sections.

3

straight_heater_meander_doped

Returns a meander based heater.

based on SungWon Chung, Makoto Nakai, and Hossein Hashemi, Low-power thermo-optic silicon modulator for large-scale photonic integrated systems Opt. Express 27, 13430-13459 (2019) https://www.osapublishing.org/oe/abstract.cfm?URI=oe-27-9-13430

Parameters:

Name Type Description Default
length float

total length of the optical path.

300.0
spacing float

waveguide spacing (center to center).

2.0
cross_section CrossSectionSpec

for waveguide.

'strip'
heater_width float

for heater.

1.5
extension_length float

of input and output optical ports.

15.0
layers_doping LayerSpecs

doping layers to be used for heater.

('P', 'PP', 'PPP')
radius float

for the meander bends.

5.0
via_stack ComponentSpec | None

for the heater to via_stack metal.

_via_stack
port_orientation1 float | None

in degrees. None adds all orientations.

None
port_orientation2 float | None

in degrees. None adds all orientations.

None
straight_widths Floats

width of the straight sections.

(0.8, 0.9, 0.8)
taper_length float

from the cross_section.

10

straight_heater_metal

Returns a thermal phase shifter.

dimensions from https://doi.org/10.1364/OE.27.010456

Parameters:

Name Type Description Default
length float

of the waveguide.

320.0
length_undercut_spacing float

from undercut regions.

0
length_undercut float

length of each undercut section.

5
length_straight float

length of the straight waveguide.

0.1
length_straight_input float

from input port to where trenches start.

0.1
cross_section CrossSectionSpec

for waveguide ports.

'strip'
cross_section_heater CrossSectionSpec

for heated sections. heater metal only.

'heater_metal'
cross_section_waveguide_heater CrossSectionSpec

for heated sections.

'strip_heater_metal'
cross_section_heater_undercut CrossSectionSpec

for heated sections with undercut.

'strip_heater_metal_undercut'
with_undercut bool

isolation trenches for higher efficiency.

False
via_stack ComponentSpec | None

via stack.

'via_stack_heater_mtop'
port_orientation1 int | None

left via stack port orientation. None adds all orientations.

None
port_orientation2 int | None

right via stack port orientation. None adds all orientations.

None
heater_taper_length float

minimizes current concentrations from heater to via_stack.

5.0
ohms_per_square float | None

to calculate resistance.

None

straight_heater_metal_90_90

Returns a thermal phase shifter.

dimensions from https://doi.org/10.1364/OE.27.010456

Parameters:

Name Type Description Default
length float

of the waveguide.

320.0
length_undercut_spacing float

from undercut regions.

0
length_undercut float

length of each undercut section.

5
length_straight float

length of the straight waveguide.

0.1
length_straight_input float

from input port to where trenches start.

0.1
cross_section CrossSectionSpec

for waveguide ports.

'strip'
cross_section_heater CrossSectionSpec

for heated sections. heater metal only.

'heater_metal'
cross_section_waveguide_heater CrossSectionSpec

for heated sections.

'strip_heater_metal'
cross_section_heater_undercut CrossSectionSpec

for heated sections with undercut.

'strip_heater_metal_undercut'
with_undercut bool

isolation trenches for higher efficiency.

False
via_stack ComponentSpec | None

via stack.

'via_stack_heater_mtop'
port_orientation1 int | None

left via stack port orientation. None adds all orientations.

90
port_orientation2 int | None

right via stack port orientation. None adds all orientations.

90
heater_taper_length float

minimizes current concentrations from heater to via_stack.

5.0
ohms_per_square float | None

to calculate resistance.

None

straight_heater_metal_simple

Returns a thermal phase shifter that has properly fixed electrical connectivity to extract a suitable electrical netlist and models.

dimensions from https://doi.org/10.1364/OE.27.010456.

Parameters:

Name Type Description Default
length float

of the waveguide.

320.0
cross_section_heater CrossSectionSpec

for heated sections. heater metal only.

'heater_metal'
cross_section_waveguide_heater CrossSectionSpec

for heated sections.

'strip_heater_metal'
via_stack ComponentSpec | None

via stack.

'via_stack_heater_mtop'
port_orientation1 int | None

left via stack port orientation. None adds all orientations.

None
port_orientation2 int | None

right via stack port orientation. None adds all orientations.

None
heater_taper_length float

minimizes current concentrations from heater to via_stack.

5.0
ohms_per_square float | None

to calculate resistance.

None

straight_heater_metal_undercut

Returns a thermal phase shifter.

dimensions from https://doi.org/10.1364/OE.27.010456

Parameters:

Name Type Description Default
length float

of the waveguide.

320.0
length_undercut_spacing float

from undercut regions.

6.0
length_undercut float

length of each undercut section.

30.0
length_straight float

length of the straight waveguide.

0.1
length_straight_input float

from input port to where trenches start.

15.0
cross_section CrossSectionSpec

for waveguide ports.

'strip'
cross_section_heater CrossSectionSpec

for heated sections. heater metal only.

'heater_metal'
cross_section_waveguide_heater CrossSectionSpec

for heated sections.

'strip_heater_metal'
cross_section_heater_undercut CrossSectionSpec

for heated sections with undercut.

'strip_heater_metal_undercut'
with_undercut bool

isolation trenches for higher efficiency.

True
via_stack ComponentSpec | None

via stack.

'via_stack_heater_mtop'
port_orientation1 int | None

left via stack port orientation. None adds all orientations.

None
port_orientation2 int | None

right via stack port orientation. None adds all orientations.

None
heater_taper_length float

minimizes current concentrations from heater to via_stack.

5.0
ohms_per_square float | None

to calculate resistance.

None

straight_heater_metal_undercut_90_90

Returns a thermal phase shifter.

dimensions from https://doi.org/10.1364/OE.27.010456

Parameters:

Name Type Description Default
length float

of the waveguide.

320.0
length_undercut_spacing float

from undercut regions.

6.0
length_undercut float

length of each undercut section.

30.0
length_straight float

length of the straight waveguide.

0.1
length_straight_input float

from input port to where trenches start.

15.0
cross_section CrossSectionSpec

for waveguide ports.

'strip'
cross_section_heater CrossSectionSpec

for heated sections. heater metal only.

'heater_metal'
cross_section_waveguide_heater CrossSectionSpec

for heated sections.

'strip_heater_metal'
cross_section_heater_undercut CrossSectionSpec

for heated sections with undercut.

'strip_heater_metal_undercut'
with_undercut bool

isolation trenches for higher efficiency.

True
via_stack ComponentSpec | None

via stack.

'via_stack_heater_mtop'
port_orientation1 int | None

left via stack port orientation. None adds all orientations.

90
port_orientation2 int | None

right via stack port orientation. None adds all orientations.

90
heater_taper_length float

minimizes current concentrations from heater to via_stack.

5.0
ohms_per_square float | None

to calculate resistance.

None

straight_piecewise

Create a component with a piecewise-defined straight waveguide.

Parameters:

Name Type Description Default
x Sequence[float] | Path

X coordinates or a custom Path object.

required
widths Sequence[float]

Waveguide widths at each corresponding x.

required
layer LayerSpec

Layer to extrude.

required
sections Sequence[Section] | None

Additional cross-section sections to extrude.

None
port_names tuple[str | None, str | None]

Port names for the waveguide.

('o1', 'o2')
name str

Name for the core (main) Section.

'core'
**kwargs Any

Additional keyword arguments for the Section.

{}

straight_pin

Returns rib waveguide with doping and via_stacks used for PN and PIN modulators.

For PIN: https://doi.org/10.1364/OE.26.029983

500um length for PI phase shift https://ieeexplore.ieee.org/document/8268112

to go beyond 2PI, you will need at least 1mm https://ieeexplore.ieee.org/document/8853396/

For PN: Typical lengths in practice are 2-5mm depending on doping,engineering and application: https://opg.optica.org/oe/fulltext.cfm?uri=oe-21-25-30350&id=275107 https://opg.optica.org/oe/fulltext.cfm?uri=oe-20-11-12014&id=233271

Parameters:

Name Type Description Default
length float

of the waveguide.

500.0
cross_section CrossSectionSpec

for the waveguide.

pin
via_stack ComponentSpec

for the via_stacks.

'via_stack_slab_m3'
via_stack_width float

width of the via_stack.

10.0
via_stack_spacing float

spacing between via_stacks.

2
taper ComponentSpec | None

optional taper.

'taper_strip_to_ridge'

straight_pin_slot

Returns a PIN straight waveguide with slotted via.

https://doi.org/10.1364/OE.26.029983

500um length for PI phase shift https://ieeexplore.ieee.org/document/8268112

to go beyond 2PI, you will need at least 1mm https://ieeexplore.ieee.org/document/8853396/

Parameters:

Name Type Description Default
length float

of the waveguide.

500.0
cross_section CrossSectionSpec

for the waveguide.

'pin'
via_stack ComponentSpec | None

for via_stacking the metal.

'via_stack_m1_mtop'
via_stack_width float

in um.

10.0
via_stack_slab ComponentSpec | None

function for the component via_stacking the slab.

'via_stack_slab_m1_horizontal'
via_stack_slab_top ComponentSpec | None

Optional, defaults to via_stack_slab.

None
via_stack_slab_bot ComponentSpec | None

Optional, defaults to via_stack_slab.

None
via_stack_slab_width float | None

defaults to via_stack_width.

None
via_stack_spacing float

spacing between via_stacks.

3.0
via_stack_slab_spacing float

spacing between via_stacks slabs.

2.0
taper ComponentSpec | None

optional taper.

'taper_strip_to_ridge'
width float | None

width of the waveguide. If None, it will use the width of the cross_section.

None

straight_pn

Returns rib waveguide with doping and via_stacks used for PN and PIN modulators.

For PIN: https://doi.org/10.1364/OE.26.029983

500um length for PI phase shift https://ieeexplore.ieee.org/document/8268112

to go beyond 2PI, you will need at least 1mm https://ieeexplore.ieee.org/document/8853396/

For PN: Typical lengths in practice are 2-5mm depending on doping,engineering and application: https://opg.optica.org/oe/fulltext.cfm?uri=oe-21-25-30350&id=275107 https://opg.optica.org/oe/fulltext.cfm?uri=oe-20-11-12014&id=233271

Parameters:

Name Type Description Default
length float

of the waveguide.

2000
cross_section CrossSectionSpec

for the waveguide.

'pn'
via_stack ComponentSpec

for the via_stacks.

'via_stack_slab_m3'
via_stack_width float

width of the via_stack.

10.0
via_stack_spacing float

spacing between via_stacks.

2
taper ComponentSpec | None

optional taper.

'taper_strip_to_ridge'

straight_pn_slot

Returns a PIN straight waveguide with slotted via.

https://doi.org/10.1364/OE.26.029983

500um length for PI phase shift https://ieeexplore.ieee.org/document/8268112

to go beyond 2PI, you will need at least 1mm https://ieeexplore.ieee.org/document/8853396/

Parameters:

Name Type Description Default
length float

of the waveguide.

500.0
cross_section CrossSectionSpec

for the waveguide.

'pn'
via_stack ComponentSpec | None

for via_stacking the metal.

'via_stack_m1_mtop'
via_stack_width float

in um.

10.0
via_stack_slab ComponentSpec | None

function for the component via_stacking the slab.

'via_stack_slab_m1_horizontal'
via_stack_slab_top ComponentSpec | None

Optional, defaults to via_stack_slab.

None
via_stack_slab_bot ComponentSpec | None

Optional, defaults to via_stack_slab.

None
via_stack_slab_width float | None

defaults to via_stack_width.

None
via_stack_spacing float

spacing between via_stacks.

3.0
via_stack_slab_spacing float

spacing between via_stacks slabs.

2.0
taper ComponentSpec | None

optional taper.

'taper_strip_to_ridge'
width float | None

width of the waveguide. If None, it will use the width of the cross_section.

None

switch_tree

Tree of power splitters.

Parameters:

Name Type Description Default
coupler ComponentSpec

coupler factory.

'mmi1x2'
noutputs int

number of outputs.

4
spacing Spacing

x, y spacing between couplers.

(500, 100)
bend_s ComponentSpec | None

Sbend function for termination.

'bend_s'
bend_s_xsize float | None

xsize for the sbend.

None
cross_section CrossSectionSpec

cross_section.

| __| |

'strip'

symmetric_transformer

Symmetric (interleaved) transformer.

Two interleaved windings (primary: N1 turns, secondary: N2 turns) share the same octagonal spiral, alternating turn-by-turn. Crossings are routed on layer_underpass wherever a turn boundary needs to jump between quadrants; bridges wire together the top/bottom/left/right quadrant segments directly on layer_winding.

Parameters:

Name Type Description Default
d_out float

Outer diameter of the winding structure, in micrometers.

150.0
N1 int

Number of turns in the primary winding.

2
N2 int

Number of turns in the secondary winding.

3
sides int

Number of polygon sides per full turn (8 = octagonal). Must be a multiple of 4 (quadrant angle lists use sides // 4).

8
width float

Metal trace width in micrometers.

7.0
spacing float

Gap between adjacent turns in micrometers.

2.0
center_tap_primary bool

When True, add a center-tap bridge (and CT1 or CT2 port, depending on parity) for the primary winding.

False
center_tap_secondary bool

When True, add a center-tap bridge (and CT1 or CT2 port, depending on parity) for the secondary winding.

False
via_extent float | None

Length crossing/bridge routes extend past their crossing box on layer_underpass, and the box size used to size the crossing/centertap via arrays. If None, it's derived from the chosen via's own geometry the same way spiral_inductor and symmetric_inductor derive their "extend" value.

None
port_spacing float | None

Horizontal spacing of the differential port pairs.

None
via ComponentSpec

via ComponentSpec connecting winding <-> crossing/centertap.

'via2'
resistance float

Series resistance in ohms, stored as metadata only.

0.5777
inductance float

Inductance in henries, stored as metadata only.

3.3303e-11
add_pgs bool

When True, add a patterned ground shield on layers_pgs.

False
pgs_diameter float

Bounding size D of the ground shield square, in micrometers.

180.0
pgs_width float

Strip width w of each ground shield finger, in micrometers.

4.0
pgs_spacing float

Gap s between adjacent ground shield fingers, in micrometers.

2.0
layer_winding LayerSpec

Metal layer for the main winding (top metal).

'M3'
layer_underpass LayerSpec

Metal layer for crossings and center-tap bridges (one layer below layer_winding).

'M2'
layers_pgs LayerSpecs

Layers on which the patterned ground shield is drawn, kept separate from both layer_winding and layer_underpass

('M1',)

Returns:

Type Description
Component

Component with 4-6 ports: P1+ / P1- -> primary differential terminals (bottom, layer_winding) P2+ / P2- -> secondary differential terminals (top, layer_winding) CT1 -> present if a center tap lands on the bottom side CT2 -> present if a center tap lands on the top side

t_junction

Returns a microfluidic T-junction.

A horizontal main channel with a vertical branch going up from the center. Optionally adds circular reservoirs at the three endpoints.

Parameters:

Name Type Description Default
main_width float

width of the main horizontal channel.

1.0
branch_width float

width of the vertical branch channel.

1.0
main_length float

total length of the main channel.

20.0
branch_length float

length of the vertical branch.

10.0
reservoir_radius float

radius of circular reservoirs at endpoints (0 to disable).

0.0
n_reservoir_points int

number of polygon points for reservoir circles.

64
layer LayerSpec

layer spec.

'WG'
port_type str | None

None, optical, or electrical.

'optical'

taper

Linear taper, which tapers only the main cross section section.

Parameters:

Name Type Description Default
length float

taper length.

10.0
width1 float

width of the west/left port.

0.5
width2 float | None

width of the east/right port. Defaults to width1.

None
layer LayerSpec | None

layer for the taper.

None
port Port | None

can taper from a port instead of defining width1.

None
with_two_ports bool

includes a second port. False for terminator and edge coupler fiber interface.

True
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'
port_names tuple[str, str]

input and output port names. Second name only used if with_two_ports.

('o1', 'o2')
port_types tuple[str, str]

input and output port types. Second type only used if with_two_ports.

('optical', 'optical')
with_bbox bool

box in bbox_layers and bbox_offsets to avoid DRC sharp edges.

True

taper_0p5_to_3_l36

Returns taper from CSV file.

Parameters:

Name Type Description Default
filepath Path

for CSV file.

data / 'taper_strip_0p5_3_36.csv'
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'

taper_adiabatic

Returns a straight adiabatic_taper from an effective index callable.

Parameters:

Name Type Description Default
width1 float

initial width.

0.5
width2 float

final width.

5.0
length float

0 uses the optimized length, and otherwise the optimal shape is compressed/stretched to the specified length.

0
neff_w Callable[[float], float]

a callable that returns the effective index as a function of width - By default, will use a compact model of neff(y) for fundamental 1550 nm TE mode of 220nm-thick core with 3.45 index, fully clad with 1.44 index. Many coefficients are needed to capture the behaviour.

neff_TE1550SOI_220nm
alpha float

parameter that scales the rate of width change. - closer to 0 means longer and more adiabatic; - 1 is the intuitive limit beyond which higher order modes are excited; - [2] reports good performance up to 1.4 for fundamental TE in SOI (for multiple core thicknesses)

1
wavelength float

wavelength in um.

1.55
npoints int

number of points for sampling.

200
cross_section CrossSectionSpec

cross_section specification.

'strip'
max_length float

maximum length for the taper.

200
References

[1] Burns, W. K., et al. "Optical waveguide parabolic coupling horns." Appl. Phys. Lett., vol. 30, no. 1, 1 Jan. 1977, pp. 28-30, doi:10.1063/1.89199. [2] Fu, Yunfei, et al. "Efficient adiabatic silicon-on-insulator waveguide taper." Photonics Res., vol. 2, no. 3, 1 June 2014, pp. A41-A44, doi:10.1364/PRJ.2.000A41. npoints: number of points for sampling

taper_cross_section

Returns taper transition between cross_section1 and cross_section2.

Parameters:

Name Type Description Default
cross_section1 CrossSectionSpec

start cross_section factory.

'strip_rib_tip'
cross_section2 CrossSectionSpec

end cross_section factory.

'rib2'
length float

transition length.

10
npoints int

number of points.

100
linear bool

shape of the transition, sine when False.

False
width_type str

shape of the transition ONLY IF linear is False

'sine'
exclude_layers LayerSpecs | None

layers to exclude from the transition. Sections on these layers will be omitted from the component.

None
                       _____________________
                      /
              _______/______________________
                    /
   cross_section1  |        cross_section2
              ______\_______________________
                     \
                      \_____________________

taper_cross_section_linear

Returns taper transition between cross_section1 and cross_section2.

Parameters:

Name Type Description Default
cross_section1 CrossSectionSpec

start cross_section factory.

'strip_rib_tip'
cross_section2 CrossSectionSpec

end cross_section factory.

'rib2'
length float

transition length.

10
npoints int

number of points.

2
linear bool

shape of the transition, sine when False.

True
width_type str

shape of the transition ONLY IF linear is False

'sine'
exclude_layers LayerSpecs | None

layers to exclude from the transition. Sections on these layers will be omitted from the component.

None
                       _____________________
                      /
              _______/______________________
                    /
   cross_section1  |        cross_section2
              ______\_______________________
                     \
                      \_____________________

taper_cross_section_parabolic

Returns taper transition between cross_section1 and cross_section2.

Parameters:

Name Type Description Default
cross_section1 CrossSectionSpec

start cross_section factory.

'strip_rib_tip'
cross_section2 CrossSectionSpec

end cross_section factory.

'rib2'
length float

transition length.

10
npoints int

number of points.

101
linear bool

shape of the transition, sine when False.

False
width_type str

shape of the transition ONLY IF linear is False

'parabolic'
exclude_layers LayerSpecs | None

layers to exclude from the transition. Sections on these layers will be omitted from the component.

None
                       _____________________
                      /
              _______/______________________
                    /
   cross_section1  |        cross_section2
              ______\_______________________
                     \
                      \_____________________

taper_cross_section_sine

Returns taper transition between cross_section1 and cross_section2.

Parameters:

Name Type Description Default
cross_section1 CrossSectionSpec

start cross_section factory.

'strip_rib_tip'
cross_section2 CrossSectionSpec

end cross_section factory.

'rib2'
length float

transition length.

10
npoints int

number of points.

101
linear bool

shape of the transition, sine when False.

False
width_type str

shape of the transition ONLY IF linear is False

'sine'
exclude_layers LayerSpecs | None

layers to exclude from the transition. Sections on these layers will be omitted from the component.

None
                       _____________________
                      /
              _______/______________________
                    /
   cross_section1  |        cross_section2
              ______\_______________________
                     \
                      \_____________________

taper_electrical

Linear taper, which tapers only the main cross section section.

Parameters:

Name Type Description Default
length float

taper length.

10.0
width1 float

width of the west/left port.

0.5
width2 float | None

width of the east/right port. Defaults to width1.

None
layer LayerSpec | None

layer for the taper.

None
port Port | None

can taper from a port instead of defining width1.

None
with_two_ports bool

includes a second port. False for terminator and edge coupler fiber interface.

True
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'metal_routing'
port_names tuple[str, str]

input and output port names. Second name only used if with_two_ports.

('e1', 'e2')
port_types tuple[str, str]

input and output port types. Second type only used if with_two_ports.

('electrical', 'electrical')
with_bbox bool

box in bbox_layers and bbox_offsets to avoid DRC sharp edges.

True

taper_from_csv

Returns taper from CSV file.

Parameters:

Name Type Description Default
filepath Path

for CSV file.

data / 'taper_strip_0p5_3_36.csv'
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'

taper_hecken

Creates a Hecken-tapered microstrip.

Parameters:

Name Type Description Default
length float

Length of the microstrip.

200
B float

Controls the intensity of the taper.

4.0091
dielectric_thickness float

Thickness of the substrate.

0.25
eps_r float

Dielectric constant of the substrate.

2
Lk_per_sq float

Kinetic inductance per square of the microstrip.

2.5e-10
Z1 float | None

Impedance of the left side region of the microstrip.

50
Z2 float | None

Impedance of the right side region of the microstrip.

100
width1 float | None

Width of the left side of the microstrip.

None
width2 float | None

Width of the right side of the microstrip.

None
num_pts int

Number of points comprising the curve of the entire microstrip.

100
layer LayerSpec

Specific layer(s) to put polygon geometry on.

'WG'

Returns:

Type Description
Component

Component containing a Hecken-tapered microstrip.

taper_meander

Create a meander from arrays of x-positions and widths.

Typically used for creating meandered tapers.

Parameters:

Name Type Description Default
x_taper tuple[float, ...] | None

The x-coordinates of the data points, must be increasing.

None
w_taper tuple[float, ...] | None

The widths at each x-coordinate, same length as x_taper.

None
meander_length float

Length of each section of the meander.

1000
spacing_factor float

Multiplicative spacing factor between adjacent meanders.

3
min_spacing float

Minimum spacing between adjacent meanders.

0.5
layer LayerSpec

Specific layer(s) to put polygon geometry on.

'WG'

Returns:

Type Description
Component

Component containing the meandered taper.

taper_nc_sc

Taper from nitride to strip.

Parameters:

Name Type Description Default
width1 float

nitride width.

1
width2 float

silicon width.

0.5
length float

taper length.

20
layer_wg LayerSpec

nitride layer.

'WG'
layer_nitride LayerSpec

strip layer.

'WGN'
width_tip_nitride float

tip width for nitride.

0.15
width_tip_silicon float

tip width for strip.

0.15
cross_section CrossSectionSpec

cross_section specification.

'strip'

taper_parabolic

Returns a parabolic_taper.

Parameters:

Name Type Description Default
length float

in um.

20
width1 float

in um.

0.5
width2 float

in um.

5.0
exp float

exponent.

0.5
npoints int

number of points.

100
layer LayerSpec

layer spec.

'WG'

taper_sc_nc

Taper from strip to nitride.

Parameters:

Name Type Description Default
width1 float

strip width.

0.5
width2 float

nitride width.

1
length float

taper length.

20
layer_wg LayerSpec

strip layer.

'WG'
layer_nitride LayerSpec

nitride layer.

'WGN'
width_tip_nitride float

tip width for nitride.

0.15
width_tip_silicon float

tip width for strip.

0.15
cross_section CrossSectionSpec

cross_section specification.

'strip'

taper_strip_to_ridge

Linear taper from strip to rib.

Parameters:

Name Type Description Default
length float

taper length (um).

10.0
width1 float

in um.

0.5
width2 float

in um.

0.5
w_slab1 float

slab width in um.

0.15
w_slab2 float

slab width in um.

6.0
layer_wg LayerSpec

for input waveguide.

'WG'
layer_slab LayerSpec

for output waveguide with slab.

'SLAB90'
cross_section CrossSectionSpec

for input waveguide.

'strip'
use_slab_port bool

if True adds a second port for the slab.

False
slab_port_layer LayerSpec | None

if specified, overrides the layer for the slab port.

None
                  __________________________
                 /           |
         _______/____________|______________
               /             |
   width1     |w_slab1       | w_slab2  width2
         ______\_____________|______________
                \            |
                 \__________________________

taper_strip_to_ridge_trenches

Defines taper using trenches to define the etch.

Parameters:

Name Type Description Default
length float

in um.

10.0
width float

in um.

0.5
slab_offset float

in um.

3.0
trench_width float

in um.

2.0
trench_layer LayerSpec

trench layer.

'DEEP_ETCH'
layer_wg LayerSpec

waveguide layer.

'WG'
trench_offset float

after waveguide in um.

0.1

taper_strip_to_slab150

Linear taper from strip to rib.

Parameters:

Name Type Description Default
length float

taper length (um).

10.0
width1 float

in um.

0.5
width2 float

in um.

0.5
w_slab1 float

slab width in um.

0.15
w_slab2 float

slab width in um.

6.0
layer_wg LayerSpec

for input waveguide.

'WG'
layer_slab LayerSpec

for output waveguide with slab.

'SLAB150'
cross_section CrossSectionSpec

for input waveguide.

'strip'
use_slab_port bool

if True adds a second port for the slab.

False
slab_port_layer LayerSpec | None

if specified, overrides the layer for the slab port.

None
                  __________________________
                 /           |
         _______/____________|______________
               /             |
   width1     |w_slab1       | w_slab2  width2
         ______\_____________|______________
                \            |
                 \__________________________

taper_w10_l100

Returns taper from CSV file.

Parameters:

Name Type Description Default
filepath Path

for CSV file.

data / 'taper_strip_0p5_10_100.csv'
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'

taper_w10_l150

Returns taper from CSV file.

Parameters:

Name Type Description Default
filepath Path

for CSV file.

data / 'taper_strip_0p5_10_150.csv'
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'

taper_w10_l200

Returns taper from CSV file.

Parameters:

Name Type Description Default
filepath Path

for CSV file.

data / 'taper_strip_0p5_10_200.csv'
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'

taper_w11_l200

Returns taper from CSV file.

Parameters:

Name Type Description Default
filepath Path

for CSV file.

data / 'taper_strip_0p5_11_200.csv'
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'

taper_w12_l200

Returns taper from CSV file.

Parameters:

Name Type Description Default
filepath Path

for CSV file.

data / 'taper_strip_0p5_12_200.csv'
cross_section CrossSectionSpec

specification (CrossSection, string, CrossSectionFactory dict).

'strip'

terminator

Returns doped taper to terminate waveguides.

Parameters:

Name Type Description Default
length float | None

distance between input and narrow tapered end.

50
cross_section_input CrossSectionSpec

input cross-section.

strip
cross_section_tip CrossSectionSpec | None

cross-section at the end of the termination.

None
tapered_width float

width of the default cross-section at the end of the termination. Only used if cross_section_tip is not None.

0.2
doping_layers LayerSpecs

doping layers to superimpose on the taper. Default N++.

('NPP',)
doping_offset float

offset of the doping layer beyond the bbox

1.0

terminator_spiral

Returns doped taper to terminate waveguides.

Parameters:

Name Type Description Default
separation float

separation between the loops.

3.0
width_tip float

width of the default cross-section at the end of the termination. Only used if cross_section_tip is not None.

0.2
number_of_loops float

number of loops in the spiral.

1
npoints int

points for the spiral.

1000
min_bend_radius float | None

minimum bend radius for the spiral.

None
cross_section CrossSectionSpec

input cross-section.

'strip'

text

Text shapes.

Parameters:

Name Type Description Default
text str

string.

'abcd'
size float

in um of each character.

10.0
position Coordinate

x, y position.

(0, 0)
justify str

left, right, center.

'left'
layer LayerSpec

for the text.

'WG'

text_freetype

Returns text Component.

Parameters:

Name Type Description Default
text str

string.

'a'
size int

in um.

10
justify str

left, right, center.

'left'
font PathType

Font face to use. Default DEPLOF does not require additional libraries, otherwise freetype load fonts. You can choose font by name (e.g. "Times New Roman"), or by file OTF or TTF filepath.

font_ocr
layer LayerSpec

list of layers to use for the text.

'WG'
layers LayerSpecs | None

list of layers to use for the text.

None

text_klayout

Returns a text component.

Parameters:

Name Type Description Default
text str

string.

'a'
layer LayerSpec

text layer.

'WG'
layers LayerSpecs | None

layers for the text.

None
bbox_layers LayerSpecs | None

layers for the text bounding box.

None

text_lines

Returns a Component from a text lines.

Parameters:

Name Type Description Default
text tuple[str, ...]

list of strings.

('Chip', '01')
size float

text size.

0.4
layer LayerSpec

text layer.

'WG'

text_rectangular

Pixel based font, guaranteed to be manhattan, without acute angles.

Parameters:

Name Type Description Default
text str

string.

'abcd'
size float

pixel size in um.

10.0
position tuple[float, float]

coordinate.

(0.0, 0.0)
justify str

left, right or center.

'left'
layer LayerSpec | None

for text.

'WG'
layers LayerSpecs | None

optional for duplicating the text.

None
font Callable[..., dict[str, str]]

function that returns dictionary of characters.

rectangular_font

text_rectangular_multi_layer

Returns rectangular text in different layers.

Parameters:

Name Type Description Default
text str

string of text.

'abcd'
layers LayerSpecs

list of layers to replicate the text.

('WG', 'M1', 'M2', 'MTOP')
text_factory ComponentSpec

function to create the text Components.

text_rectangular
kwargs Any

keyword arguments for text_factory.

{}

Other Parameters:

Name Type Description
size

pixel size.

position

coordinate.

justify

left, right or center.

font

function that returns dictionary of characters.

torus

Returns a torus (annular sector / ring sector) centered at origin.

Parameters:

Name Type Description Default
inner_radius float

inner radius.

5.0
outer_radius float

outer radius.

10.0
start_angle float

start angle in degrees.

0.0
end_angle float

end angle in degrees.

360.0
angle_resolution float

degrees per arc point.

2.5
layer LayerSpec

layer spec.

'WG'
port_type str | None

None, optical, or electrical.

None

torus_wave

Returns a torus (full ring) with sinusoidal boundary modulation.

Inner and outer boundaries oscillate sinusoidally. When in_phase=True, both boundaries are modulated in phase; when False, they are pi/2 out of phase.

Parameters:

Name Type Description Default
inner_radius float

mean inner radius.

5.0
outer_radius float

mean outer radius.

10.0
amplitude float

amplitude of boundary oscillation.

0.5
n_oscillations int

number of oscillations around the boundary.

8
in_phase bool

if True, inner and outer modulations are in phase.

True
angle_resolution float

degrees per point.

1.0
layer LayerSpec

layer spec.

'WG'

transmon

Creates a transmon qubit with Josephson junction.

A transmon qubit consists of two capacitor pads connected by a Josephson junction. The junction creates an anharmonic oscillator that can be used as a qubit.

Parameters:

Name Type Description Default
pad_width float

Width of each capacitor pad in μm.

200.0
pad_height float

Height of each capacitor pad in μm.

100.0
pad_gap float

Gap between the two pads in μm.

6.0
junction_width float

Width of the Josephson junction in μm.

0.15
junction_height float

Height of the Josephson junction in μm.

0.3
island_width float

Width of the central island in μm.

10.0
island_height float

Height of the central island in μm.

4.0
layer_metal LayerSpec

Layer for the metal pads.

(1, 0)
layer_junction LayerSpec

Layer for the Josephson junction.

(2, 0)
layer_island LayerSpec

Layer for the central island.

(1, 0)
port_type str

Type of port to add to the component.

'electrical'

Returns:

Name Type Description
Component Component

A gdsfactory component with the transmon geometry.

transmon_circular

Creates a circular transmon qubit with Josephson junction.

A circular variant of the transmon qubit with circular capacitor pads.

Parameters:

Name Type Description Default
pad_radius float

Radius of each circular capacitor pad in μm.

100.0
pad_gap float

Gap between the two pads in μm.

6.0
junction_width float

Width of the Josephson junction in μm.

0.15
junction_height float

Height of the Josephson junction in μm.

0.3
island_radius float

Radius of the central circular island in μm.

5.0
layer_metal LayerSpec

Layer for the metal pads.

(1, 0)
layer_junction LayerSpec

Layer for the Josephson junction.

(2, 0)
layer_island LayerSpec

Layer for the central island.

(1, 0)
port_type str

Type of port to add to the component.

'electrical'

Returns:

Name Type Description
Component Component

A gdsfactory component with the circular transmon geometry.

triangle

Return triangle.

Parameters:

Name Type Description Default
x float

base xsize.

10
xtop float

top xsize.

0
y float

ysize.

20
ybot float

bottom ysize.

0
layer LayerSpec

layer.

'WG'
    xtop
       _
      | \
      |  \
      |   \
     y|    \
      |     \
      |      \
      |______|ybot
          x

triangle2

Return 2 triangles (bot, top).

Parameters:

Name Type Description Default
spacing float

between top and bottom.

3
kwargs Any

triangle arguments.

{}

Other Parameters:

Name Type Description
x

base xsize.

xtop

top xsize.

y

ysize.

ybot

bottom ysize.

layer

layer.

_ | \ | \ | \ | \ | \ | \ | \ | | spacing | / | / | / | / | / |_/

triangle2_thin

Return 2 triangles (bot, top).

Parameters:

Name Type Description Default
spacing float

between top and bottom.

3
kwargs Any

triangle arguments.

{}

Other Parameters:

Name Type Description
x

base xsize.

xtop

top xsize.

y

ysize.

ybot

bottom ysize.

layer

layer.

_ | \ | \ | \ | \ | \ | \ | \ | | spacing | / | / | / | / | / |_/

triangle4

Return 4 triangles.

Parameters:

Name Type Description Default
kwargs Any

triangle arguments.

{}

Other Parameters:

Name Type Description
x

base xsize.

xtop

top xsize.

y

ysize.

ybot

bottom ysize.

layer

layer.

  / | \
 /  |  \
/   |   \

/ | \ / | \ / | \ / | \ | | | | / | / | / | / | / |_/

triangle4_thin

Return 4 triangles.

Parameters:

Name Type Description Default
kwargs Any

triangle arguments.

{}

Other Parameters:

Name Type Description
x

base xsize.

xtop

top xsize.

y

ysize.

ybot

bottom ysize.

layer

layer.

  / | \
 /  |  \
/   |   \

/ | \ / | \ / | \ / | \ | | | | / | / | / | / | / |_/

triangle_thin

Return triangle.

Parameters:

Name Type Description Default
x float

base xsize.

2
xtop float

top xsize.

0.2
y float

ysize.

5
ybot float

bottom ysize.

0
layer LayerSpec

layer.

'WG'
    xtop
       _
      | \
      |  \
      |   \
     y|    \
      |     \
      |      \
      |______|ybot
          x

trim

Trim a component by another geometry, preserving the component's layers and ports.

Useful to get a smaller component from a larger one for simulation.

Parameters:

Name Type Description Default
component Component

Component(/Reference).

required
domain Sequence[tuple[float, float]]

list of array-like[N][2] representing the boundary of the component to keep.

required
flatten bool

if True, flattens the component.

False

Returns: New component with layers (and possibly ports) of the component restricted to the domain.

Example
import gdsfactory as gf
c = gf.components.straight_pin(length=10)
trimmed_c = gf.functions.trim(component=c, domain=[[0, -5], [0, 5], [5, 5], [5, -5]])
trimmed_c.plot()

vernier_scale

Vernier scale for overlay measurement.

Creates two rows of rectangular marks: a main scale and a vernier scale. The slight pitch difference between the two scales allows sub-pitch overlay measurement. The zero marks of both scales are centered at the origin.

Parameters:

Name Type Description Default
n_divisions int

Number of marks on each side of the center mark (total marks per scale = 2 * n_divisions + 1).

10
pitch_main float

Center-to-center spacing of main scale marks in um.

10.0
pitch_vernier float

Center-to-center spacing of vernier scale marks in um.

9.8
mark_width float

Width of each rectangular mark in um.

1.0
mark_height_main float

Height of each main scale mark in um.

20.0
mark_height_vernier float

Height of each vernier scale mark in um.

15.0
layer_main LayerSpec

Layer specification for the main scale marks.

'WG'
layer_vernier LayerSpec

Layer specification for the vernier scale marks.

(2, 0)

verniers

Returns a component with verniers.

Parameters:

Name Type Description Default
widths Floats

list of widths.

(0.1, 0.2, 0.3, 0.4, 0.5)
gap float

gap between verniers.

0.1
xsize float

size of the component.

100.0
layer_label LayerSpec

layer for the labels.

'TEXT'
straight ComponentSpec

straight function.

'straight'
cross_section CrossSectionSpec

cross_section spec.

'strip_no_ports'
kwargs Any

straight settings.

{}

version_stamp

Component with module version and date.

Parameters:

Name Type Description Default
labels tuple[str, ...]

Iterable of labels.

('demo_label',)
with_qr_code bool

Whether to add a QR code with the date.

False
layer LayerSpec

Layer to use.

'WG'
pixel_size int

Pixel size.

1
version str | None

Version string.

None
text_size int

Text size.

10

via

Rectangular via.

Parameters:

Name Type Description Default
size Size

in x and y direction.

(0.7, 0.7)
enclosure float

inclusion of via.

1.0
layer LayerSpec

via layer.

'VIAC'
bbox_layers Sequence[LayerSpec] | None

layers for the bounding box.

None
bbox_offset float

in um.

0
bbox_offsets Sequence[float] | None

List of offsets for each bbox_layer.

None
pitch float

pitch between vias.

2
column_pitch float | None

Optional pitch between columns of vias. Default is pitch.

None
row_pitch float | None

Optional pitch between rows of vias. Default is pitch.

None
    enclosure
    _________________________________________
    |<--->                                  |
    |             gap[0]    size[0]         |
    |             <------> <----->          |
    |      ______          ______           |
    |     |      |        |      |          |
    |     |      |        |      |  size[1] |
    |     |______|        |______|          |
    |      <------------->                  |
    |           pitch                       |
    |_______________________________________|

via1

Rectangular via.

Parameters:

Name Type Description Default
size Size

in x and y direction.

(0.7, 0.7)
enclosure float

inclusion of via.

1
layer LayerSpec

via layer.

'VIA1'
bbox_layers Sequence[LayerSpec] | None

layers for the bounding box.

None
bbox_offset float

in um.

0
bbox_offsets Sequence[float] | None

List of offsets for each bbox_layer.

None
pitch float

pitch between vias.

2
column_pitch float | None

Optional pitch between columns of vias. Default is pitch.

None
row_pitch float | None

Optional pitch between rows of vias. Default is pitch.

None
    enclosure
    _________________________________________
    |<--->                                  |
    |             gap[0]    size[0]         |
    |             <------> <----->          |
    |      ______          ______           |
    |     |      |        |      |          |
    |     |      |        |      |  size[1] |
    |     |______|        |______|          |
    |      <------------->                  |
    |           pitch                       |
    |_______________________________________|

via2

Rectangular via.

Parameters:

Name Type Description Default
size Size

in x and y direction.

(0.7, 0.7)
enclosure float

inclusion of via.

1.0
layer LayerSpec

via layer.

'VIA2'
bbox_layers Sequence[LayerSpec] | None

layers for the bounding box.

None
bbox_offset float

in um.

0
bbox_offsets Sequence[float] | None

List of offsets for each bbox_layer.

None
pitch float

pitch between vias.

2
column_pitch float | None

Optional pitch between columns of vias. Default is pitch.

None
row_pitch float | None

Optional pitch between rows of vias. Default is pitch.

None
    enclosure
    _________________________________________
    |<--->                                  |
    |             gap[0]    size[0]         |
    |             <------> <----->          |
    |      ______          ______           |
    |     |      |        |      |          |
    |     |      |        |      |  size[1] |
    |     |______|        |______|          |
    |      <------------->                  |
    |           pitch                       |
    |_______________________________________|

via3

Via connecting M3 <-> M4, mirroring via1/via2/viac's shape (0.7x0.7um squares, 1um enclosure, 2um pitch) but on VIA3_LAYER.

Only meaningful once M4 also has real z-geometry — see get_extended_layer_stack() for the matching LayerStack entry.

Parameters:

Name Type Description Default
size tuple[float, float]

(width, height) of the via square, in um.

(0.7, 0.7)
enclosure float

metal enclosure around the via, in um.

1.0
pitch float

via array pitch, in um.

2.0

via_chain

Via chain to extract via resistance.

Parameters:

Name Type Description Default
num_vias int

number of vias.

100
cols int

number of column pairs.

10
via ComponentSpec

via component.

'via1'
contact ComponentSpec

contact component.

'via_stack_m2_m3'
layers_bot LayerSpecs

list of bottom layers.

('M1',)
layers_top LayerSpecs

list of top layers.

('M2',)
offsets_top tuple[float, ...]

list of top layer offsets.

(0,)
offsets_bot tuple[float, ...]

list of bottom layer offsets.

(0,)
via_min_enclosure float

via_min_enclosure.

1.0
min_metal_spacing float

min_metal_spacing.

1.0
contact_offset float

contact offset.

0.0
    side view:
                                          min_metal_spacing
       ┌────────────────────────────────────┐              ┌────────────────────────────────────┐
       │  layers_top                        │              │                                    │
       │                                    │◄───────────► │                                    │
       └─────────────┬─────┬────────────────┘              └───────────────┬─────┬──────────────┘
                     │     │         via_enclosure                         │     │
                     │     │◄───────────────►                              │     │
                     │     │                                               │     │
                     │     │                                               │     │
                     │width│                                               │     │
                     ◄─────►                                               │     │
                     │     │                                               │     │
       ┌─────────────┴─────┴───────────────────────────────────────────────┴─────┴───────────────┐
       │ layers_bot                                                                              │
       │                                                                                         │
       └─────────────────────────────────────────────────────────────────────────────────────────┘
       ◄─────────────────────────────────────────────────────────────────────────────────────────►
                                     2*e + w + min_metal_spacing + 2*e + w

via_circular

Circular via.

Parameters:

Name Type Description Default
radius float

in um.

0.35
enclosure float

inclusion of via in um for the layer above.

1.0
layer LayerSpec

via layer.

'VIAC'
pitch float | None

pitch between vias.

2
column_pitch float | None

Optional pitch between columns of vias. Default is pitch.

None
row_pitch float | None

Optional pitch between rows of vias. Default is pitch.

None
angle_resolution float

number of degrees per point.

2.5

via_corner

Returns Corner via.

Use in place of wire_corner to route between two layers.

Parameters:

Name Type Description Default
cross_section MultiCrossSectionAngleSpec

list of cross_section, orientation pairs.

((metal2, (0, 180)), (metal3, (90, 270)))
vias tuple[ComponentSpec]

vias to use to fill the rectangles.

('via1',)
layers_labels tuple[str, ...]

Labels to use for each layer.

('m2', 'm3')
kwargs Any

cross_section settings.

{}

via_stack

Rectangular via array stack.

You can use it to connect different metal layers or metals to silicon. You can use the naming convention via_stack_layerSource_layerDestination contains 4 ports (e1, e2, e3, e4)

also know as Via array http://www.vlsi-expert.com/2017/12/vias.html

Parameters:

Name Type Description Default
size Size

of the layers.

(11.0, 11.0)
layers LayerSpecs

layers on which to draw rectangles.

('M1', 'M2', 'MTOP')
layer_offsets Floats | tuple[float | tuple[float, float], ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size. If a tuple, it is the offset in x and y.

None
vias Sequence[ComponentSpec | None]

vias to use to fill the rectangles.

('via1', 'via2', None)
layer_to_port_orientations dict[LayerSpec, list[int]] | None

dictionary of layer to port_orientations.

None
correct_size bool

if True, if the specified dimensions are too small it increases them to the minimum possible to fit a via.

False
slot_horizontal bool

if True, then vias are horizontal.

False
slot_vertical bool

if True, then vias are vertical.

False
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)

via_stack_corner45

Rectangular via array stack at a 45 degree angle.

Parameters:

Name Type Description Default
width float

of the corner45.

10
layers Sequence[LayerSpec | None]

layers on which to draw rectangles.

('M1', 'M2', 'MTOP')
layer_offsets Floats | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size.

None
vias Sequence[ComponentSpec | None]

vias to use to fill the rectangles.

('via1', 'via2', None)
layer_port LayerSpec | None

if None assumes port is on the last layer.

None
correct_size bool

if True, if the specified dimensions are too small it increases them to the minimum possible to fit a via.

False

via_stack_corner45_extended

Rectangular via array stack at a 45 degree angle.

Parameters:

Name Type Description Default
corner ComponentSpec

corner component.

'via_stack_corner45'
via_stack ComponentSpec

for the via stack.

'via_stack'
width float

of the corner45.

3
length float

of the straight.

10

via_stack_heater_m2

Rectangular via array stack.

You can use it to connect different metal layers or metals to silicon. You can use the naming convention via_stack_layerSource_layerDestination contains 4 ports (e1, e2, e3, e4)

also know as Via array http://www.vlsi-expert.com/2017/12/vias.html

Parameters:

Name Type Description Default
size Size

of the layers.

(11.0, 11.0)
layers LayerSpecs

layers on which to draw rectangles.

('HEATER', 'M2')
layer_offsets Floats | tuple[float | tuple[float, float], ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size. If a tuple, it is the offset in x and y.

None
vias Sequence[ComponentSpec | None]

vias to use to fill the rectangles.

(None, 'via1')
layer_to_port_orientations dict[LayerSpec, list[int]] | None

dictionary of layer to port_orientations.

None
correct_size bool

if True, if the specified dimensions are too small it increases them to the minimum possible to fit a via.

False
slot_horizontal bool

if True, then vias are horizontal.

False
slot_vertical bool

if True, then vias are vertical.

False
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)

via_stack_heater_m3

Rectangular via array stack.

You can use it to connect different metal layers or metals to silicon. You can use the naming convention via_stack_layerSource_layerDestination contains 4 ports (e1, e2, e3, e4)

also know as Via array http://www.vlsi-expert.com/2017/12/vias.html

Parameters:

Name Type Description Default
size Size

of the layers.

(11.0, 11.0)
layers LayerSpecs

layers on which to draw rectangles.

('HEATER', 'M2', 'MTOP')
layer_offsets Floats | tuple[float | tuple[float, float], ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size. If a tuple, it is the offset in x and y.

None
vias Sequence[ComponentSpec | None]

vias to use to fill the rectangles.

(None, 'via1', 'via2')
layer_to_port_orientations dict[LayerSpec, list[int]] | None

dictionary of layer to port_orientations.

None
correct_size bool

if True, if the specified dimensions are too small it increases them to the minimum possible to fit a via.

False
slot_horizontal bool

if True, then vias are horizontal.

False
slot_vertical bool

if True, then vias are vertical.

False
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)

via_stack_heater_mtop

Rectangular via array stack.

You can use it to connect different metal layers or metals to silicon. You can use the naming convention via_stack_layerSource_layerDestination contains 4 ports (e1, e2, e3, e4)

also know as Via array http://www.vlsi-expert.com/2017/12/vias.html

Parameters:

Name Type Description Default
size Size

of the layers.

(11.0, 11.0)
layers LayerSpecs

layers on which to draw rectangles.

('HEATER', 'M2', 'MTOP')
layer_offsets Floats | tuple[float | tuple[float, float], ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size. If a tuple, it is the offset in x and y.

None
vias Sequence[ComponentSpec | None]

vias to use to fill the rectangles.

(None, 'via1', 'via2')
layer_to_port_orientations dict[LayerSpec, list[int]] | None

dictionary of layer to port_orientations.

None
correct_size bool

if True, if the specified dimensions are too small it increases them to the minimum possible to fit a via.

False
slot_horizontal bool

if True, then vias are horizontal.

False
slot_vertical bool

if True, then vias are vertical.

False
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)

via_stack_heater_mtop_mini

Rectangular via array stack.

You can use it to connect different metal layers or metals to silicon. You can use the naming convention via_stack_layerSource_layerDestination contains 4 ports (e1, e2, e3, e4)

also know as Via array http://www.vlsi-expert.com/2017/12/vias.html

Parameters:

Name Type Description Default
size Size

of the layers.

(4, 4)
layers LayerSpecs

layers on which to draw rectangles.

('HEATER', 'M2', 'MTOP')
layer_offsets Floats | tuple[float | tuple[float, float], ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size. If a tuple, it is the offset in x and y.

None
vias Sequence[ComponentSpec | None]

vias to use to fill the rectangles.

(None, 'via1', 'via2')
layer_to_port_orientations dict[LayerSpec, list[int]] | None

dictionary of layer to port_orientations.

None
correct_size bool

if True, if the specified dimensions are too small it increases them to the minimum possible to fit a via.

False
slot_horizontal bool

if True, then vias are horizontal.

False
slot_vertical bool

if True, then vias are vertical.

False
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)

via_stack_m1_m3

Rectangular via array stack.

You can use it to connect different metal layers or metals to silicon. You can use the naming convention via_stack_layerSource_layerDestination contains 4 ports (e1, e2, e3, e4)

also know as Via array http://www.vlsi-expert.com/2017/12/vias.html

Parameters:

Name Type Description Default
size Size

of the layers.

(11.0, 11.0)
layers LayerSpecs

layers on which to draw rectangles.

('M1', 'M2', 'MTOP')
layer_offsets Floats | tuple[float | tuple[float, float], ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size. If a tuple, it is the offset in x and y.

None
vias Sequence[ComponentSpec | None]

vias to use to fill the rectangles.

('via1', 'via2', None)
layer_to_port_orientations dict[LayerSpec, list[int]] | None

dictionary of layer to port_orientations.

None
correct_size bool

if True, if the specified dimensions are too small it increases them to the minimum possible to fit a via.

False
slot_horizontal bool

if True, then vias are horizontal.

False
slot_vertical bool

if True, then vias are vertical.

False
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)

via_stack_m1_mtop

Rectangular via array stack.

You can use it to connect different metal layers or metals to silicon. You can use the naming convention via_stack_layerSource_layerDestination contains 4 ports (e1, e2, e3, e4)

also know as Via array http://www.vlsi-expert.com/2017/12/vias.html

Parameters:

Name Type Description Default
size Size

of the layers.

(11.0, 11.0)
layers LayerSpecs

layers on which to draw rectangles.

('M1', 'M2', 'MTOP')
layer_offsets Floats | tuple[float | tuple[float, float], ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size. If a tuple, it is the offset in x and y.

None
vias Sequence[ComponentSpec | None]

vias to use to fill the rectangles.

('via1', 'via2', None)
layer_to_port_orientations dict[LayerSpec, list[int]] | None

dictionary of layer to port_orientations.

None
correct_size bool

if True, if the specified dimensions are too small it increases them to the minimum possible to fit a via.

False
slot_horizontal bool

if True, then vias are horizontal.

False
slot_vertical bool

if True, then vias are vertical.

False
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)

via_stack_m2_m3

Rectangular via array stack.

You can use it to connect different metal layers or metals to silicon. You can use the naming convention via_stack_layerSource_layerDestination contains 4 ports (e1, e2, e3, e4)

also know as Via array http://www.vlsi-expert.com/2017/12/vias.html

Parameters:

Name Type Description Default
size Size

of the layers.

(11.0, 11.0)
layers LayerSpecs

layers on which to draw rectangles.

('M2', 'MTOP')
layer_offsets Floats | tuple[float | tuple[float, float], ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size. If a tuple, it is the offset in x and y.

None
vias Sequence[ComponentSpec | None]

vias to use to fill the rectangles.

('via2', None)
layer_to_port_orientations dict[LayerSpec, list[int]] | None

dictionary of layer to port_orientations.

None
correct_size bool

if True, if the specified dimensions are too small it increases them to the minimum possible to fit a via.

False
slot_horizontal bool

if True, then vias are horizontal.

False
slot_vertical bool

if True, then vias are vertical.

False
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)

via_stack_npp_m1

Rectangular via array stack.

You can use it to connect different metal layers or metals to silicon. You can use the naming convention via_stack_layerSource_layerDestination contains 4 ports (e1, e2, e3, e4)

also know as Via array http://www.vlsi-expert.com/2017/12/vias.html

Parameters:

Name Type Description Default
size Size

of the layers.

(11.0, 11.0)
layers LayerSpecs

layers on which to draw rectangles.

('WG', 'NPP', 'M1')
layer_offsets Floats | tuple[float | tuple[float, float], ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size. If a tuple, it is the offset in x and y.

None
vias Sequence[ComponentSpec | None]

vias to use to fill the rectangles.

(None, None, 'viac')
layer_to_port_orientations dict[LayerSpec, list[int]] | None

dictionary of layer to port_orientations.

None
correct_size bool

if True, if the specified dimensions are too small it increases them to the minimum possible to fit a via.

False
slot_horizontal bool

if True, then vias are horizontal.

False
slot_vertical bool

if True, then vias are vertical.

False
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)

via_stack_slab_m1

Rectangular via array stack.

You can use it to connect different metal layers or metals to silicon. You can use the naming convention via_stack_layerSource_layerDestination contains 4 ports (e1, e2, e3, e4)

also know as Via array http://www.vlsi-expert.com/2017/12/vias.html

Parameters:

Name Type Description Default
size Size

of the layers.

(11.0, 11.0)
layers LayerSpecs

layers on which to draw rectangles.

('SLAB90', 'M1')
layer_offsets Floats | tuple[float | tuple[float, float], ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size. If a tuple, it is the offset in x and y.

None
vias Sequence[ComponentSpec | None]

vias to use to fill the rectangles.

('viac', 'via1')
layer_to_port_orientations dict[LayerSpec, list[int]] | None

dictionary of layer to port_orientations.

None
correct_size bool

if True, if the specified dimensions are too small it increases them to the minimum possible to fit a via.

False
slot_horizontal bool

if True, then vias are horizontal.

False
slot_vertical bool

if True, then vias are vertical.

False
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)

via_stack_slab_m1_horizontal

Rectangular via array stack.

You can use it to connect different metal layers or metals to silicon. You can use the naming convention via_stack_layerSource_layerDestination contains 4 ports (e1, e2, e3, e4)

also know as Via array http://www.vlsi-expert.com/2017/12/vias.html

Parameters:

Name Type Description Default
size Size

of the layers.

(11.0, 11.0)
layers LayerSpecs

layers on which to draw rectangles.

('SLAB90', 'M1')
layer_offsets Floats | tuple[float | tuple[float, float], ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size. If a tuple, it is the offset in x and y.

None
vias Sequence[ComponentSpec | None]

vias to use to fill the rectangles.

('viac', 'via1')
layer_to_port_orientations dict[LayerSpec, list[int]] | None

dictionary of layer to port_orientations.

None
correct_size bool

if True, if the specified dimensions are too small it increases them to the minimum possible to fit a via.

False
slot_horizontal bool

if True, then vias are horizontal.

True
slot_vertical bool

if True, then vias are vertical.

False
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)

via_stack_slab_m2

Rectangular via array stack.

You can use it to connect different metal layers or metals to silicon. You can use the naming convention via_stack_layerSource_layerDestination contains 4 ports (e1, e2, e3, e4)

also know as Via array http://www.vlsi-expert.com/2017/12/vias.html

Parameters:

Name Type Description Default
size Size

of the layers.

(11.0, 11.0)
layers LayerSpecs

layers on which to draw rectangles.

('SLAB90', 'M1', 'M2')
layer_offsets Floats | tuple[float | tuple[float, float], ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size. If a tuple, it is the offset in x and y.

None
vias Sequence[ComponentSpec | None]

vias to use to fill the rectangles.

('viac', 'via1', None)
layer_to_port_orientations dict[LayerSpec, list[int]] | None

dictionary of layer to port_orientations.

None
correct_size bool

if True, if the specified dimensions are too small it increases them to the minimum possible to fit a via.

False
slot_horizontal bool

if True, then vias are horizontal.

False
slot_vertical bool

if True, then vias are vertical.

False
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)

via_stack_slab_m3

Rectangular via array stack.

You can use it to connect different metal layers or metals to silicon. You can use the naming convention via_stack_layerSource_layerDestination contains 4 ports (e1, e2, e3, e4)

also know as Via array http://www.vlsi-expert.com/2017/12/vias.html

Parameters:

Name Type Description Default
size Size

of the layers.

(11.0, 11.0)
layers LayerSpecs

layers on which to draw rectangles.

('SLAB90', 'M1', 'M2', 'MTOP')
layer_offsets Floats | tuple[float | tuple[float, float], ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size. If a tuple, it is the offset in x and y.

None
vias Sequence[ComponentSpec | None]

vias to use to fill the rectangles.

('viac', 'via1', 'via2', None)
layer_to_port_orientations dict[LayerSpec, list[int]] | None

dictionary of layer to port_orientations.

None
correct_size bool

if True, if the specified dimensions are too small it increases them to the minimum possible to fit a via.

False
slot_horizontal bool

if True, then vias are horizontal.

False
slot_vertical bool

if True, then vias are vertical.

False
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)

via_stack_slab_npp_m3

Rectangular via array stack.

You can use it to connect different metal layers or metals to silicon. You can use the naming convention via_stack_layerSource_layerDestination contains 4 ports (e1, e2, e3, e4)

also know as Via array http://www.vlsi-expert.com/2017/12/vias.html

Parameters:

Name Type Description Default
size Size

of the layers.

(11.0, 11.0)
layers LayerSpecs

layers on which to draw rectangles.

('SLAB90', 'NPP', 'M1')
layer_offsets Floats | tuple[float | tuple[float, float], ...] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size. If a tuple, it is the offset in x and y.

None
vias Sequence[ComponentSpec | None]

vias to use to fill the rectangles.

(None, None, 'viac')
layer_to_port_orientations dict[LayerSpec, list[int]] | None

dictionary of layer to port_orientations.

None
correct_size bool

if True, if the specified dimensions are too small it increases them to the minimum possible to fit a via.

False
slot_horizontal bool

if True, then vias are horizontal.

False
slot_vertical bool

if True, then vias are vertical.

False
port_orientations Ints | None

list of port_orientations to add. None does not add ports.

(180, 90, 0, -90)

via_stack_with_offset

Rectangular layer transition with offset between layers.

Parameters:

Name Type Description Default
layers LayerSpecs

layer specs between vias.

('PPP', 'M1')
size Size | None

for all vias array.

(10, 10)
sizes Sequence[Size] | None

Optional size for each via array. Overrides size.

None
layer_offsets Sequence[float] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size.

None
vias Sequence[ComponentSpec | None]

via spec for previous layer. None for no via.

(None, 'viac')
offsets Sequence[float] | None

optional offset for each layer relatively to the previous one. By default it only offsets by size[1] if there is a via.

None
layer_to_port_orientations dict[LayerSpec, list[int]] | None

Optional dictionary with layer to port orientations.

None
     __________________________
    |                          |
    |                          | layers[2]
    |__________________________|           vias[2] = None
    |                          |
    | layer_offsets[1]+size    | layers[1]
    |__________________________|
        |     |
        vias[1]
     ___|_____|__
    |            |
    |  sizes[0]  |  layers[0]
    |____________|
    vias[0] = None

via_stack_with_offset_m1_m3

Rectangular layer transition with offset between layers.

Parameters:

Name Type Description Default
layers LayerSpecs

layer specs between vias.

('M1', 'M2', 'MTOP')
size Size | None

for all vias array.

(10, 10)
sizes Sequence[Size] | None

Optional size for each via array. Overrides size.

None
layer_offsets Sequence[float] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size.

None
vias Sequence[ComponentSpec | None]

via spec for previous layer. None for no via.

(None, 'via1', 'via2')
offsets Sequence[float] | None

optional offset for each layer relatively to the previous one. By default it only offsets by size[1] if there is a via.

None
layer_to_port_orientations dict[LayerSpec, list[int]] | None

Optional dictionary with layer to port orientations.

None
     __________________________
    |                          |
    |                          | layers[2]
    |__________________________|           vias[2] = None
    |                          |
    | layer_offsets[1]+size    | layers[1]
    |__________________________|
        |     |
        vias[1]
     ___|_____|__
    |            |
    |  sizes[0]  |  layers[0]
    |____________|
    vias[0] = None

via_stack_with_offset_ppp_m1

Rectangular layer transition with offset between layers.

Parameters:

Name Type Description Default
layers LayerSpecs

layer specs between vias.

('PPP', 'M1')
size Size | None

for all vias array.

(10, 10)
sizes Sequence[Size] | None

Optional size for each via array. Overrides size.

None
layer_offsets Sequence[float] | None

Optional offsets for each layer with respect to size. positive grows, negative shrinks the size.

None
vias Sequence[ComponentSpec | None]

via spec for previous layer. None for no via.

(None, 'viac')
offsets Sequence[float] | None

optional offset for each layer relatively to the previous one. By default it only offsets by size[1] if there is a via.

None
layer_to_port_orientations dict[LayerSpec, list[int]] | None

Optional dictionary with layer to port orientations.

None
     __________________________
    |                          |
    |                          | layers[2]
    |__________________________|           vias[2] = None
    |                          |
    | layer_offsets[1]+size    | layers[1]
    |__________________________|
        |     |
        vias[1]
     ___|_____|__
    |            |
    |  sizes[0]  |  layers[0]
    |____________|
    vias[0] = None

viac

Rectangular via.

Parameters:

Name Type Description Default
size Size

in x and y direction.

(0.7, 0.7)
enclosure float

inclusion of via.

1.0
layer LayerSpec

via layer.

'VIAC'
bbox_layers Sequence[LayerSpec] | None

layers for the bounding box.

None
bbox_offset float

in um.

0
bbox_offsets Sequence[float] | None

List of offsets for each bbox_layer.

None
pitch float

pitch between vias.

2
column_pitch float | None

Optional pitch between columns of vias. Default is pitch.

None
row_pitch float | None

Optional pitch between rows of vias. Default is pitch.

None
    enclosure
    _________________________________________
    |<--->                                  |
    |             gap[0]    size[0]         |
    |             <------> <----->          |
    |      ______          ______           |
    |     |      |        |      |          |
    |     |      |        |      |  size[1] |
    |     |______|        |______|          |
    |      <------------->                  |
    |           pitch                       |
    |_______________________________________|

wafer

Returns complete wafer. Useful for mask aligner steps.

Parameters:

Name Type Description Default
reticle ComponentSpec

spec for each wafer reticle.

'die'
cols tuple[int, ...]

how many columns per row.

(2, 6, 6, 8, 8, 6, 6, 2)
xspacing float | None

optional spacing, defaults to reticle.xsize.

None
yspacing float | None

optional spacing, defaults to reticle.ysize.

None
die_name_col_row bool

if True, die name is row_col, otherwise is a number

False

wire_corner

Returns 45 degrees electrical corner wire.

Parameters:

Name Type Description Default
cross_section CrossSectionSpec

spec.

'metal_routing'
port_names PortNames

port names.

('e1', 'e2')
port_types PortTypes

port types.

('electrical', 'electrical')
width float | None

optional width. Defaults to cross_section width.

None
radius float | None

ignored.

None

wire_corner45

Returns 90 degrees electrical corner wire.

Parameters:

Name Type Description Default
cross_section CrossSectionSpec

spec.

'metal_routing'
radius float

in um.

10
width float | None

optional width.

None
layer LayerSpec | None

optional layer.

None
with_corner90_ports bool

if True adds ports at 90 degrees.

True

wire_corner45_straight

Returns 45 degrees wire straight ends.

Parameters:

Name Type Description Default
width float | None

of the wire.

None
radius float | None

of the corner. Defaults to width.

None
cross_section CrossSectionSpec

metal_routing.

'metal_routing'

wire_corner_sections

Returns 90 degrees electrical corner wire, where all cross_section sections properly represented.

Works well with symmetric cross_sections, not quite ready for asymmetric.

Parameters:

Name Type Description Default
cross_section CrossSectionSpec

spec.

'metal_routing'
port_type str

"electrical" or "optical".

'electrical'
kwargs Any

cross_section settings, ignored (such as radius, width, layer).

{}

wire_straight

Returns a Straight waveguide.

Parameters:

Name Type Description Default
length float

straight length (um).

10.0
npoints int

number of points.

2
cross_section CrossSectionSpec

specification (CrossSection, string or dict).

'metal_routing'
width float | None

width of the waveguide. If None, it will use the width of the cross_section.

None
    o1  ──────────────── o2
            length

ytron_round

Ytron structure for superconducting nanowires.

McCaughan, A. N., Abebe, N. S., Zhao, Q.-Y. & Berggren, K. K. Using Geometry To Sense Current. Nano Lett. 16, 7626-7631 (2016). http://dx.doi.org/10.1021/acs.nanolett.6b03593

Parameters:

Name Type Description Default
rho float

Radius of curvature of ytron intersection point.

1
arm_lengths tuple[float, float]

Lengths of the left and right arms of the yTron, respectively.

(500, 300)
source_length float

Length of the source of the yTron.

500
arm_widths tuple[float, float]

Widths of the left and right arms of the yTron, respectively.

(200, 200)
theta float

Angle between the two yTron arms.

2.5
theta_resolution float

Angle resolution for curvature of ytron intersection point.

10
layer LayerSpec

Specific layer(s) to put polygon geometry on.

'WG'

Returns:

Type Description
Component

Component containing a yTron geometry.