Technology¶
- class photonforge.Technology(name, version, layers, extrusion_specs, ports, background_medium, connections=())¶
Technology specifications.
- Parameters:
name (str) – Technology name.
version (str) – Technology version string.
layers (dict[str, LayerSpec]) – Layer specifications indexed by name.
extrusion_specs (Iterable[ExtrusionSpec]) – Extrusion specifications.
ports (dict[str, PortSpec]) – Port specifications indexed by name.
background_medium (MediumType | dict[Literal['optical', 'electrical'], MediumType]) – Tidy3D medium used for simulation background. Different media can be used for optical and electrical frequencies by using a dictionary (see note below).
connections (Iterable[tuple[tuple[int, int], tuple[int, int]]]) – Layer pairs that are electrically connected.
Example
>>> layers = { ... "Si": LayerSpec((1, 0), "Silicon layer", "#d2132e18", "//"), ... "Metal": LayerSpec((2, 0), "Routing metal", "#341bc618", "."), ... "Via": LayerSpec((2, 1), "Metal via", "#1bbe0818", ":"), ... } >>> 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))], ... ) ... } >>> connections = {((2, 0), (2, 1))} >>> technology = Technology( ... "Demo technology", ... "1.0", ... layers, ... extrusion_specs, ... port_specs, ... td.Medium(permittivity=1.45**2), ... connections=connections, ... )
Note
The medium used for simulations in optical and electrical frequency ranges (see
frequency_classification()
) can be set individually with:>>> media = { ... "optical": td.Medium(permittivity=1.45**2), ... "electrical": td.Medium(permittivity=4.2), ... } >>> technology = Technology( ... "Demo technology", ... "1.0", ... layers, ... extrusion_specs, ... port_specs, ... background_medium=media, ... connections=connections, ... )
See also
Methods
add_connection
(layer1, layer2)Add an electrical connection between layers to this technology.
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)Import object data from json.
get_background_medium
(classification)Return electrical or optical background medium for this technology.
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_connection
(layer1, layer2)Remove an electrical connection between layers in 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
Byte representation of this technology (read only).
Background medium.
list[tuple[tuple[int, int], tuple[int, int]]]Electrically connected layer pairs.
Extrusion specifications for this technology.
(DEPRECATED) Json representation of this layer specification.
Layer definitions for this technology.
Technology name.
Function used to update a parametric component.
Keyword arguments used to update a parametric component.
Port specifications for this technology.
Object properties.
Random variables associated to this technology's parameters.
Technology version.
- add_connection(layer1, layer2)¶
Add an electrical connection between layers to this technology.
- Parameters:
layer1 (str | tuple[int, int]) – First connected layer.
layer2 (str | tuple[int, int]) – Second connected layer.
- Returns:
This object.
- Return type:
- add_layer(layer_name, layer_spec)¶
Add a layer specification to this technology.
- Parameters:
layer_name (str) – Name of the layer specification. If one with the same name already exists, it will be replaced.
layer_spec (LayerSpec) – Specification to be added.
- Returns:
This object.
- Return type:
- add_port(port_name, port_spec)¶
Add a port specification to this technology.
- Parameters:
port_name (str) – Name of the port specification. If one with the same name already exists, it will be replaced.
port_spec (PortSpec) – Specification to be added.
- Returns:
This object.
- Return type:
- as_bytes¶
Byte representation of this technology (read only).
- Type:
bytes
- background_medium¶
Background medium.
- Type:
MediumType | dict[Literal[‘optical’, ‘electrical’], MediumType]
- connections¶
list[tuple[tuple[int, int], tuple[int, int]]]Electrically connected layer pairs.
- copy(deep=False)¶
Create a copy of this technology.
- Parameters:
deep (bool) – If set, creates copies of all extrusion specifiactions. Otherwise, only a shallow copy of this technology is created.
- Returns:
New copy.
- Return type:
- extrusion_specs¶
Extrusion specifications for this technology.
- Type:
list[ExtrusionSpec]
- static from_json(json_str)¶
Import object data from json.
Warning
This method is DEPRECATED and will be removed in the next release.
- Parameters:
json_str (str) – String containing the json data.
- Returns:
PhotonForge object.
- Return type:
Any
- get_background_medium(classification)¶
Return electrical or optical background medium for this technology.
- Parameters:
classification (Literal["electrical", "optical"]) – Classification of the desired medium.
- Returns:
Background medium.
- Return type:
MediumType
See also
- insert_extrusion_spec(index, extrusion_spec)¶
Insert an extrusion specification to this technology.
- Parameters:
index (int) – Index before which the extrusion specification will be inserted.
extrusion_spec (ExtrusionSpec) – Specification to be added.
- Returns:
This object.
- Return type:
- json¶
(DEPRECATED) Json representation of this layer specification.
- Type:
str
- static load_json(filename)¶
Load a json technology file.
Warning
This method is DEPRECATED and will be removed in the next release.
- Parameters:
filename (str) – Name of the file to load.
- Returns:
Technology instance.
- Return type:
- name¶
Technology name.
- Type:
str
- parametric_function¶
Function used to update a parametric component.
- Type:
str
- parametric_kwargs¶
Keyword arguments used to update a parametric component.
- Type:
dict[str, Any]
- pop_extrusion_spec(index=-1)¶
Remove an extrusion specification from this technology.
- Parameters:
index (int) – Index of the item to be removed.
- Returns:
Removed extrusion specification.
- Return type:
- properties¶
Object properties.
- Type:
- random_variables¶
Random variables associated to this technology’s parameters.
- Type:
list[RandomVariable]
- remove_connection(layer1, layer2)¶
Remove an electrical connection between layers in this technology.
- Parameters:
layer1 (str | tuple[int, int]) – First connected layer.
layer2 (str | tuple[int, int]) – Second connected layer.
- Returns:
This object.
- Return type:
- remove_layer(layer_name)¶
Remove a layer specification from this technology.
- Parameters:
layer_name (str) – Name of the layer to be removed.
- Returns:
This object.
- Return type:
- remove_port(port_name)¶
Remove a port specification from this technology.
- Parameters:
port_name (str) – Name of the port to be removed.
- Returns:
This object.
- Return type:
- 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.
- Return type:
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.
- Type:
str
- write_json(filename)¶
Write a json file representation of with this technology.
Warning
This method is DEPRECATED and will be removed in the next release.
- Parameters:
filename (str) – Name of the file to write.
- Returns:
This technology.
- Return type: