API πŸ’»#

Simulation#

tidy3d.Simulation

Custom implementation of Maxwell’s equations which represents the physical model to be solved using the FDTD method.

Boundary Conditions#

tidy3d.BoundarySpec

Specifies boundary conditions on each side of the domain and along each dimension.

tidy3d.Boundary

Boundary conditions at the minus and plus extents along a dimension.

tidy3d.BoundaryEdge

Electromagnetic boundary condition at a domain edge.

Types of Boundaries#

tidy3d.Periodic

Periodic boundary condition class.

tidy3d.PECBoundary

Perfect electric conductor boundary condition class.

tidy3d.PMCBoundary

Perfect magnetic conductor boundary condition class.

tidy3d.BlochBoundary

Specifies a Bloch boundary condition along a single dimension.

Absorbing Boundaries#

Types of Absorbers#

tidy3d.PML

Specifies a standard PML along a single dimension.

tidy3d.StablePML

Specifies a 'stable' PML along a single dimension.

tidy3d.Absorber

Specifies an adiabatic absorber along a single dimension.

Absorber Parameters#

tidy3d.AbsorberParams

Specifies parameters common to Absorbers and PMLs.

tidy3d.PMLParams

Specifies full set of parameters needed for complex, frequency-shifted PML.

Geometry#

tidy3d.Box

Rectangular prism.

tidy3d.Sphere

Spherical geometry.

tidy3d.Cylinder

Cylindrical geometry with optional sidewall angle along axis direction.

tidy3d.PolySlab

Polygon extruded with optional sidewall angle along axis direction.

tidy3d.TriangleMesh

Custom surface geometry given by a triangle mesh, as in the STL file format.

tidy3d.GeometryGroup

A collection of Geometry objects that can be called as a single geometry object.

tidy3d.ClipOperation

Class representing the result of a set operation between geometries.

Transformations#

tidy3d.RotationAroundAxis

Rotation of vectors and tensors around a given vector.

Mediums#

Non-Dispersive Medium#

Spatially uniform#

tidy3d.Medium

Dispersionless medium.

tidy3d.PECMedium

Perfect electrical conductor class.

tidy3d.FullyAnisotropicMedium

Fully anisotropic medium including all 9 components of the permittivity and conductivity tensors.

Spatially varying#

tidy3d.CustomMedium

Medium with user-supplied permittivity distribution.

Dispersive Mediums#

Spatially uniform#

tidy3d.PoleResidue

A dispersive medium described by the pole-residue pair model.

tidy3d.Lorentz

A dispersive medium described by the Lorentz model.

tidy3d.Sellmeier

A dispersive medium described by the Sellmeier model.

tidy3d.Drude

A dispersive medium described by the Drude model.

tidy3d.Debye

A dispersive medium described by the Debye model.

Spatially varying#

tidy3d.CustomPoleResidue

A spatially varying dispersive medium described by the pole-residue pair model.

tidy3d.CustomLorentz

A spatially varying dispersive medium described by the Lorentz model.

tidy3d.CustomSellmeier

A spatially varying dispersive medium described by the Sellmeier model.

tidy3d.CustomDrude

A spatially varying dispersive medium described by the Drude model.

tidy3d.CustomDebye

A spatially varying dispersive medium described by the Debye model.

General Mediums (can be both dispersive and non-dispersive)#

Spatially uniform#

tidy3d.AnisotropicMedium

Diagonally anisotropic medium.

tidy3d.Medium2D

2D diagonally anisotropic medium.

Spatially varying#

tidy3d.CustomAnisotropicMedium

Diagonally anisotropic medium with spatially varying permittivity in each component.

Medium Specifications (add properties to existing Medium)#

Nonlinear#

tidy3d.NonlinearSpec

Abstract specification for adding nonlinearities to a medium.

tidy3d.NonlinearSusceptibility

Model for an instantaneous nonlinear chi3 susceptibility.

tidy3d.KerrNonlinearity

Model for Kerr nonlinearity which gives an intensity-dependent refractive index of the form \(n = n_0 + n_2 I\).

tidy3d.TwoPhotonAbsorption

Model for two-photon absorption (TPA) nonlinearity which gives an intensity-dependent absorption of the form \(\alpha = \alpha_0 + \beta I\).

