API

API#

fdtdx.apply_params(arrays, objects, params, ...)

Applies parameters to devices and updates source states.

fdtdx.ArrayContainer(fields, alpha, kappa, ...)

Container for simulation field arrays and states.

fdtdx.autoinit(klass)

Wrapper around tc.autoinit that preserves parameter requirement information

fdtdx.BinaryMedianFilterModule(*[, ...])

Performs 3D binary median filtering on the design.

fdtdx.boundary_objects_from_config(config, ...)

Creates boundary objects from a boundary configuration.

fdtdx.BoundaryConfig(*[, ...])

Configuration class for boundary conditions.

fdtdx.BrushConstraint2D(*[, brush, axis, ...])

Applies 2D brush-based constraints to ensure minimum feature sizes.

fdtdx.circular_brush(diameter[, size])

Creates a circular binary mask/brush for morphological operations.

fdtdx.ClosestIndex(*[, ...])

Maps continuous latent values to nearest allowed material indices.

fdtdx.colors.Color(r, g, b)

Color representation with multiple format support.

fdtdx.compute_energy(E, H, inv_permittivity, ...)

Computes the total electromagnetic energy density of the field.

fdtdx.compute_mode(frequency, ...[, ...])

Compute optical modes of a waveguide cross-section.

fdtdx.compute_poynting_flux(E, H[, axis])

Calculates the Poynting vector (energy flux) from E and H fields.

fdtdx.ConnectHolesAndStructures(*[, ...])

Connects floating polymer regions and ensures air holes connect to outside.

fdtdx.CustomTimeSignalProfile(*[, signal, ...])

Sampled waveform temporal profile for arbitrary time signals.

fdtdx.Cylinder(*[, partial_real_shape, ...])

A cylindrical optical fiber with configurable properties.

fdtdx.Detector(*[, partial_real_shape, ...])

Base class for electromagnetic field detectors in FDTD simulations.

fdtdx.Device(*[, partial_real_shape, ...])

Abstract base class for devices with optimizable permittivity distributions.

fdtdx.DiagonalSymmetry2D(*[, min_min_to_max_max])

Enforce diagonal symmetry by effectively halving the parameter space.

fdtdx.DtypeConversion(*[, dtype, exclude_filter])

Compression module that converts data types of field values.

fdtdx.EnergyDetector(*[, ...])

Detector for measuring electromagnetic energy distribution.

fdtdx.export_arrays_snapshot_to_vti(arrays, ...)

Convenience function to export a snapshot of FDTD simulation arrays to a VTI file.

fdtdx.export_json(obj)

Create a dictionary from the given object for exporting to JSON.

fdtdx.export_json_str(obj)

Create a json string from the given object.

fdtdx.export_stl(matrix[, stl_filename, ...])

Export a 3D boolean matrix to an STL file.

fdtdx.export_vti(cell_data, filename, resolution)

Export a dictionary of arrays to a VTI (VTK ImageData) file.

fdtdx.ExtrudedPolygon(*[, ...])

A polygon object specified by a list of vertices.

fdtdx.field(*[, default, init, repr, kind, ...])

A wrapper for pytreeclass fields.

fdtdx.FieldDetector(*[, partial_real_shape, ...])

Detector for measuring field components of electromagnetic fields in the time domain.

fdtdx.frozen_field(*[, default, init, repr, ...])

Creates a field that automatically freezes on set and unfreezes on get.

fdtdx.frozen_private_field(*[, default, ...])

Creates a field that automatically freezes on set and unfreezes on get, sets the default to None and init to False.

fdtdx.full_backward(state, objects, config, ...)

Perform full backward FDTD propagation from current state to start time.

fdtdx.GaussianPlaneSource([...])

fdtdx.GaussianPulseProfile(*[, ...])

Gaussian pulse temporal profile with carrier wave.

fdtdx.GaussianSmoothing2D(*[, std_discrete, ...])

Applies Gaussian smoothing to 2D parameter arrays.

fdtdx.GradientConfig(*[, method, recorder, ...])

Configuration for gradient computation in simulations.

fdtdx.GridCoordinateConstraint(*, object, ...)

Constrains an object's position to specific grid coordinates.

fdtdx.import_from_json(json_str)

fdtdx.LinearReconstructEveryK(*[, k, ...])

Time step filter that performs linear reconstruction between sampled steps.

fdtdx.Logger(experiment_name[, name, ...])

Logger for managing experiment outputs and visualization.

fdtdx.Material(*[, permittivity, ...])

Represents an electromagnetic material with specific electrical and magnetic properties.

fdtdx.metric_efficiency(detector_states, ...)

Calculate efficiency metrics between input and output detectors.

fdtdx.ModeOverlapDetector(*[, ...])

