Skip to content

api

User-facing configuration objects for the DEVSIM charge-transport solve.

A :class:gsim.tcad.Simulation is configured by physical concern, the way :class:gsim.fdtd.Simulation is: the geometry and its stack, the meshed domain, the materials, the doping, the contacts and interfaces, and the solver. Each concern is a validated model; calling it applies several settings at once, and single attributes can be assigned.

Lengths are in um, concentrations in cm^-3, frequencies in Hz and voltages in V; field names carry their unit.

Classes:

  • Contact –

    Where an electrode meets a doped Region: an ohmic contact.

  • Contacts –

    The declared contacts, by name.

  • Domain –

    The cross-section plane and the extent of the meshed 2D domain.

  • Doping –

    The doping profiles, each naming the mesh Region it applies to.

  • Geometry –

    The component and the layer stack it is extruded with.

  • Insulator –

    An insulating Region taking part in the electrostatic solve only.

  • Interface –

    Where two doped Regions meet: potential and carriers are continuous.

  • Interfaces –

    The declared interfaces between doped Regions, by name.

  • Materials –

    Semiconductor parameters and the insulators joining the solve.

  • MeshGrading –

    Element size that grows linearly with the distance from chosen features.

  • Solver –

    Mesh resolution, Newton convergence and small-signal settings.

  • TCADMesh –

    The mesh a :class:gsim.tcad.Simulation solves on.

Contact

Bases: BaseModel

Where an electrode meets a doped Region: an ohmic contact.

The curve the two Regions share becomes a named line group on the mesh, and DEVSIM drives the contact's bias there. Where the curve ends on another solved Region (an Interface, or the oxide), that Region's node touches the same metal and the contact holds it too.

Attributes:

  • name (str) –

    Contact name, also its mesh group name (e.g. "anode").

  • semiconductor (str) –

    The doped Region the contact injects into.

  • electrode (str) –

    The Region on the other side: the metal, or any Region that is neither doped nor declared insulating.

Methods:

validate_sides

validate_sides() -> Self

Require two different Regions.

Contacts

Contacts(items: Iterable[T | Mapping[str, Any]] | None = None)

Bases: _Named[Contact]

The declared contacts, by name.

Methods:

  • add –

    Declare a contact between a doped Region and its electrode.

add

add(*, name: str, semiconductor: str, electrode: str) -> Contact

Declare a contact between a doped Region and its electrode.

Domain

Bases: MutableModel

The cross-section plane and the extent of the meshed 2D domain.

Attributes:

  • plane (str | None) –

    Cross-section plane, "x=<um>" or "y=<um>".

  • window (AscendingInterval | None) –

    In-plane (min, max) clip of the domain in um (y for an x-plane, x for a y-plane); None keeps the full extent.

  • window_z (AscendingInterval | None) –

    Vertical (min, max) clip of the domain in um.

  • margin_x (float | None) –

    Airbox margin along x in um.

  • margin_y (float | None) –

    Airbox margin along y in um.

  • z_above (float | None) –

    Airbox extension above the stack top in um.

  • z_below (float | None) –

    Airbox extension below the stack bottom in um.

The four airbox fields default to None: the mesh preset decides. Setting any of them configures the airbox, the unset ones at 0 um.

Methods:

validate_plane classmethod

validate_plane(value: str | None) -> str | None

Require an x= or y= plane spec.

Doping

Doping(profiles: Iterable[DopingProfile] | None = None)

The doping profiles, each naming the mesh Region it applies to.

Methods:

  • add –

    Add a profile (see :mod:gsim.tcad.doping) and return it.

  • clear –

    Remove every profile.

  • regions –

    The doped Regions, in the order the profiles first name them.

  • remove –

    Remove one profile.

add

add(profile: DopingProfile | Mapping[str, Any]) -> DopingProfile

Add a profile (see :mod:gsim.tcad.doping) and return it.

clear

clear() -> None

Remove every profile.

regions

regions() -> list[str]

The doped Regions, in the order the profiles first name them.

remove

remove(profile: DopingProfile) -> None

Remove one profile.

Geometry

Bases: MutableModel

The component and the layer stack it is extruded with.

Attributes:

  • component (Any | None) –

    The gdsfactory component the cross-section is cut from.

  • stack (Any | None) –

    A gsim LayerStack, the path of a stack YAML file, or None to extract the stack of the active PDK.

Methods:

validate_stack classmethod

validate_stack(value: Any) -> Any

Accept a LayerStack, a YAML path, or None.

Insulator

Bases: BaseModel

An insulating Region taking part in the electrostatic solve only.

Attributes:

  • region (str) –

    Mesh region (volume group) name, e.g. "sio2".

  • relative_permittivity (float) –

    Static relative permittivity of the Region.

Interface

Bases: BaseModel

Where two doped Regions meet: potential and carriers are continuous.

An Interface carries no terminal voltage; that is what separates it from a :class:Contact.

Attributes:

  • name (str) –

    Interface name, also its mesh group name (e.g. "junction").

  • region_a (str) –

    One doped Region.

  • region_b (str) –

    The other doped Region.

Methods:

validate_sides

validate_sides() -> Self

Require two different Regions.

Interfaces

Interfaces(items: Iterable[T | Mapping[str, Any]] | None = None)

Bases: _Named[Interface]

The declared interfaces between doped Regions, by name.

Methods:

  • add –

    Declare an interface between two doped Regions.

add

add(*, name: str, region_a: str, region_b: str) -> Interface

Declare an interface between two doped Regions.

Materials

Bases: MutableModel

Semiconductor parameters and the insulators joining the solve.

Attributes:

  • temperature_k (float) –

    Lattice temperature (K) of the silicon parameter set.

  • semiconductor (str) –

    DEVSIM material name given to the doped Regions.

  • semiconductor_permittivity (float) –

    Static relative permittivity of every doped Region, at least 1. The default, 11.1, is DEVSIM's silicon value; the insulators keep their own.

  • mobility (MobilityModel) –

    Low-field mobility against the total doping, evaluated node by node. DEVSIM's own silicon defaults are two constants whatever the doping, which misstates the series resistance of a slab doped from 1e17 to 1e20 cm^-3.

  • insulators (dict[str, PositiveFloat]) –

    Insulating Regions solved for the potential alone, Region name to static relative permittivity. Empty by default, which keeps the electrostatics inside the doped semiconductor; a declared insulator lets the field fringe around the Junction through it. An :class:Insulator or a list of them is also accepted.

Methods:

coerce_insulators classmethod

coerce_insulators(value: Any) -> Any

Allow {"sio2": 3.9}, Insulator models, or a list of them.

MeshGrading

Bases: BaseModel

Element size that grows linearly with the distance from chosen features.

Native-2D cross-section meshes only. At a distance d (um) from the nearest graded feature the size is size + growth_per_um * d, capped at max_mesh_size, where size is the feature's own size. It replaces the sizing that applies to every internal curve without grading (half of refined_mesh_size on the curve, reaching max_mesh_size at max_mesh_size / 2, a growth of about 2 per um): only the chosen features refine the mesh. The conductors and junctions get refined_mesh_size itself, twice the size the ungraded mesh puts on them; halve refined_mesh_size to keep that size.

Attributes:

  • growth_per_um (float) –

    Increase of the element size per um of distance. 0.1 to 0.25 keeps the elements around small features well shaped; larger values give fewer nodes.

  • sources (tuple[GradingSource, ...]) –

    Features the size grows from:

    • "conductors": the edges of the conductors, at refined_mesh_size.
    • "junctions": the curves of the declared interfaces between two regions (a TCAD Interface, such as a metallurgical junction), at refined_mesh_size.
    • "fine_regions": each refinement box, whose own size is held inside it, and the internal edges of each layer with a numeric mesh_resolution below max_mesh_size, at that resolution. Without grading only layers finer than refined_mesh_size get their own size, since every internal curve is refined anyway.

    A feature size above max_mesh_size is held at max_mesh_size.

Methods:

unique_sources classmethod

unique_sources(sources: tuple[GradingSource, ...]) -> tuple[GradingSource, ...]

Each source is named once.

Solver

Bases: MutableModel

Mesh resolution, Newton convergence and small-signal settings.

Attributes:

  • mesh_preset (Literal['coarse', 'default', 'fine'] | None) –

    Mesh quality preset of the shared native-2D pipeline; None uses the pipeline's default.

  • refined_mesh_size_um (PositiveFloat | None) –

    Mesh size near conductors and regions marked fine (um), overriding the preset.

  • max_mesh_size_um (PositiveFloat | None) –

    Largest element size (um), overriding the preset.

  • refinement_boxes (list[RefinementBox] | None) –

    Boxes (h_min, h_max, z_min, z_max, size) in um held to size over their whole area, e.g. where a depletion edge moves.

  • mesh_grading (MeshGrading | None) –

    A :class:~gsim.palace.models.MeshGrading: the element size grows from the conductors, the declared Interfaces and the refinement boxes at a set rate per um, in place of the pipeline's fixed growth of about 2 per um from every internal curve. None (default) keeps that growth. A growth of 0.1 to 0.25 per um gives well-shaped elements in the oxide around a small device at node counts close to the default mesh, and with it the refinement boxes no longer have to be nested by hand to grade the mesh. Without grading the elements on the internal curves are half of refined_mesh_size_um; with grading the conductors and Interfaces get refined_mesh_size_um itself.

  • absolute_error (PositiveFloat) –

    Newton absolute error target of devsim.solve.

  • relative_error (PositiveFloat) –

    Newton relative error target of devsim.solve. With extended precision the 2D drift-diffusion Newton reaches 1e-12 on the test diode.

  • max_iterations (int) –

    Newton iteration cap.

  • bias_step_v (PositiveFloat) –

    Step (V) the swept contact is ramped in between biases.

  • extended_precision (bool) –

    Use DEVSIM's 128-bit extended-precision assembly. Keep it on: in double precision the Newton on the test diode does not converge even to the default 1e-6.

  • small_signal_freq_hz (PositiveFloat) –

    Frequency (Hz) of the quasi-static AC solve that extracts C(V).

  • junction_freq_hz (PositiveFloat) –

    Frequency (Hz) of the AC solve whose admittance the series-RC junction fit reads: high enough that the capacitive current dominates the DC leakage, far below the branch's own RC rolloff.

  • claim_devsim_namespace (bool) –

    Claim DEVSIM's process-global namespace at device setup: drop the circuit and the devices gsim created earlier. Foreign DEVSIM devices are never touched. Turn it off only when an earlier charge-transport device must stay alive.

TCADMesh

Bases: BaseModel

The mesh a :class:gsim.tcad.Simulation solves on.

Attributes:

  • mesh_path (Path) –

    The shared native-2D mesh (um), the one Palace BoundaryMode sees.

  • devsim_mesh_path (Path) –

    Its copy with coordinates in cm, loaded by DEVSIM.

  • groups (dict[str, Any]) –

    Physical groups of the mesh (volumes, contact lines, interface lines, shared curves).