API Reference

Simulation

Simulation([size, center, resolution, …])

Main class for building a simulation model.

Simulation.materials

List containing all materials included in the simulation.

Simulation.structures

List containing all Structure objects.

Simulation.sources

List containing all Source objects.

Simulation.monitors

List containing all Monitor objects.

Simulation.epsilon([monitor, center, size, …])

Compute the complex relative permittivity inside a volume.

Simulation.set_time([run_time, courant])

Change the value of the run time of the simulation and the time step determined by the courant stability factor.

Saving and loading

Simulation.load_results(dfile[, ind_src_norm])

Load all monitor data recorded from a Tidy3D run.

Simulation.export()

Return a dictionary with all simulation parameters and objects.

Simulation.export_json(fjson)

Export the simulation specification to a JSON file.

Simulation.import_json(fjson)

Import a simulation specification from a JSON file.

Material

Medium([name])

Base class for a custom defined material.

Medium.epsilon([freqs, component])

Evaluate the (complex) relative permittivity of the medium.

PEC

Perfect electric conductor.

material_library

A library of pre-defined materials.

Dispersive models

DispersionModel([eps_inf, poles, name])

Base class for a model of material dispersion.

Sellmeier(coeffs[, name])

Sellmeier dispersion refractive index model.

Sellmeier.from_dn(wl, n, dn_dwl[, name])

Create a 1-pole Sellmeier model from dispersion data.

Lorentz(eps_inf, coeffs[, name])

Lorentz dispersion permittivity model.

Debye(eps_inf, coeffs[, name])

Debye dispersion permittivity model.

Drude(eps_inf, coeffs[, name])

Drude dispersion permittivity model.

Fitting optical data

fit.DispersionFit(wavelengths, n_data[, k_data])

fit.DispersionFit.fit([num_poles, …])

Fits data a number of times and returns best results.

fit.DispersionFit.plot([wavelengths, ax, …])

Make plot of model vs data, at a set of wavelengths (if supplied).

fit.load_nk_file(fname, **load_txt_kwargs)

Loads nk data from file, performs validation on input.

fit.load_poles([fname, name])

Loads txt file with (num_poles, 2) complex array data into Medium.

Structure

Structure(material[, name])

Base class for regions defined by geometric shapes in a simulation domain.

Box(center, size, material[, name])

Box structure, i.e. a 3D rectangular axis-aligned prism.

Sphere(center, radius, material[, name])

Sphere structure.

Cylinder(center, axis, radius, height, material)

Cylinder structure.

PolySlab(material, vertices[, z_cent, …])

A structure defined as polygon in x and y, and extruded in z.

GdsSlab(material, gds_cell[, gds_layer, …])

A structure defined through a GDS cell imported through gdspy.

Source

Source(source_time, span[, amplitude, name])

Base class for defining spatial profiles of excitation conditions.

VolumeSource(source_time, center, size, …)

A source specified as an electric or a magnetic current of a fixed component (one of Ex, Ey, Ez, Hx, Hy, Hz) with a constant amplitude inside a 3D volume region.

PointDipole(source_time, center, component)

A source specified as an electric or a magnetic current of a fixed component (one of Ex, Ey, Ez, Hx, Hy, Hz) at a given point.

ModeSource(source_time, center, size[, …])

Eigenmode source spanning a 2D cross section of a given size inside a Simulation.

PlaneWave(source_time, injection_axis, …)

Plane-wave source with a specified direction and polarization, spanning the whole 2D simulation cross-section at a given position normal to a given injection axis.

GaussianBeam(source_time, center, normal[, …])

Plane-wave source with a specified direction and polarization, spanning the whole simulation cross-section at a given position and axis normal.

Simulation.compute_modes(mode_object, Nmodes)

Compute the eigenmodes of the 2D cross-section of a ModeSource or ModeMonitor object, assuming translational invariance in the third dimension.

Simulation.set_mode(source, mode_ind[, …])

Set the index of the mode to be used by the mode source.

Simulation.spectrum(source, freqs)

Returns the spectrum of a Source.

Time dependence

SourceTime()

Base class for the time dependence of a source.

GaussianPulse(frequency, fwidth[, offset, phase])

Source with a Gaussian-envelope time dependence.

Monitor

Monitor(center, size[, name])

Base class for defining field monitors.

TimeMonitor(center, size[, t_start, t_stop, …])

Monitor recording the time-domain fields within a 3D region.

FreqMonitor(center, size, freqs[, store, …])

Monitor recording a discrete Fourier transform of the fields within a 3D region, for a given list of frequencies.

ModeMonitor(center, size, freqs[, …])

FreqMonitor subclass defining a 2D plane in which the recorded frequency-domain fields can be decomposed into propagating eigenmodes.