Detector for measuring the overlap of a waveguide mode with the simulation fields.

fdtdx.ModePlaneSource([temporal_profile, ...])

fdtdx.normalize_by_energy(E, H, ...)

Normalizes electromagnetic fields by their total energy.

fdtdx.normalize_by_poynting_flux(E, H, axis)

Normalize fields so the integrated Poynting flux along axis is one.

fdtdx.ObjectContainer(object_list, *[, ...])

Container for managing simulation objects and their relationships.

fdtdx.OnOffSwitch(*[, start_time, ...])

fdtdx.ParameterTransformation()

fdtdx.PerfectlyMatchedLayer(*[, ...])

Implements a Convolutional Perfectly Matched Layer (CPML) boundary condition.

fdtdx.PeriodicBoundary

alias of BlochBoundary

fdtdx.PhasorDetector(*[, ...])

Detector for measuring frequency components of electromagnetic fields using an efficient Phasor Implementation.

fdtdx.PillarDiscretization(*[, axis, ...])

Constraint module for mapping pillar structures to allowed configurations.

fdtdx.place_objects(object_list, config, ...)

Places simulation objects according to specified constraints and initializes containers.

fdtdx.plot_setup(config, objects[, ...])

Creates a visualization of the simulation setup showing objects in XY, XZ and YZ planes.

fdtdx.plot_setup_from_side(config, objects, ...)

Creates a visualization of the simulation setup from a single viewing side.

fdtdx.plot_setup_from_side(config, objects, ...)

Creates a visualization of the simulation setup from a single viewing side.

fdtdx.plot_material_from_side(config, ...[, ...])

Creates a visualization of material distribution from a single viewing side.

fdtdx.plot_material(config, arrays[, ...])

Creates a visualization of material distribution showing slices in XY, XZ and YZ planes.

fdtdx.plot_field_slice_component(field, ...)

Plots a single component of the electromagnetic field.

fdtdx.plot_field_slice(E, H[, filename, ...])

Creates a visualization of electromagnetic field components.

fdtdx.PositionConstraint(*, object, ...)

Defines a positional relationship between two simulation objects.

fdtdx.PoyntingFluxDetector(*[, ...])

Detector for measuring Poynting flux in electromagnetic simulations.

fdtdx.private_field(*[, default, init, ...])

Creates a field that sets the default to None and init to False.

fdtdx.RealCoordinateConstraint(*, object, ...)

Constrains an object's position to specific real-space coordinates.

fdtdx.Recorder(modules)

Records and compresses simulation data over time using a sequence of processing modules.

fdtdx.RecordingState(data, state)

Container for simulation recording state data.

fdtdx.RemoveFloatingMaterial(*[, ...])

Finds all material that floats in the air and sets their permittivity to air.

fdtdx.run_fdtd(arrays, objects, config, key)

fdtdx.resolve_object_constraints(objects, ...)

Resolve object constraints into grid slices and shapes.

fdtdx.SimulationConfig(*[, time, grid, ...])

Configuration settings for FDTD simulations.

fdtdx.SimulationObject(*[, ...])

Abstract base class for objects in a 3D simulation environment.

fdtdx.SimulationState

Built-in immutable sequence.

fdtdx.SimulationVolume(*[, ...])

Background material for the entire simulation volume.

fdtdx.SingleFrequencyProfile([...])

Simple sinusoidal temporal profile at a single frequency.

fdtdx.SizeConstraint(*, object, ...)

Defines a size relationship between two simulation objects.

fdtdx.SizeExtensionConstraint(*, object, ...)

Defines how an object extends toward another object or boundary.

fdtdx.Sphere(*[, partial_real_position, ...])

A sphere or ellipsoid object with configurable properties.

fdtdx.StandardToCustomRange(*[, min_value, ...])

Maps standard [0,1] range to custom range [min_value, max_value].

fdtdx.StandardToInversePermittivityRange()

Maps standard [0,1] range to inverse permittivity range.

fdtdx.StandardToPlusOneMinusOneRange()

Maps standard [0,1] range to [-1,1] range.

fdtdx.SubpixelSmoothedProjection(*[, ...])

This function is adapted from the Meep repository: NanoComp/meep

fdtdx.TanhProjection(*[, projection_midpoint])

Tanh projection filter.

fdtdx.TemporalProfile()

Base class for temporal profiles of sources.

fdtdx.TreeClass(*a, **k)

Extended tree class with improved attribute setting functionality.

fdtdx.UniformMaterialObject(*[, ...])

fdtdx.UniformPlaneSource([temporal_profile, ...])

fdtdx.WaveCharacter(*[, phase_shift, ...])

Class describing a wavelength/period/frequency in free space.

fdtdx.wavelength_to_period(wavelength)

Convert wavelength to time period using speed of light.