API

API#

fdtdx.apply_params(arrays, objects, params)

Applies parameters to devices and updates source states.

fdtdx.ArrayContainer(fields, ...[, ...])

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.BlochBoundary(*[, partial_real_shape, ...])

Implements Bloch periodic boundary conditions.

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.calculate_sparam(objects, arrays, ...)

Run the FDTD simulation and extract S-parameters from mode-overlap detectors.

fdtdx.calculate_sparams(objects, arrays, ...)

Run FDTD simulations for multiple input ports and merge S-parameters.

fdtdx.CCPRPole(*[, pole, residue])

General complex-conjugate pole-residue (CCPR) pole.

fdtdx.circular_brush(diameter[, size])

Creates a circular binary mask/brush for morphological operations.

fdtdx.ClosedSurfacePhasorPoyntingFluxDetector([...])

Net time-averaged Poynting flux through a closed box surface (frequency domain).

fdtdx.ClosedSurfacePoyntingFluxDetector([...])

Net Poynting flux through the closed surface of a rectangular box.

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

Maps continuous latent values to nearest allowed material indices.

fdtdx.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_eps_spectrum_from_coefficients(c1, ...)

Spatially-averaged complex permittivity spectrum for a block of cells.

fdtdx.compute_impedance_corrected_temporal_profile(...)

FIR-filter a raw source temporal profile for broadband impedance matching.

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

Computes the integrated power (Poynting flux) across a transverse plane.

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

Compute optical modes of a waveguide cross-section.

fdtdx.compute_pole_coefficients(poles, dt)

Compute the discrete-time ADE recurrence coefficients of isotropic poles.

fdtdx.compute_pole_coefficients_per_axis(...)

Compute the per-axis discrete-time ADE recurrence coefficients.

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([_signed_data, ...])

Base class for electromagnetic field detectors in FDTD simulations.

fdtdx.DetectorState

maps detector output names to JAX arrays.

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.DiagonalSymmetry3D(*[, ...])

Enforce diagonal symmetry in 3D across one of six possible diagonal planes.

fdtdx.DispersionModel(*[, poles])

Linear susceptibility built from a sum of 2nd-order ADE poles.

fdtdx.DrudePole(*[, plasma_frequency, damping])

Drude pole parameterised by its physical constants.

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

Compression module that converts data types of field values.

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

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.export_vtr(cell_data, filename, grid)

Export cell data to a VTR (VTK RectilinearGrid) file.

fdtdx.extend_material_to_pml(objects, arrays)

Extend interior-edge material values into each PML region.

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

A polygon object specified by a list of vertices.

fdtdx.extruded_polygon_from_gds(lib, ...[, ...])

Create an ExtrudedPolygon from a polygon in an already-loaded gdstk Library.

fdtdx.extruded_polygon_from_gds_path(...[, ...])

Create an ExtrudedPolygon from a polygon in a GDS file.

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

A wrapper for pytreeclass fields.

fdtdx.FieldDetector([_signed_data, ...])

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

fdtdx.FieldProjectionAngleDetector([...])

Frequency-domain detector for projecting a phasor plane to observation angles.

fdtdx.FieldProjectionCartesianDetector([...])

Frequency-domain detector for projecting phasors to a Cartesian observation plane.

fdtdx.FieldProjectionKSpaceDetector([...])

Frequency-domain detector for projecting phasors to a k-space direction grid.

fdtdx.FieldState(E, H, psi_E, psi_H[, ...])

Dynamic electromagnetic field state that evolves each time step.

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.HorizontalSymmetry2D()

Enforce horizontal (x-axis) mirror symmetry.

fdtdx.HorizontalSymmetry3D(*[, mirror_axis])

Enforce horizontal mirror symmetry in 3D along the x or y axis.

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.LorentzPole(*[, resonance_frequency, ...])

Lorentz pole parameterised by its physical constants.

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([_signed_data, ...])

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.ParameterContainer

