circuitRF Reference Guide

Using a gdsfactory kit

Layout cells, ports and a technology from an open kit written as a gdsfactory package.

Some open process kits are published as a gdsfactory package: a Python package that defines the kit's layout cells, its layers and its layer stack. circuitRF runs those cells as its own PCells and builds a technology from the stack.

Two kinds of open kit

An open kit can reach you in two forms, and they supply different halves of a design. Decide which one you need first.

The kit's own tree A gdsfactory kit
What it is A folder downloaded from the kit's publisher A Python package installed with pip into your own Python (3.12 or later). Installing it installs gdsfactory and its layout engine too
How it comes in File ▸ Import ▸ PDK… ▸ Kit folder… — no Python needed File ▸ Import ▸ PDK… ▸ A Python package (gdsfactory)…
What it gives The schematic side: parts with symbols, their models and corners, and whatever layout cells circuitRF can run The layout side: parametric layout cells, their ports (position, width and direction), and the kit's layer stack and materials as a technology

Which do I need?

What a gdsfactory kit adds over the kit's own tree:

What it does not add: schematic symbols, circuit models and corners. Those come only from the kit's own tree. (A few kits ship their own drawing of each cell; circuitRF turns those into symbols, with pins placed from the ports. A symbol still gives a cell no circuit model.)

Nothing else to install. The layout engine comes with gdsfactory when pip installs it; no separate layout application is needed, and circuitRF installs nothing. A kit's own tree needs no Python at all unless its layout cells are Python, and then they run under the same consent prompt.

GDS export is circuitRF's. A gdsfactory cell's geometry becomes an ordinary generated cell in your layout. It exports through File ▸ Export and circuitrf convert like any other cell, and exporting never needs Python.

What to install

  1. Python 3.12 or later. Some kits require a specific version; circuitRF reads the kit's own requirement and refuses an interpreter that does not meet it, naming its version.
  2. A Python environment for the kit, such as a virtual environment, so the kit's own pinned gdsfactory version does not disturb anything else.
  3. The kit, with pip install into that environment. This installs the gdsfactory version the kit asks for.
A kit that lists a proprietary dependency

Some kits list an optional proprietary package as a dependency although none of their cells use it. Install such a kit with pip install --no-deps, then install its open dependencies (gdsfactory among them) yourself. circuitRF only imports gdsfactory and the kit. If a cell does need a module that is missing, the import report names that module, exactly as the error states it.

circuitRF never runs pip and never installs anything into your environment.

Importing the kit

File ▸ Import ▸ PDK… ▸ A Python package (gdsfactory)…

  1. Pick the interpreter: the Python whose environment holds the kit. Interpreters found on your PATH are offered, and Choose… finds any other.
  2. Pick the kit. circuitRF finds kits by reading files only: each installed package's metadata that names gdsfactory as a requirement. No kit code runs to list them. A kit that needs a newer Python than the one you picked is listed, dimmed, with the reason.
  3. Answer the consent prompt (below).
  4. Read the report.

Kit folder… works too, on a folder holding a gdsfactory kit's source, and takes the same steps. When the folder is a kit's own tree that also carries its gdsfactory package, both are imported: the kit's symbols and models first, then the package. The first report says that the second import follows.

The interpreter is yours, not the workspace's. It is remembered per user, by the kit's module name, and never written into the workspace. A colleague who opens the workspace is asked for their own once. The workspace records only the module and the version last seen; a different installed version is a note, never a refusal. To change environments, import the kit again and pick the other interpreter.