Time Modulation#

tidy3d.ModulationSpec

Specification adding space-time modulation to the non-dispersive part of medium including relative permittivity at infinite frequency and electric conductivity.

tidy3d.SpaceTimeModulation

Space-time modulation applied to a medium, adding on top of the time-independent part.

tidy3d.ContinuousWaveTimeModulation

Class describing modulation with a harmonic time dependence.

tidy3d.SpaceModulation

The modulation profile with a user-supplied spatial distribution of amplitude and phase.

Material Library#

Structures#

tidy3d.Structure

Defines a physical object that interacts with the electromagnetic fields.

tidy3d.MeshOverrideStructure

Defines an object that is only used in the process of generating the mesh.

Sources#

Types of Sources#

tidy3d.PointDipole

Uniform current source with a zero size.

tidy3d.UniformCurrentSource

Source in a rectangular volume with uniform time dependence.

tidy3d.PlaneWave

Uniform current distribution on an infinite extent plane.

tidy3d.ModeSource

Injects current source to excite modal profile on finite extent plane.

tidy3d.GaussianBeam

Gaussian distribution on finite extent plane.

tidy3d.AstigmaticGaussianBeam

The simple astigmatic Gaussian distribution allows both an elliptical intensity profile and different waist locations for the two principal axes of the ellipse.

tidy3d.CustomFieldSource

Implements a source corresponding to an input dataset containing E and H fields, using the equivalence principle to define the actual injected currents.

tidy3d.CustomCurrentSource

Implements a source corresponding to an input dataset containing E and H fields.

tidy3d.TFSF

Total-field scattered-field (TFSF) source that can inject a plane wave in a finite region.

Source Time Dependence#

tidy3d.GaussianPulse

Source time dependence that describes a Gaussian pulse.

tidy3d.ContinuousWave

Source time dependence that ramps up to continuous oscillation and holds until end of simulation.

tidy3d.CustomSourceTime

Custom source time dependence consisting of a real or complex envelope modulated at a central frequency, as shown below.

Monitors#

Monitor Types#

tidy3d.FieldMonitor

Monitor that records electromagnetic fields in the frequency domain.

tidy3d.FieldTimeMonitor

Monitor that records electromagnetic fields in the time domain.

tidy3d.FluxMonitor

Monitor that records power flux in the frequency domain.

tidy3d.FluxTimeMonitor

Monitor that records power flux in the time domain.

tidy3d.ModeMonitor

Monitor that records amplitudes from modal decomposition of fields on plane.

tidy3d.ModeSolverMonitor

Monitor that stores the mode field profiles returned by the mode solver in the monitor plane.

tidy3d.PermittivityMonitor

Monitor that records the diagonal components of the complex-valued relative permittivity tensor in the frequency domain.

tidy3d.FieldProjectionCartesianMonitor

Monitor that samples electromagnetic near fields in the frequency domain and projects them on a Cartesian observation plane.

tidy3d.FieldProjectionAngleMonitor

Monitor that samples electromagnetic near fields in the frequency domain and projects them at given observation angles.

tidy3d.FieldProjectionKSpaceMonitor

Monitor that samples electromagnetic near fields in the frequency domain and projects them on an observation plane defined in k-space.

tidy3d.DiffractionMonitor

Monitor that uses a 2D Fourier transform to compute the diffraction amplitudes and efficiency for allowed diffraction orders.

Apodization Specification#

tidy3d.ApodizationSpec

Stores specifications for the apodizaton of frequency-domain monitors.

Mode Specifications#

tidy3d.ModeSpec

Stores specifications for the mode solver to find an electromagntic mode.

Discretization#

tidy3d.GridSpec

Collective grid specification for all three dimensions.

tidy3d.AutoGrid

Specification for non-uniform grid along a given dimension.

tidy3d.UniformGrid

Uniform 1D grid.

tidy3d.CustomGrid

Custom 1D grid supplied as a list of grid cell sizes centered on the simulation center.

tidy3d.Coords

Holds data about a set of x,y,z positions on a grid.

tidy3d.FieldGrid

Holds the grid data for a single field.

tidy3d.YeeGrid