Type alias for parameter dictionaries.

fdtdx.ParameterTransformation()

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

Implements perfect electric conductor (PEC) boundary conditions.

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

Implements perfect magnetic conductor (PMC) boundary conditions.

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

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

fdtdx.PeriodicBoundary

alias of BlochBoundary

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

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

fdtdx.PhasorPoyntingFluxDetector([...])

Time-averaged Poynting flux through a single plane in the frequency domain.

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_field_slice(E, H[, filename, ...])

Creates a visualization of electromagnetic field components.

fdtdx.plot_field_slice_component(field, ...)

Plots a single component of the electromagnetic field.

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

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

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

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

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.PointDipoleSource([temporal_profile, ...])

Soft point dipole source (electric or magnetic).

fdtdx.PointSymmetry2D()

Enforce 180-degree rotational (point) symmetry.

fdtdx.PointSymmetry3D()

Enforce 180-degree rotational (point) symmetry in 3D.

fdtdx.Pole()

Abstract base class for a single 2nd-order ADE pole.

fdtdx.PortSpec(center, axis, direction, ...)

Specification for a simulation port (input source or output detector).

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

Defines a positional relationship between two simulation objects.

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

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.QuasiUniformGrid(*[, dx, dy, dz, center])

Unresolved policy for a rectilinear grid with independent per-axis spacings.

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.RectilinearGrid(*[, x_edges, y_edges, ...])

Realized rectilinear simulation grid described by physical cell edges.

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

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

fdtdx.resolve_object_constraints(objects, ...)

Resolve object constraints into grid slices and shapes.

fdtdx.run_fdtd(arrays, objects, config[, ...])

fdtdx.setup_sparams_simulation(polygons, ...)

Set up an FDTD simulation scene for S-parameter extraction.

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

Configuration settings for FDTD simulations.

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

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

fdtdx.SimulationState

a tuple of (time_step, ArrayContainer).

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.TFSFPlaneSourceRegion([...])

Total-Field/Scattered-Field (TFSF) box source.

fdtdx.TreeClass(*a, **k)

Extended tree class with improved attribute setting functionality.

fdtdx.unfold_array(arr, symmetry, spatial_axes)

Mirror-and-concatenate a spatial array along each symmetric axis.

fdtdx.unfold_detector_states(arrays, ...)

Reconstruct full-domain detector states from a symmetry-reduced simulation.

fdtdx.unfold_fields(field, symmetry, field_type)

Reconstruct a full-domain (3, Nx, Ny, Nz) field array from the reduced field.

fdtdx.unfold_source_mode(source, config)

Reconstruct the full-domain (E, H) mode profile a mode source injects.

fdtdx.UniformGrid(*[, spacing, center])

Unresolved policy for a uniform rectilinear grid.

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

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

fdtdx.VerticalSymmetry2D()

Enforce vertical (y-axis) mirror symmetry.

fdtdx.VerticalSymmetry3D()

Enforce vertical (z-axis) mirror symmetry in 3D.

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.

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

A simulation object built from a set of GDS polygons extruded along one axis.

fdtdx.GDSLayerSpec(gds_layer, material_name, ...)

Specification for a single GDS layer to be imported as a simulation object.

fdtdx.GDSPortSpec(gds_layer[, gds_datatype, ...])

Specification for a GDS port marker layer used to auto-generate sources or detectors.

fdtdx.detectors_from_gds_ports(gds_source, ...)

Create ModeOverlapDetector objects from GDS port markers.

fdtdx.gds_layer_stack(gds_source, cell_name, ...)

Build simulation objects from a GDS file according to a layer stack specification.

fdtdx.gds_layer_stack_from_component(...[, ...])

Build a layer stack from a gdsfactory Component.

fdtdx.sources_from_gds_ports(gds_source, ...)

Create ModePlaneSource objects from GDS port markers.