Import PDK - acmerf-gf 0.4.1 OK Also build the kit's technology 18 stack level(s), 6 material card(s) → tech/acmerf_gf.ctech. It becomes the workspace's default only if the workspace has none. acmerf-gf 0.4.1 — gdsfactory kit /home/you/.venvs/rf/lib/python3.12/site-packages/acmerf_gf 8 cell(s) offered, 2 not offered; 2 parameter(s) not offered; 0 placement port(s) not made pins. Cells offered (8) Not offered — raised while being built at its defaults (1) logo: FileNotFoundError: logo.gds Not offered — required arguments (1) array_of: component, spacing Parameters not offered (2) Kept at the kit's own default: None, sequences, functions and spec objects have no field to edit. coupler_rf: layers wilkinson: cross_section Pins dropped as placement (0) Import PDK - acmerf-gf 0.4.1 OK Also build the kit's technology 18 stack level(s), 6 material card(s) → tech/acmerf_gf.ctech. It becomes the workspace's default only if the workspace has none. acmerf-gf 0.4.1 — gdsfactory kit /home/you/.venvs/rf/lib/python3.12/site-packages/acmerf_gf 8 cell(s) offered, 2 not offered; 2 parameter(s) not offered; 0 placement port(s) not made pins. Cells offered (8) Not offered — raised while being built at its defaults (1) logo: FileNotFoundError: logo.gds Not offered — required arguments (1) array_of: component, spacing Parameters not offered (2) Kept at the kit's own default: None, sequences, functions and spec objects have no field to edit. coupler_rf: layers wilkinson: cross_section Pins dropped as placement (0)
The report a gdsfactory kit's import ends with: the cells it offers, those it does not and why, and the offer to build the kit's technology. The kit is invented; the report is the application's own.

The report lists:

Also build the kit's technology writes tech/<module>.ctech from the kit's layer stack, layer colours and material cards. It becomes the workspace's default technology only if the workspace has none. A stack lists only the layers that are drawn, so circuitRF fills what it does not state (the substrate, the dielectric between metals) and lists every value it had to fill. A permittivity it had nothing to go on for is a warning to set before running EM. Check the Stackup before the first EM run.

A gdsfactory kit is Python code, and nothing of it runs until you allow it.

Generated Artwork Allow this kit to draw its own artwork? Running this kit runs its Python code with your user account. acmerf_gf-pcells Package acmerf_gf Version 0.4.1 Location /home/you/.venvs/rf/lib/python3.12/site-packages/acmerf_gf Interpreter /home/you/.venvs/rf/bin/python If you don't allow this, those cells draw as placeholders and the rest of your design is unaffected. Your answer is remembered on this machine; Settings ▸ Security & Permissions changes it. Don't Allow Allow Generated Artwork Allow this kit to draw its own artwork? Running this kit runs its Python code with your user account. acmerf_gf-pcells Package acmerf_gf Version 0.4.1 Location /home/you/.venvs/rf/lib/python3.12/site-packages/acmerf_gf Interpreter /home/you/.venvs/rf/bin/python If you don't allow this, those cells draw as placeholders and the rest of your design is unaffected. Your answer is remembered on this machine; Settings ▸ Security & Permissions changes it. Don't Allow Allow
The consent prompt for a gdsfactory kit: the package, its version, where it is installed and the interpreter that would run it. Nothing of the kit runs until it is allowed. The kit is invented.

The prompt names the package, its version, where it is installed and the interpreter that would run it. Your answer is remembered on this machine, keyed by the kit's installed directory, so the same kit in a different environment asks again. It never travels with a workspace. Don't Allow leaves the kit's cells as placeholders and changes nothing else. Settings ▸ Security & Permissions changes the answer, kit by kit.

What you get

What you do not get

From the command line

circuitrf import pdk --module <module> --python <interpreter> --into <workspace> --allow-code --technology

--allow-code allows the kit for that one command and records nothing. Without it the kit is declared but not run. Every command that regenerates cells (render, convert, check and the rest) takes --python for the interpreter and --trust-kit <kit directory> for consent; on a machine where you have already allowed the kit, neither is needed.

--python <interpreter> names one interpreter for every gdsfactory kit in the command. --python <module>=<interpreter> names it for one kit, and can be given once per kit, so a design using two kits installed in two environments runs from a script:

circuitrf convert top.clay -o top.gds --python kit_a=/envs/a/bin/python --python kit_b=/envs/b/bin/python

A kit's own --python <module>=… wins over a plain --python. Naming a module the command does not use is a warning, not an error. The command line has the details.