Skip to content

Commit

Permalink
Changelog and schema for 1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
momchil-flex committed Mar 1, 2023
1 parent 6a25bc1 commit 6204c71
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 32 deletions.
49 changes: 19 additions & 30 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- Asynchronous running of multiple simulations concurrently using `web.run_async`.
- Jax-compatible `run_async` in the `adjoint` plugin for efficiently running multi-simulation objectives concurrently and differentiating result.
- Warning in `Simulation.epsilon` if many grid cells and structures provided and slow run time expected as a result.
- `verbose` option in `tidy3d.web` functions and containers. If `False`, there will be no non-essential output when running simulations over web api.
- Warning if PML or absorbing boundaries are used along a simulation dimension with zero size.

### Changed
- Issue a deprecation warning that `Geometry.intersections` will be renamed to `Geometry.intersections_plane` in 2.0.
- Limit some warnings to only show for the first structure for which they are encountered.


### Fixed
- Progressbars always set to 100% when webapi functions are finished.
- Faster handling of `Geometry.intersects` and `Geometry.inside` by taking into account geometry bounds.
- Numpy divide by zero warning in mode solver fixed by initializing jacobians as real instead of complex.
- Bug in validators for 2D objects being in homogeneous media which were looking at the infinite plane in which the objects lie. This can also significantly speed up some validators in the case of many structures.


## [1.9.0rc2] - 2023-2-17
## [1.9.0] - 2023-3-01

### Added

- Specification of relative permittivity distribution using raw, user-supplied data through a `CustomMedium` component.
- Automatic differentiation through `Tidy3D` simulations using `jax` through `tidy3d.plugins.adjoint`.
- New Drude model variants for Gold and Silver in the `material_library`.
- Plugin `ComplexPolySlab` for supporting complex polyslabs containing self-intersecting polygons during extrusion.
- Asynchronous running of multiple simulations concurrently using `web.run_async`.
- Jax-compatible `run_async` in the `adjoint` plugin for efficiently running multi-simulation objectives concurrently and differentiating result.
- Warning in `Simulation.epsilon` if many grid cells and structures provided and slow run time expected as a result.
- `verbose` option in `tidy3d.web` functions and containers. If `False`, there will be no non-essential output when running simulations over web api.
- Warning if PML or absorbing boundaries are used along a simulation dimension with zero size.

### Changed
- Saving and loading of `.hdf5` files is made orders of magnitude faster due to an internal refactor.
- `PolySlab.from_gds` supports `gds_cell` from both `gdspy` and `gdstk`, both packages are made optional requirements.
- Adjoint plugin `JaxCustomMedium` is made faster and can handle several thousand pixels without significant overhead.
- Jax is made an optional requirement. The adjoint plugin supports jax versions 0.3 and 0.4 for windows and non-windows users, respectively.
- Issue a deprecation warning that `Geometry.intersections` will be renamed to `Geometry.intersections_plane` in 2.0.
- Limit some warnings to only show for the first structure for which they are encountered.
- Billed flex unit no longer shown at the end of `web.run` as it may take a few seconds until it is available. Instead, added a `web.real_cost(task_id)` function to get the cost after a task run.

### Fixed
- Error importing `Axes` type with most recent `matplotlib` release.

## [1.9.0rc1] - 2023-2-3

### Added
- Specification of relative permittivity distribution using raw, user-supplied data through a `CustomMedium` component.
- Automatic differentiation through `Tidy3D` simulations using `jax` through `tidy3d.plugins.adjoint`.
- New Drude model variants for Gold and Silver in the `material_library`.

### Changed
- Saving and loading of `.hdf5` files is made orders of magnitude faster due to an internal refactor.
### Changed
- Progressbars always set to 100% when webapi functions are finished.
- Faster handling of `Geometry.intersects` and `Geometry.inside` by taking into account geometry bounds.
- Numpy divide by zero warning in mode solver fixed by initializing jacobians as real instead of complex.
- Bug in validators for 2D objects being in homogeneous media which were looking at the infinite plane in which the objects lie. This can also significantly speed up some validators in the case of many structures.
- Sources and monitors with bend radii are displayed with curved arrows.