Holds the yee grid coordinates for each of the E and H positions.

tidy3d.Grid

Contains all information about the spatial positions of the FDTD grid.

Output Data#

All Data for a Simulation#

tidy3d.SimulationData

Stores data from a collection of Monitor objects in a Simulation.

Collections of Data from single monitor#

tidy3d.FieldData

Data associated with a FieldMonitor: scalar components of E and H fields.

tidy3d.FieldTimeData

Data associated with a FieldTimeMonitor: scalar components of E and H fields.

tidy3d.ModeSolverData

Data associated with a ModeSolverMonitor: scalar components of E and H fields.

tidy3d.PermittivityData

Data for a PermittivityMonitor: diagonal components of the permittivity tensor.

tidy3d.FluxData

Data associated with a FluxMonitor: flux data in the frequency-domain.

tidy3d.FluxTimeData

Data associated with a FluxTimeMonitor: flux data in the time-domain.

tidy3d.ModeData

Data associated with a ModeMonitor: modal amplitudes and propagation indices.

tidy3d.FieldProjectionAngleData

Data associated with a FieldProjectionAngleMonitor: components of projected fields.

tidy3d.FieldProjectionCartesianData

Data associated with a FieldProjectionCartesianMonitor: components of projected fields.

tidy3d.FieldProjectionKSpaceData

Data associated with a FieldProjectionKSpaceMonitor: components of projected fields.

tidy3d.DiffractionData

Data for a DiffractionMonitor: complex components of diffracted far fields.

Individual Datasets#

tidy3d.SpatialDataArray

Spatial distribution.

tidy3d.PermittivityDataset

Dataset storing the diagonal components of the permittivity tensor.

tidy3d.ScalarFieldDataArray

Spatial distribution in the frequency-domain.

tidy3d.ScalarModeFieldDataArray

Spatial distribution of a mode in frequency-domain as a function of mode index.

tidy3d.ScalarFieldTimeDataArray

Spatial distribution in the time-domain.

tidy3d.ModeAmpsDataArray

Forward and backward propagating complex-valued mode amplitudes.

tidy3d.ModeIndexDataArray

Complex-valued effective propagation index of a mode.

tidy3d.FluxDataArray

Flux through a surface in the frequency-domain.

tidy3d.FluxTimeDataArray

Flux through a surface in the time-domain.

tidy3d.FieldProjectionAngleDataArray

Far fields in frequency domain as a function of angles theta and phi.

tidy3d.FieldProjectionCartesianDataArray

Far fields in frequency domain as a function of local x and y coordinates.

tidy3d.FieldProjectionKSpaceDataArray

Far fields in frequency domain as a function of normalized kx and ky vectors on the observation plane.

tidy3d.DiffractionDataArray

Diffraction power amplitudes as a function of diffraction orders and frequency.

Scene#

Scene

Contains generic information about the geometry and medium properties common to all types of simulations.

Logging#

tidy3d.log

Custom logger to avoid the complexities of the logging module

tidy3d.set_logging_level(level)

Raise a warning here instead of setting the logging level.

tidy3d.set_logging_file(fname[,Β filemode,Β level])

Set a file to write log to, independently from the stdout and stderr output chosen using set_logging_level().

Submitting Simulations#

Through python API#

tidy3d.web.api.webapi.run(simulation,Β task_name)

Submits a Simulation to server, starts running, monitors progress, downloads, and loads results as a SimulationDataType object.

tidy3d.web.api.webapi.upload(simulation,Β ...)

Upload simulation to server, but do not start running Simulation.

tidy3d.web.api.webapi.estimate_cost(task_id)

Compute the maximum FlexCredit charge for a given task.

tidy3d.web.api.webapi.real_cost(task_id[,Β ...])

Get the billed cost for given task after it has been run.

tidy3d.web.api.webapi.get_info(task_id[,Β ...])

Return information about a task.

tidy3d.web.api.webapi.start(task_id[,Β ...])

Start running the simulation associated with task.

tidy3d.web.api.webapi.monitor(task_id[,Β verbose])

Print the real time task progress until completion.

tidy3d.web.api.webapi.download(task_id[,Β ...])

Download results of task to file.

tidy3d.web.api.webapi.load(task_id[,Β path,Β ...])

