API#

Geometry Construction#

Classes and functions for construction and manipulation of geometric objects.

Component definition

Component([name, kcl, kdb_cell, ports])

Canvas where you add polygons, instances and ports.

ComponentReference(inst)

Shadows dbu attributes of Instance for backward compatibility.

read.import_gds(gdspath[, cellname, ...])

Reads a GDS file and returns a Component.

read.from_yaml(yaml_str[, routing_strategy, ...])

Returns Component from YAML string or file.

read.from_np(ndarray[, nm_per_pixel, layer, ...])

Returns Component from a np.ndarray.

paths

Path([path])

You can extrude a Path with a CrossSection to create a Component.

straight([length, npoints])

Returns a straight path.

euler([radius, angle, p, use_eff, npoints])

Returns an euler bend that adiabatically transitions from straight to curved.

arc([radius, angle, npoints, start_angle])

Returns a radial arc.

spiral_archimedean(min_bend_radius, ...)

Returns an Archimedean spiral.

smooth(points[, radius, bend])

Returns a smooth Path from a series of waypoints.

cross_section functions

CrossSection(*[, sections, ...])

Waveguide information to extrude a path.

Transition(*[, sections, ...])

Waveguide information to extrude a path between two CrossSection.

cross_section([width, offset, layer, ...])

Return CrossSection.

strip([width, offset, layer, sections, ...])

Return CrossSection.

heater_metal(*[, width, offset, layer, ...])

Return CrossSection.

pin([width, layer, layer_slab, ...])

Rib PIN doped cross_section.

pn([width, layer, layer_slab, ...])

Rib PN doped cross_section.

pn_with_trenches([width, layer, ...])

Rib PN doped cross_section.

strip_heater_metal_undercut([width, layer, ...])

Returns strip cross_section with top metal and undercut trenches on both.

strip_heater_metal([width, layer, ...])

Returns strip cross_section with top heater metal.

strip_heater_doped([width, layer, ...])

Returns strip cross_section with N++ doped heaters on both sides.

rib_heater_doped([width, layer, ...])

Returns rib cross_section with N++ doped heaters on both sides.

rib_heater_doped_via_stack([width, layer, ...])

Returns rib cross_section with N++ doped heaters on both sides.

transitions

transition(cross_section1, cross_section2[, ...])

Returns a smoothly-transitioning between two CrossSections.

boolean

boolean(A, B, operation[, layer1, layer2, layer])

Performs boolean operations between 2 Component/Reference/list objects.

decorators

cell([_func, set_settings, set_name, ...])

Default kcl @cell decorator.

typings

Anchor

alias of Literal['ce', 'cw', 'nc', 'ne', 'nw', 'sc', 'se', 'sw', 'center', 'cc']

CellSpec

Represent a PEP 604 union type

ComponentFactory

alias of Callable[..., Component]

ComponentSpec

Represent a PEP 604 union type

Component([name, kcl, kdb_cell, ports])

Canvas where you add polygons, instances and ports.

CrossSection(*[, sections, ...])

Waveguide information to extrude a path.

CrossSectionFactory

alias of Callable[..., CrossSection]

CrossSectionSpec

Represent a PEP 604 union type

Layer

alias of LayerEnum

LayerSpec

Represent a PEP 604 union type

LayerSpecs

Represent a PEP 604 union type

LayerLevel(*[, name, layer, derived_layer, ...])

Level for 3D LayerStack.

MaterialSpec

Represent a PEP 604 union type

MultiCrossSectionAngleSpec

Built-in mutable sequence.

PathType

Represent a PEP 604 union type

Section(*, width[, offset, insets, layer, ...])

CrossSection to extrude a path with a waveguide.

Step([x, y, dx, dy])

Manhattan Step.

StepAllAngle([x, y, dx, dy, ds, exit_angle, ...])

Pack#

pack

pack(component_list[, spacing, ...])

Pack a list of components into as few Components as possible.

grid([components, spacing, shape, align_x, ...])

Returns Component with a 1D or 2D grid of components.

grid_with_text([components, text_prefix, ...])

Returns Component with 1D or 2D grid of components with text labels.

Netlist#

get_netlist

get_netlist(component[, exclude_port_types, ...])

From Component returns a dict with instances, connections and placements.