## [1.8.4] - 2023-2-13

### Fixed
- Import error when matplotlib updated to 3.7
- Error importing `Axes` type with most recent `matplotlib` release (3.7).

## [1.8.3] - 2023-1-26

Expand Down Expand Up @@ -592,8 +582,7 @@ which fields are to be projected is now determined automatically based on the me
- Job and Batch classes for better simulation handling (eventually to fully replace webapi functions).
- A large number of small improvements and bug fixes.

[1.9.0rc2]: https://github.com/flexcompute/tidy3d/compare/v1.8.4...v1.9.0rc2
[1.9.0rc1]: https://github.com/flexcompute/tidy3d/compare/v1.8.4...v1.9.0rc1
[1.9.0]: https://github.com/flexcompute/tidy3d/compare/v1.8.4...v1.9.0
[1.8.4]: https://github.com/flexcompute/tidy3d/compare/v1.8.3...v1.8.4
[1.8.3]: https://github.com/flexcompute/tidy3d/compare/v1.8.2...v1.8.3
[1.8.2]: https://github.com/flexcompute/tidy3d/compare/v1.8.1...v1.8.2
Expand Down
4 changes: 2 additions & 2 deletions tidy3d/schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Simulation",
"description": "Contains all information about Tidy3d simulation.\n\nParameters\n----------\ncenter : Tuple[float, float, float] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Tuple[NonNegativeFloat, NonNegativeFloat, NonNegativeFloat]\n [units = um]. Size in x, y, and z directions.\nrun_time : PositiveFloat\n [units = sec]. Total electromagnetic evolution time in seconds. Note: If simulation 'shutoff' is specified, simulation will terminate early when shutoff condition met. \nmedium : Union[Medium, CustomMedium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude] = Medium(name=None, frequency_range=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to vacuum if not specified.\nsymmetry : Tuple[Literal[0, -1, 1], Literal[0, -1, 1], Literal[0, -1, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectvely. Each element can be ``0`` (no symmetry), ``1`` (even, i.e. 'PMC' symmetry) or ``-1`` (odd, i.e. 'PEC' symmetry). Note that the vectorial nature of the fields must be taken into account to correctly determine the symmetry value.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsources : Tuple[Annotated[Union[tidy3d.components.source.UniformCurrentSource, tidy3d.components.source.PointDipole, tidy3d.components.source.GaussianBeam, tidy3d.components.source.AstigmaticGaussianBeam, tidy3d.components.source.ModeSource, tidy3d.components.source.PlaneWave, tidy3d.components.source.CustomFieldSource], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of electric current sources injecting fields into the simulation.\nboundary_spec : Optional[BoundarySpec] = None\n Specification of boundary conditions along each dimension. If ``None``, periodic boundary conditions are applied on all sides. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.\nmonitors : Tuple[Annotated[Union[tidy3d.components.monitor.FieldMonitor, tidy3d.components.monitor.FieldTimeMonitor, tidy3d.components.monitor.PermittivityMonitor, tidy3d.components.monitor.FluxMonitor, tidy3d.components.monitor.FluxTimeMonitor, tidy3d.components.monitor.ModeMonitor, tidy3d.components.monitor.ModeSolverMonitor, tidy3d.components.monitor.FieldProjectionAngleMonitor, tidy3d.components.monitor.FieldProjectionCartesianMonitor, tidy3d.components.monitor.FieldProjectionKSpaceMonitor, tidy3d.components.monitor.DiffractionMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of monitors in the simulation. Note: monitor names are used to access data after simulation is run.\ngrid_spec : GridSpec = GridSpec(grid_x=AutoGrid(type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(type='GradedMesher')), grid_y=AutoGrid(type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(type='GradedMesher')), grid_z=AutoGrid(type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(type='GradedMesher')), wavelength=None, override_structures=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions.\nshutoff : NonNegativeFloat = 1e-05\n Ratio of the instantaneous integrated E-field intensity to the maximum value at which the simulation will automatically terminate time stepping. Used to prevent extraneous run time of simulations with fully decayed fields. Set to ``0`` to disable this feature.\nsubpixel : bool = True\n If ``True``, uses subpixel averaging of the permittivity based on structure definition, resulting in much higher accuracy for a given grid size.\nnormalize_index : Optional[NonNegativeInt] = 0\n Index of the source in the tuple of sources whose spectrum will be used to normalize the frequency-dependent data. If ``None``, the raw field data is returned unnormalized.\ncourant : ConstrainedFloatValue = 0.99\n Courant stability factor, controls time step to spatial step ratio. Lower values lead to more stable simulations for dispersive materials, but result in longer simulation times. This factor is normalized to no larger than 1 when CFL stability condition is met in 3D.\nversion : str = 1.9.0rc2\n String specifying the front end version number.\n\nExample\n-------\n>>> from tidy3d import Sphere, Cylinder, PolySlab\n>>> from tidy3d import UniformCurrentSource, GaussianPulse\n>>> from tidy3d import FieldMonitor, FluxMonitor\n>>> from tidy3d import GridSpec, AutoGrid\n>>> from tidy3d import BoundarySpec, Boundary\n>>> sim = Simulation(\n... size=(2.0, 2.0, 2.0),\n... grid_spec=GridSpec(\n... grid_x = AutoGrid(min_steps_per_wvl = 20),\n... grid_y = AutoGrid(min_steps_per_wvl = 20),\n... grid_z = AutoGrid(min_steps_per_wvl = 20)\n... ),\n... run_time=40e-11,\n... structures=[\n... Structure(\n... geometry=Box(size=(1, 1, 1), center=(-1, 0, 0)),\n... medium=Medium(permittivity=2.0),\n... ),\n... ],\n... sources=[\n... UniformCurrentSource(\n... size=(0, 0, 0),\n... center=(0, 0.5, 0),\n... polarization=\"Hx\",\n... source_time=GaussianPulse(\n... freq0=2e14,\n... fwidth=4e13,\n... ),\n... )\n... ],\n... monitors=[\n... FieldMonitor(size=(0, 0, 0), center=(0, 0, 0), freqs=[1.5e14, 2e14], name='point'),\n... FluxMonitor(size=(1, 1, 0), center=(0, 0, 0), freqs=[2e14, 2.5e14], name='flux'),\n... ],\n... symmetry=(0, 0, 0),\n... boundary_spec=BoundarySpec(\n... x = Boundary.pml(num_layers=20),\n... y = Boundary.pml(num_layers=30),\n... z = Boundary.periodic(),\n... ),\n... shutoff=1e-6,\n... courant=0.8,\n... subpixel=False,\n... )",
"description": "Contains all information about Tidy3d simulation.\n\nParameters\n----------\ncenter : Tuple[float, float, float] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Tuple[NonNegativeFloat, NonNegativeFloat, NonNegativeFloat]\n [units = um]. Size in x, y, and z directions.\nrun_time : PositiveFloat\n [units = sec]. Total electromagnetic evolution time in seconds. Note: If simulation 'shutoff' is specified, simulation will terminate early when shutoff condition met. \nmedium : Union[Medium, CustomMedium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude] = Medium(name=None, frequency_range=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to vacuum if not specified.\nsymmetry : Tuple[Literal[0, -1, 1], Literal[0, -1, 1], Literal[0, -1, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectvely. Each element can be ``0`` (no symmetry), ``1`` (even, i.e. 'PMC' symmetry) or ``-1`` (odd, i.e. 'PEC' symmetry). Note that the vectorial nature of the fields must be taken into account to correctly determine the symmetry value.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsources : Tuple[Annotated[Union[tidy3d.components.source.UniformCurrentSource, tidy3d.components.source.PointDipole, tidy3d.components.source.GaussianBeam, tidy3d.components.source.AstigmaticGaussianBeam, tidy3d.components.source.ModeSource, tidy3d.components.source.PlaneWave, tidy3d.components.source.CustomFieldSource], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of electric current sources injecting fields into the simulation.\nboundary_spec : Optional[BoundarySpec] = None\n Specification of boundary conditions along each dimension. If ``None``, periodic boundary conditions are applied on all sides. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.\nmonitors : Tuple[Annotated[Union[tidy3d.components.monitor.FieldMonitor, tidy3d.components.monitor.FieldTimeMonitor, tidy3d.components.monitor.PermittivityMonitor, tidy3d.components.monitor.FluxMonitor, tidy3d.components.monitor.FluxTimeMonitor, tidy3d.components.monitor.ModeMonitor, tidy3d.components.monitor.ModeSolverMonitor, tidy3d.components.monitor.FieldProjectionAngleMonitor, tidy3d.components.monitor.FieldProjectionCartesianMonitor, tidy3d.components.monitor.FieldProjectionKSpaceMonitor, tidy3d.components.monitor.DiffractionMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of monitors in the simulation. Note: monitor names are used to access data after simulation is run.\ngrid_spec : GridSpec = GridSpec(grid_x=AutoGrid(type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(type='GradedMesher')), grid_y=AutoGrid(type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(type='GradedMesher')), grid_z=AutoGrid(type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(type='GradedMesher')), wavelength=None, override_structures=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions.\nshutoff : NonNegativeFloat = 1e-05\n Ratio of the instantaneous integrated E-field intensity to the maximum value at which the simulation will automatically terminate time stepping. Used to prevent extraneous run time of simulations with fully decayed fields. Set to ``0`` to disable this feature.\nsubpixel : bool = True\n If ``True``, uses subpixel averaging of the permittivity based on structure definition, resulting in much higher accuracy for a given grid size.\nnormalize_index : Optional[NonNegativeInt] = 0\n Index of the source in the tuple of sources whose spectrum will be used to normalize the frequency-dependent data. If ``None``, the raw field data is returned unnormalized.\ncourant : ConstrainedFloatValue = 0.99\n Courant stability factor, controls time step to spatial step ratio. Lower values lead to more stable simulations for dispersive materials, but result in longer simulation times. This factor is normalized to no larger than 1 when CFL stability condition is met in 3D.\nversion : str = 1.9.0\n String specifying the front end version number.\n\nExample\n-------\n>>> from tidy3d import Sphere, Cylinder, PolySlab\n>>> from tidy3d import UniformCurrentSource, GaussianPulse\n>>> from tidy3d import FieldMonitor, FluxMonitor\n>>> from tidy3d import GridSpec, AutoGrid\n>>> from tidy3d import BoundarySpec, Boundary\n>>> sim = Simulation(\n... size=(2.0, 2.0, 2.0),\n... grid_spec=GridSpec(\n... grid_x = AutoGrid(min_steps_per_wvl = 20),\n... grid_y = AutoGrid(min_steps_per_wvl = 20),\n... grid_z = AutoGrid(min_steps_per_wvl = 20)\n... ),\n... run_time=40e-11,\n... structures=[\n... Structure(\n... geometry=Box(size=(1, 1, 1), center=(-1, 0, 0)),\n... medium=Medium(permittivity=2.0),\n... ),\n... ],\n... sources=[\n... UniformCurrentSource(\n... size=(0, 0, 0),\n... center=(0, 0.5, 0),\n... polarization=\"Hx\",\n... source_time=GaussianPulse(\n... freq0=2e14,\n... fwidth=4e13,\n... ),\n... )\n... ],\n... monitors=[\n... FieldMonitor(size=(0, 0, 0), center=(0, 0, 0), freqs=[1.5e14, 2e14], name='point'),\n... FluxMonitor(size=(1, 1, 0), center=(0, 0, 0), freqs=[2e14, 2.5e14], name='flux'),\n... ],\n... symmetry=(0, 0, 0),\n... boundary_spec=BoundarySpec(\n... x = Boundary.pml(num_layers=20),\n... y = Boundary.pml(num_layers=30),\n... z = Boundary.periodic(),\n... ),\n... shutoff=1e-6,\n... courant=0.8,\n... subpixel=False,\n... )",
"type": "object",
"properties": {
"type": {
Expand Down Expand Up @@ -334,7 +334,7 @@
"version": {
"title": "Version",
"description": "String specifying the front end version number.",
"default": "1.9.0rc2",
"default": "1.9.0",
"type": "string"
}
},
Expand Down

0 comments on commit 6204c71

Please sign in to comment.