Download and Load simulation results into SimulationData object.

tidy3d.web.api.webapi.delete(task_id)

Delete server-side data associated with task.

tidy3d.web.api.webapi.download_log(task_id)

Download the tidy3d log file associated with a task.

tidy3d.web.api.webapi.download_json(task_id)

Download the .json file associated with the Simulation of a given task.

tidy3d.web.api.webapi.load_simulation(task_id)

Download the .json file of a task and load the associated simulation.

Convenience for Single and Batch#

tidy3d.web.api.container.Job

Interface for managing the running of a Simulation on server.

tidy3d.web.api.container.Batch

Interface for submitting several Simulation objects to sever.

tidy3d.web.api.container.BatchData

Holds a collection of SimulationData returned by Batch.

Information Containers#

tidy3d.web.core.task_info.TaskInfo

General information about task.

tidy3d.web.core.task_info.TaskStatus

The statuses that the task can be in.

HEAT πŸ”₯#

Simulation#

tidy3d.HeatSimulation

Contains all information about heat simulation.

Material Thermal Specification#

tidy3d.FluidSpec

Fluid medium.

tidy3d.SolidSpec

Solid medium.

Thermal Boundary Conditions#

tidy3d.HeatBoundarySpec

Heat boundary conditions specification.

tidy3d.TemperatureBC

Constant temperature thermal boundary conditions.

tidy3d.ConvectionBC

Convective thermal boundary conditions.

tidy3d.HeatFluxBC

Constant flux thermal boundary conditions.

tidy3d.StructureStructureInterface

Placement of boundary conditions between two structures.

tidy3d.StructureBoundary

Placement of boundary conditions on the structure's boundary.

tidy3d.MediumMediumInterface

Placement of boundary conditions between two mediums.

tidy3d.StructureSimulationBoundary

Placement of boundary conditions on the simulation box boundary covered by the structure.

tidy3d.SimulationBoundary

Placement of boundary conditions on the simulation box boundary.

Thermal Sources#

tidy3d.UniformHeatSource

Volumetric heat source.

Grid Specification#

tidy3d.UniformUnstructuredGrid

Uniform grid.

tidy3d.DistanceUnstructuredGrid

Adaptive grid based on distance to material interfaces.

Monitors#

tidy3d.TemperatureMonitor

Temperature monitor.

Output Data#

Monitor Data#

tidy3d.TemperatureData

Data associated with a TemperatureMonitor: spatial temperature field.

Heat Simulation Data#

tidy3d.HeatSimulationData

Stores results of a heat simulation.

Plugins#

Mode Solver#

tidy3d.plugins.mode.ModeSolver

Interface for solving electromagnetic eigenmodes in a 2D plane with translational invariance in the third dimension.

tidy3d.plugins.mode.ModeSolverData

Data associated with a ModeSolverMonitor: scalar components of E and H fields.

Dispersive Model Fitting#

tidy3d.plugins.dispersion.FastDispersionFitter

Tool for fitting refractive index data to get a dispersive medium described by PoleResidue model.

tidy3d.plugins.dispersion.AdvancedFastFitterParam

Advanced fast fitter parameters.

tidy3d.plugins.dispersion.DispersionFitter

Tool for fitting refractive index data to get a dispersive medium described by PoleResidue model.

tidy3d.plugins.dispersion.AdvancedFitterParam

Advanced fitter parameters

tidy3d.plugins.dispersion.web.run(fitter[,Β ...])

Execute the data fit using the stable fitter in the server.

tidy3d.plugins.dispersion.StableDispersionFitter

Deprecated.

Self-intersecting Polyslab#

tidy3d.plugins.polyslab.ComplexPolySlab

Interface for dividing a complex polyslab where self-intersecting polygon can occur during extrusion.

Scattering Matrix Calculator#

tidy3d.plugins.smatrix.ComponentModeler

Tool for modeling devices and computing scattering matrix elements.

tidy3d.plugins.smatrix.Port

Specifies a port in the scattering matrix.

tidy3d.plugins.smatrix.SMatrixDataArray

Scattering matrix elements.

Resonance Finder#

tidy3d.plugins.resonance.ResonanceFinder

