fdtdx.PillarDiscretization#

class fdtdx.PillarDiscretization(*, axis=null, single_polymer_columns=null, distance_metric='permittivity_differences_plus_average_permittivity', background_material=None)[source]#

Bases: ParameterTransformation

Constraint module for mapping pillar structures to allowed configurations.

Maps arbitrary pillar structures to the nearest allowed configurations based on material constraints and geometry requirements. Ensures structures meet fabrication rules like single polymer columns and no trapped air holes.

Quick Reference#

Attributes

Methods

Attributes#

PillarDiscretization.axis: int#

Axis along which to enforce pillar constraints (0=x, 1=y, 2=z).

PillarDiscretization.background_material: str | None#

Name of the background material in the materials dictionary of the corresponding device. If None, the material with lowest permittivity is used. Defaults to None.

PillarDiscretization.distance_metric: Literal['euclidean', 'permittivity_differences_plus_average_permittivity']#

Method to compute distances between material distributions:

  • “euclidean”: Standard Euclidean distance between permittivity values.

  • “permittivity_differences_plus_average_permittivity”: Weighted combination of permittivity differences and average permittivity values, optimized for material distribution comparisons.

Defaults to “permittivity_differences_plus_average_permittivity”.

PillarDiscretization.single_polymer_columns: bool#

If True, restrict to single polymer columns.

Methods#

PillarDiscretization.aset(attr_name, val, create_new_ok=False)#

Sets an attribute of this class. In contrast to the classical .at[].set(), this method updates the class attribute directly and does not only operate on jax pytree leaf nodes. Instead, replaces the full attribute with the new value.

The attribute can either be the attribute name of this class, or for nested classes it can also be the attribute name of a class, which itself is an attribute of this class. The syntax for this operation could look like this: “a->b->[0]->[‘name’]”. Here, the current class has an attribute a, which has an attribute b, which is a list, which we index at index 0, which is an element of type dictionary, which we index using the dictionary key ‘name’.

Note that dictionary keys cannot contain square brackets or single quotes (even if they are escaped).

Parameters:
  • attr_name (str) – Name of attribute to set

  • val (Any) – Value to set the attribute to

  • create_new_ok (bool, optional) – If false (default), throw an error if the attribute does not exist. If true, creates a new attribute if the attribute name does not exist yet.

Returns:

Updated instance with new attribute value

Return type:

Self

PillarDiscretization.get_class_fields()#
Return type:

list[TreeClassField]

PillarDiscretization.get_input_shape(output_shape)#
Return type:

dict[str, tuple[int, ...]]

PillarDiscretization.get_output_type(input_type)#
Return type:

dict[str, ParameterType]

PillarDiscretization.get_public_fields()#
Return type:

list[TreeClassField]

PillarDiscretization.init_module(config, materials, matrix_voxel_grid_shape, single_voxel_size, output_shape)[source]#
Return type:

Self

PillarDiscretization.init_type(input_type)#
Return type:

Self

If you find any errors in the documentation, please report them in the Github Issues!