Technology¶
- class photonforge.Technology(name, version, layers, extrusion_specs, ports, background_medium, connections=())¶
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. Different media can be used for optical and electrical frequencies by using a dictionary (see note below).
connections – Set of 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)Create a technology object from a json string.
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.
Electrically connected layer pairs.
Extrusion specifications for this technology.
Json representation of this technology.
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.
List of
monte_carlo.RandomVariable
associated to this technology's parameters.Technology version.
- add_connection(layer1, layer2)¶
Add an electrical connection between layers to this technology.
- Parameters:
layer1 – First connected layer.
layer2 – Second connected layer.
- Returns:
This object.
- 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_spec –
LayerSpec
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_spec –
PortSpec
to be added.
- Returns:
This object.
- as_bytes¶
Byte representation of this technology (read only).
- background_medium¶
Background medium.
- connections¶
Electrically connected layer pairs.
- 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.
- get_background_medium(classification)¶
Return electrical or optical background medium for this technology.
- Parameters:
classification – One of
"electrical"
or"optical"
.- Returns:
Medium.
See also
- 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_spec –
ExtrusionSpec
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_connection(layer1, layer2)¶
Remove an electrical connection between layers in this technology.
- Parameters:
layer1 – First connected layer.
layer2 – Second connected layer.
- Returns:
This object.
- 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.