Technology

class photonforge.Technology(name, version, layers, extrusion_specs, ports, background_medium)

Technology specifications.

Parameters:
  • name – Technology name.

  • version – Technology version string.

  • layers – Dictionary of LayerSpec instances indexed by name.

  • extrusion_specs – Iterable of extrusion specifications.

  • ports – Dictionary of PortSpec instances indexed by name.

  • background_medium – Tidy3D medium used for simulation background.

Example

>>> layers = {
...     "Si": LayerSpec((1, 0), "Silicon layer", "#d2132e18", "//")
... }
>>> extrusion_specs = [
...     ExtrusionSpec(
...         MaskSpec((1, 0)),
...         td.Medium(permittivity=3.48**2),
...         (0, 0.250),
...     )
... ]
>>> port_specs = {
...     "STE": PortSpec(
...         "Single mode strip",
...         1.5,
...         (-0.5, 0.75),
...         target_neff=3.48,
...         path_profiles=[(0.45, 0, (1, 0))],
...     )
... }
>>> technology = Technology(
...     "Demo technology",
...     "1.0",
...     layers,
...     extrusion_specs,
...     port_specs,
...     td.Medium(permittivity=1.45**2),
... )

Methods

add_layer(layer_name, layer_spec)

Add a layer specification to this technology.

add_port(port_name, port_spec)

Add a port specification to this technology.

copy([deep])

Create a copy of this technology.

from_json(json_str)

Create a technology object from a json string.

insert_extrusion_spec(index, extrusion_spec)

Insert an extrusion specification to this technology.

load_json(filename)

Load a json technology file.

pop_extrusion_spec([index])

Remove an extrusion specification from this technology.

remove_layer(layer_name)

Remove a layer specification from this technology.

remove_port(port_name)

Remove a port specification from this technology.

update(*args, **kwargs)

Update this technology if it was created as a parametric technology.

write_json(filename)

Write a json file representation of with this technology.

Attributes

as_bytes

Byte representation of this technology (read only).

background_medium

Background medium.

extrusion_specs

Extrusion specifications for this technology.

json

Json representation of this technology.

layers

Layer definitions for this technology.

name

Technology name.

parametric_function

Function used to update a parametric component.

parametric_kwargs

Keyword arguments used to update a parametric component.

ports

Port specifications for this technology.

random_variables

List of monte_carlo.RandomVariable associated to this technology's parameters.

version

Technology version.

add_layer(layer_name, layer_spec)

Add a layer specification to this technology.

Parameters:
  • layer_name – Name of the layer specification. If one with the same name already exists, it will be replaced.

  • layer_specLayerSpec to be added.

Returns:

This object.

add_port(port_name, port_spec)

Add a port specification to this technology.

Parameters:
  • port_name – Name of the port specification. If one with the same name already exists, it will be replaced.

  • port_specPortSpec to be added.

Returns:

This object.

as_bytes

Byte representation of this technology (read only).

background_medium

Background medium.

copy(deep=False)

Create a copy of this technology.

Parameters:

deep – If set, creates copies of all extrusion specifiactions. Otherwise, only a shallow copy of this technology is created.

Returns:

New copy.

extrusion_specs

Extrusion specifications for this technology.

static from_json(json_str)

Create a technology object from a json string.

Parameters:

json_str – Strig containing the json data.

Returns:

Technology instance.

insert_extrusion_spec(index, extrusion_spec)

Insert an extrusion specification to this technology.

Parameters:
  • index – Index before which the extrusion specification will be inserted.

  • extrusion_specExtrusionSpec to be added.

Returns:

This object.

json

Json representation of this technology.

layers

Layer definitions for this technology.

static load_json(filename)

Load a json technology file.

Parameters:

filename – Name of the file to load.

Returns:

Technology instance.

name

Technology name.

parametric_function

Function used to update a parametric component.

parametric_kwargs

Keyword arguments used to update a parametric component.

pop_extrusion_spec(index=-1)

Remove an extrusion specification from this technology.

Parameters:

index – Index of the item to be removed.

Returns:

Removed extrusion specification.

ports

Port specifications for this technology.

random_variables

List of monte_carlo.RandomVariable associated to this technology’s parameters.

remove_layer(layer_name)

Remove a layer specification from this technology.

Parameters:

layer_name – Name of the layer to be removed.

Returns:

This object.

remove_port(port_name)

Remove a port specification from this technology.

Parameters:

port_name – Name of the port to be removed.

Returns:

This object.

update(*args, **kwargs)

Update this technology if it was created as a parametric technology.

All contents of the technology are updated with the contents from the updated version. Any contents or modifications introduced after the technology creation (outside of the original parametric function) are not propagated.

Parameters:
  • *args – Positional arguments to the parametric technology function.

  • **kwargs – Keyword arguments to the parametric technology function.

Returns:

This technology.

Note

The original keyword arguments used to generate the technology are stored and updated with the passed kwargs. This updated version is used in the function call and will be stored for future updates. Positional arguments are not stored.

version

Technology version.

write_json(filename)

Write a json file representation of with this technology.

Parameters:

filename – Name of the file to write.

Returns:

This technology.