Simulation.compute_modes(mode_object, Nmodes)

Compute the eigenmodes of the 2D cross-section of a ModeSource or ModeMonitor object, assuming translational invariance in the third dimension.

Simulation.set_monitor_modes(monitor[, …])

Set the parameters for the modes to be used in the modal decomposition in the monitor.

Simulation Outputs

Simulation.data(monitor)

Return a dictionary with all the stored data in a Monitor.

Simulation.flux(monitor[, normal])

Compute the area-integrated Poynting flux in a given direction.

Simulation.poynting(monitor)

Compute the Poynting vector at every point recorded by a Monitor.

Simulation.decompose(mode_monitor)

Compute the decomposition of the fields recorded in a ModeMonitor into the eigenmodes in the monitor plane.

Near Field to Far Field

Near2Far(monitor_data[, freq_index])

Near field to far field transformation tool.

Near2Far.get_fields_cartesian(x, y, z)

Get fields at a point relative to monitor center in cartesian coordintes.

Near2Far.get_fields_spherical(r, theta, phi)

Get fields at a point relative to monitor center in spherical coordintes.

Near2Far.get_power_cartesian(x, y, z)

Get power scattered to a point relative to monitor center in cartesian coordinates.

Near2Far.get_power_spherical(r, theta, phi)

Get power scattered to a point relative to monitor center in spherical coordinates.

Near2Far.get_radar_cross_section(theta, phi)

Get radar cross section at a point relative to monitor center in units of incident power.

Plotting tools

Simulation.viz_eps_2D([normal, position, …])

Plot the real part of the relative permittivity distribution of a 2D cross-section of the simulation.

Simulation.viz_source(source[, axs])

Plot both the time and frequency dependence of a source.

Simulation.viz_source_time(source[, ax])

Plot the time dependence of a source.

Simulation.viz_source_spectrum(source[, ax, …])

Plot the frequency dependence of a source.

Simulation.viz_field_2D(monitor[, …])

Plot a 2D cross-section of a field stored in a Monitor.

Simulation.viz_modes(mode_obj[, freq_ind, …])

Plot the field distribution of the 2D eigenmodes of a ModeSource or a ModeMonitor object.

Web API

web.new_project(sim_dict[, task_name, …])

Create new project.

web.get_project(task_id)

Get all project details from a given task_id.

web.delete_project(task_id)

Delete a project from a given task_id.

web.monitor_project(task_id[, silent])

Monitor the status of a given project every second.

web.list_projects([Nprojects])

Print a summary of all projects of the current user, in chronological order of submission.

web.download_json(task_id[, target_folder])

Download the project json file

web.download_results(task_id[, target_folder])

Download the results of a solver run, including the json file defining the simulation, a single file containing all the monitor data, and a log file.

web.run(simulation[, task_name, …])

Runs a simulation and loads the results.

web.load(task_id[, simulation, target_folder])

Loads results from web to simulation.

Job Management

web.Job(simulation[, base_dir, task_id, …])

Container for single simulation and associated task.

web.Job.load_from_task_id(task_id[, …])

Loads a Job from it’s task id.

web.Job.get_info()

Returns dictionary containing Job metadata.

web.Job.delete()

Deletes the Job from our server.

web.Job.monitor()

Prints status of Job in real time.

web.Job.load_results([target_folder])

Downloads data to target_folder, loads data into either saved simulation or newly created simulation.

web.Job.download_json([target_folder])

Download the json file associated with this job to target_folder.

web.Job.download_results([target_folder])

Download the job results to target_folder.

Batch Management

web.Batch(simulations[, task_ids, …])

Container for processing set of simulations.

web.Batch.save(filename)

Save Batch info to file of newline-separated task_ids.

web.Batch.load_from_file(filename[, …])

Load a Batch from file containing newline separated list of task_ids.

web.Batch.load_from_task_ids(task_ids[, …])

Load a Batch from file containing newline separated list of task_ids.

web.Batch.get_info()

Return list of dictionaries storing Batch metadata.

web.Batch.delete()

Delete all jobs in Batch.

web.Batch.monitor()

Monitor progress of Batch in terms of number of jobs completed.

web.Batch.load_results()

downloads results and either loads into list of simulations or returns list of new simulations

web.Batch.download_json()

Downalod json file of each Job to it’s corresponding target_folder.

web.Batch.download_results()

Downalod data of each Job to it’s corresponding target_folder.

Miscellaneous

dft_spectrum(time_series, dt, freqs)

Computes the frequency spectrum associated to a time series directly using the discrete fourier transform.

logging_default()

Set the default logging configuration.

logging_file(fname[, filemode, level])

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

logging_level(level)

Set the lowest severity level to print to the console, as per the python logger.