Tool that extracts resonance information from a time series of the form shown below.

Adjoint#

tidy3d.plugins.adjoint.web.run

Submits a JaxSimulation to server, starts running, monitors progress, downloads, and loads results as a JaxSimulationData object.

tidy3d.plugins.adjoint.web.run_async

Submits a set of JaxSimulation objects to server, starts running, monitors progress, downloads, and loads results as a tuple of JaxSimulationData objects.

tidy3d.plugins.adjoint.JaxBox

A Box registered with jax.

tidy3d.plugins.adjoint.JaxPolySlab

A PolySlab registered with jax.

tidy3d.plugins.adjoint.JaxMedium

A Medium registered with jax.

tidy3d.plugins.adjoint.JaxAnisotropicMedium

A Medium registered with jax.

tidy3d.plugins.adjoint.JaxCustomMedium

A CustomMedium registered with jax.

tidy3d.plugins.adjoint.JaxStructure

A Structure registered with jax.

tidy3d.plugins.adjoint.JaxSimulation

A Simulation registered with jax.

tidy3d.plugins.adjoint.JaxSimulationData

A SimulationData registered with jax.

tidy3d.plugins.adjoint.JaxModeData

A ModeData registered with jax.

tidy3d.plugins.adjoint.JaxPermittivityDataset

A PermittivityDataset registered with jax.

tidy3d.plugins.adjoint.JaxDataArray

A DataArray-like class that only wraps xarray for jax compatibility.

tidy3d.plugins.adjoint.utils.filter.ConicFilter

Filter that convolves an image with a conical mask, used for larger feature sizes.

tidy3d.plugins.adjoint.utils.filter.BinaryProjector

Projects a grayscale image towards min and max values using a smooth tanh function.

tidy3d.plugins.adjoint.utils.penalty.RadiusPenalty

Generates a penalty for radius of curvature of set of points.

Waveguide#

tidy3d.plugins.waveguide.RectangularDielectric

General rectangular dielectric waveguide

Design Space Exploration#

tidy3d.plugins.design.ParameterFloat

Parameter containing floats.

tidy3d.plugins.design.ParameterInt

Parameter containing integers.

tidy3d.plugins.design.ParameterAny

Parameter containing a set of of anything.

tidy3d.plugins.design.MethodGrid

Select parameters uniformly on a grid.

tidy3d.plugins.design.MethodMonteCarlo

Select sampling points using Monte Carlo sampling (Latin Hypercube method).

tidy3d.plugins.design.MethodRandomCustom

Select parameters with an object with a user supplied sampler with a .random method.

tidy3d.plugins.design.MethodRandom

Select sampling points uniformly at random.

tidy3d.plugins.design.DesignSpace

Specification of a design problem / combination of several parameters + algorithm.

Constants#

Physical Constants#

tidy3d.C_0

Convert a string or number to a floating point number, if possible.

tidy3d.HBAR

Convert a string or number to a floating point number, if possible.

tidy3d.Q_e

Convert a string or number to a floating point number, if possible.

tidy3d.ETA_0

Double-precision floating-point number type, compatible with Python float and C double.

tidy3d.EPSILON_0

Convert a string or number to a floating point number, if possible.

tidy3d.MU_0

Convert a string or number to a floating point number, if possible.

tidy3d.K_B

Convert a string or number to a floating point number, if possible.

Tidy3D Special Constants#

tidy3d.inf

Convert a string or number to a floating point number, if possible.

tidy3d.PEC

Perfect electrical conductor class.

Tidy3D Configuration#

tidy3d.config.Tidy3dConfig

configuration of tidy3d

Default Absorber Parameters#

tidy3d.DefaultPMLParameters

Specifies full set of parameters needed for complex, frequency-shifted PML.

tidy3d.DefaultStablePMLParameters

Specifies full set of parameters needed for complex, frequency-shifted PML.

tidy3d.DefaultAbsorberParameters

Specifies parameters common to Absorbers and PMLs.

Units#

Precision & Comparator Values#

Abstract Base Models#

Base classes that represent abstractions of the core elements of a Simulation.

simulation.AbstractSimulation

Base class for simulation classes of different solvers.

monitor.AbstractMonitor

Abstract base class for steady-state monitors.

source.AbstractSource

Abstract base class for all sources.

Abstract Models#

These are some classes that are used to organize the tidy3d components, but aren’t to be used directly in the code. Documented here mainly for reference.

tidy3d.components.base.Tidy3dBaseModel

Base pydantic model that all Tidy3d components inherit from.

tidy3d.components.base_sim.simulation.AbstractSimulation

Base class for simulation classes of different solvers.

tidy3d.components.boundary.AbsorberSpec

Specifies the generic absorber properties along a single dimension.

tidy3d.Geometry

Abstract base class, defines where something exists in space.

tidy3d.components.geometry.base.Centered

Geometry with a well defined center.

tidy3d.components.geometry.base.Planar

Geometry with one axis that is slab-like with thickness height.

tidy3d.components.geometry.base.Circular

Geometry with circular characteristics (specified by a radius).

tidy3d.components.medium.AbstractMedium

A medium within which electromagnetic waves propagate.

tidy3d.components.medium.AbstractCustomMedium

A spatially varying medium.

tidy3d.components.medium.DispersiveMedium

A Medium with dispersion: field propagation characteristics depend on frequency.

tidy3d.components.medium.CustomDispersiveMedium

A spatially varying dispersive medium.

tidy3d.components.structure.AbstractStructure

A basic structure object.

tidy3d.components.source.SourceTime

Base class describing the time dependence of a source.

tidy3d.components.source.Source

Abstract base class for all sources.

tidy3d.components.source.FieldSource

A Source defined by the desired E and/or H fields.

tidy3d.components.source.CurrentSource

Source implements a current distribution directly.

tidy3d.components.source.ReverseInterpolatedSource

Abstract source that allows reverse-interpolation along zero-sized dimensions.

tidy3d.components.source.AngledFieldSource

A FieldSource defined with an angled direction of propagation.

tidy3d.components.source.PlanarSource

A source defined on a 2D plane.

tidy3d.components.source.DirectionalSource

A Field source that propagates in a given direction.

tidy3d.components.source.BroadbandSource

A source with frequency dependent field distributions.

tidy3d.components.source.VolumeSource

A source defined in a 3D Box.

tidy3d.components.source.Pulse

A source time that ramps up with some fwidth and oscillates at freq0.

tidy3d.components.monitor.Monitor

Abstract base class for monitors.

tidy3d.components.monitor.FreqMonitor

Monitor that records data in the frequency-domain.

tidy3d.components.monitor.TimeMonitor

Monitor that records data in the time-domain.

tidy3d.components.monitor.AbstractFieldMonitor

Monitor that records electromagnetic field data as a function of x,y,z.

tidy3d.components.monitor.AbstractFluxMonitor

Monitor that records flux during the solver run.

tidy3d.components.monitor.PlanarMonitor

Monitor that has a planar geometry.

tidy3d.components.monitor.AbstractFieldProjectionMonitor

Monitor that samples electromagnetic near fields in the frequency domain and projects them to a given set of observation points.

tidy3d.components.grid.grid_spec.GridSpec1d

Abstract base class, defines 1D grid generation specifications.

tidy3d.components.data.data_array.DataArray

Subclass of xr.DataArray that requires _dims to match the keys of the coords.

tidy3d.components.data.monitor_data.MonitorData

Abstract base class of objects that store data pertaining to a single monitor.

tidy3d.components.data.monitor_data.AbstractFieldProjectionData

Collection of projected fields in spherical coordinates in the frequency domain.

tidy3d.components.data.monitor_data.ElectromagneticFieldData

Collection of electromagnetic fields.

tidy3d.components.data.monitor_data.AbstractMonitorData

Abstract base class of objects that store data pertaining to a single AbstractMonitor.

tidy3d.components.data.dataset.AbstractFieldDataset

Collection of scalar fields with some symmetry properties.

tidy3d.components.data.dataset.FieldDataset

Dataset storing a collection of the scalar components of E and H fields in the freq.

tidy3d.components.data.dataset.FieldTimeDataset

Dataset storing a collection of the scalar components of E and H fields in the time domain

tidy3d.components.data.dataset.ModeSolverDataset

Dataset storing scalar components of E and H fields as a function of freq.