From 32b1701d67e1d4704e2efe2c1685ed6ebdc7a671 Mon Sep 17 00:00:00 2001 From: Momchil Minkov Date: Fri, 15 Nov 2024 11:25:55 +0100 Subject: [PATCH] Final updates for 2.7.7 --- CHANGELOG.md | 6 +- docs/notebooks | 2 +- tests/sims/simulation_sample.h5 | Bin 465224 -> 466200 bytes tests/sims/simulation_sample.json | 40 +++++++- tidy3d/schema.json | 162 +++++++++++++++++++++++++++--- 5 files changed, 192 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e3e6c90d..0b13db155 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.7.7] - 2024-11-15 + ### Added - Autograd support for local field projections using `FieldProjectionKSpaceMonitor`. - Function `components.geometry.utils.flatten_groups` now also flattens transformed groups when requested. @@ -20,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Calling `.values` on `DataArray` no longer raises a `DeprecationWarning` during automatic differentiation. - Minimum number of PML layers set to 6. - `Structure.background_permittivity : float` for specifying background medium for shape differentiation deprecated in favor of `Structure.background_medium : Medium` for more generality. +- Validate mode objects so that if a bend radius is defined, it is not smaller than half the size of the modal plane along the radial direction (i.e. the bend center is not inside the mode plane). ### Fixed - Regression in local field projection leading to incorrect projection results. @@ -1383,7 +1386,8 @@ 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. -[Unreleased]: https://github.com/flexcompute/tidy3d/compare/v2.7.6...develop +[Unreleased]: https://github.com/flexcompute/tidy3d/compare/v2.7.7...develop +[2.7.7]: https://github.com/flexcompute/tidy3d/compare/v2.7.6...v2.7.7 [2.7.6]: https://github.com/flexcompute/tidy3d/compare/v2.7.5...v2.7.6 [2.7.5]: https://github.com/flexcompute/tidy3d/compare/v2.7.4...v2.7.5 [2.7.4]: https://github.com/flexcompute/tidy3d/compare/v2.7.3...v2.7.4 diff --git a/docs/notebooks b/docs/notebooks index 3ad84c09b..269f0c34b 160000 --- a/docs/notebooks +++ b/docs/notebooks @@ -1 +1 @@ -Subproject commit 3ad84c09bfa80ceb3cb4cdf894472430acf2a1fb +Subproject commit 269f0c34b23bfddc52b78786a12a838a3e14914d diff --git a/tests/sims/simulation_sample.h5 b/tests/sims/simulation_sample.h5 index 25142049c4e0312561189c4fad122ee0da02a938..a602c3af5003710c3942be0d07b7dc75f3269eec 100644 GIT binary patch delta 18106 zcmZWx30xD$_s`A-eo63%Cm^eyy_F_f@yZL~51v;pD$6RdQpXGnxuZ)FCKwU24{8(Okm&YrTLYahx7=ZlY~W0-xbpRJJmLYT8ym2-nYHCMc?vht={Jdq+ZasY-7m`yi`kOs^wvuANkt4 zGlRda%_lr;^R-}Zuvl0h6(9^7>T5Y2cBqb>J|FBQ?)nSWeMWk!WWXM;Rc%4W4z(=h z3O=}*rMh#+I`#Sen+VmN-xK=sA&3+^-tfm};cPq9wj*gDNIj_||J zGq@fCCz>>Ezx@2uxm`bPE4(Yt=lynZsbgCC=y$_BGwzW|hZRWuK2BKo@0%!PgQfCf zbA*iRg{Zahi_(w4Tx4@I@dVImC*j)wU#g_bP+)u+l+L>f^9;{8_CkD!W)sjF>jwk5h6sgk5a#8_``alS zv*=`EmeLJvIPvll&R4e)Bn_KX;*bp}M3V`0cvjZ`kPy8=gG`%**bVV53jcrxrc31# z%*rA;M8EMn5FJEFIYR(uZrlKUjl9M#gOJZh9%}$oQ*r z!uiu>*r(}>llG(4_)u)WSq0NyEM*Ra(-G~r)i_g z@pp!-E7eb5;?5mjeYT*i2A{aQ@@)OQ=lHw!W4doTQ;zFBST%0U#cDh+YK?c;@Mn0? z8;4u3`K3zIVH&e`_Of1!f=mxm*M9Q2f3PXyb-~{czX&po|JHEv-9Lg%okBacnS3JH zWE%F__=BYW_XP!ct@{O;7M)L7bA48jNpNg3VxQ}Sp1=QF1+J*~zpL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%7k1r{`on@-j#ht3 z4+BZ1lkBZst%0N`7c@RH8#x_(@_BD6(`&5KOKnjTt8?Ov7AfhANJ)p&lc2_7sgaD~ z+LV?cO{i*Q3}!ws4E{c|cC}!S1H@^x?9=}M${toT%6$J*0JTC{dISUJwo}W$ly{6u zzs1}N&U}q@kVeMRkKJ&tT0I380LMkOdIfpERi$1|z8E1Nyh+|x$|YqChS5^xMaSxJ za;d!NNa%W4-5(ltj#h2dgf3kKrz@FUD0E5H?bN;pY|yL2`yWv+(0balCWw8EwW_;ZAl*__8^aOI-D*q=jYVlJO;_ z?+tZ)IU$71_&jH*W6Q*l5CC(vj+=WzA0+}XF^R;B^)X&Rti`_. ``tidy3d`` simulations\n run very quickly in the cloud through GPU parallelization.\n\n .. image:: ../../_static/img/field_update_fdtd.png\n :width: 50%\n :align: left\n\n FDTD is a method for simulating the interaction of electromagnetic waves with structures and materials. It is\n the most widely used method in photonics design. The Maxwell's\n equations implemented in the ``Simulation`` are solved per time-step in the order shown in this image.\n\n The simplified input to FDTD solver consists of the permittivity distribution defined by :attr:`structures`\n which describe the device and :attr:`sources` of electromagnetic excitation. This information is used to\n computate the time dynamics of the electric and magnetic fields in this system. From these time-domain\n results, frequency-domain information of the simulation can also be extracted, and used for device design and\n optimization.\n\n If you are new to the FDTD method, we recommend you get started with the `FDTD 101 Lecture Series\n `_\n\n **Dimensions Selection**\n\n By default, simulations are defined as 3D. To make the simulation 2D, we can just set the simulation\n :attr:`size` in one of the dimensions to be 0. However, note that we still have to define a grid size (eg.\n ``tidy3d.Simulation(size=[size_x, size_y, 0])``) and specify a periodic boundary condition in that direction.\n\n .. TODO sort out inheritance problem https://aware-moon.cloudvent.net/tidy3d/examples/notebooks/RingResonator/\n\n See further parameter explanations below.\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>>> from tidy3d import Medium\n>>> sim = Simulation(\n... size=(3.0, 3.0, 3.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=(0, 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... 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... )\n\nSee Also\n--------\n\n**Notebooks:**\n * `Quickstart <../../notebooks/StartHere.html>`_: Usage in a basic simulation flow.\n * `Using automatic nonuniform meshing <../../notebooks/AutoGrid.html>`_\n * See nearly all notebooks for :class:`Simulation` applications.\n\n**Lectures:**\n * `Introduction to FDTD Simulation `_: Usage in a basic simulation flow.\n * `Prelude to Integrated Photonics Simulation: Mode Injection `_\n\n**GUI:**\n * `FDTD Walkthrough `_", + "description": "Custom implementation of Maxwell\u2019s equations which represents the physical model to be solved using the FDTD\nmethod.\n\nParameters\n----------\nattrs : dict = {}\n Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, ``attrs`` are mutable. For example, the following is allowed for setting an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to vacuum if not specified.\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.\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, respectively. 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.\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, tidy3d.components.source.CustomCurrentSource, tidy3d.components.source.TFSF], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of electric current sources injecting fields into the simulation.\nboundary_spec : BoundarySpec = BoundarySpec(attrs={}, x=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), y=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), z=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), type='BoundarySpec')\n Specification of boundary conditions along each dimension. If ``None``, PML boundary conditions are applied on all sides.\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(attrs={}, grid_x=AutoGrid(attrs={},, type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(attrs={},, type='GradedMesher')), grid_y=AutoGrid(attrs={},, type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(attrs={},, type='GradedMesher')), grid_z=AutoGrid(attrs={},, type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(attrs={},, type='GradedMesher')), wavelength=None, override_structures=(), snapping_points=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions.\nversion : str = 2.7.7\n String specifying the front end version number.\nlumped_elements : Tuple[Union[LumpedResistor, CoaxialLumpedResistor], ...] = ()\n Tuple of lumped elements in the simulation. Note: only :class:`tidy3d.LumpedResistor` is supported currently.\nsubpixel : Union[bool, SubpixelSpec] = SubpixelSpec(attrs={}, dielectric=PolarizedAveraging(attrs={},, type='PolarizedAveraging'), metal=Staircasing(attrs={},, type='Staircasing'), pec=PECConformal(attrs={},, type='PECConformal',, timestep_reduction=0.3), type='SubpixelSpec')\n Apply subpixel averaging methods of the permittivity on structure interfaces to result in much higher accuracy for a given grid size. Supply a :class:`SubpixelSpec` to this field to select subpixel averaging methods separately on dielectric, metal, and PEC material interfaces. Alternatively, user may supply a boolean value: ``True`` to apply the default subpixel averaging methods corresponding to ``SubpixelSpec()`` , or ``False`` to apply staircasing.\nsimulation_type : Optional[Literal['autograd_fwd', 'autograd_bwd', 'tidy3d', None]] = tidy3d\n Tag used internally to distinguish types of simulations for ``autograd`` gradient processing.\npost_norm : Union[float, FreqDataArray] = 1.0\n Factor to multiply the fields by after running, given the adjoint source pipeline used. Note: this is used internally only.\ncourant : ConstrainedFloatValue = 0.99\n Normalized Courant stability factor that is no larger than 1 when CFL stability condition is met. It controls time step to spatial step ratio. Lower values lead to more stable simulations for dispersive materials, but result in longer simulation times.\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.\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.\nrun_time : Union[PositiveFloat, RunTimeSpec]\n [units = sec]. Total electromagnetic evolution time in seconds. Note: If simulation 'shutoff' is specified, simulation will terminate early when shutoff condition met. Alternatively, user may supply a :class:`RunTimeSpec` to this field, which will auto-compute the ``run_time`` based on the contents of the spec. If this option is used, the evaluated ``run_time`` value is available in the ``Simulation._run_time`` property.\n\nNotes\n-----\n\n A ``Simulation`` defines a custom implementation of Maxwell's equations which represents the physical model\n to be solved using `the Finite-Difference Time-Domain (FDTD) method\n `_. ``tidy3d`` simulations\n run very quickly in the cloud through GPU parallelization.\n\n .. image:: ../../_static/img/field_update_fdtd.png\n :width: 50%\n :align: left\n\n FDTD is a method for simulating the interaction of electromagnetic waves with structures and materials. It is\n the most widely used method in photonics design. The Maxwell's\n equations implemented in the ``Simulation`` are solved per time-step in the order shown in this image.\n\n The simplified input to FDTD solver consists of the permittivity distribution defined by :attr:`structures`\n which describe the device and :attr:`sources` of electromagnetic excitation. This information is used to\n computate the time dynamics of the electric and magnetic fields in this system. From these time-domain\n results, frequency-domain information of the simulation can also be extracted, and used for device design and\n optimization.\n\n If you are new to the FDTD method, we recommend you get started with the `FDTD 101 Lecture Series\n `_\n\n **Dimensions Selection**\n\n By default, simulations are defined as 3D. To make the simulation 2D, we can just set the simulation\n :attr:`size` in one of the dimensions to be 0. However, note that we still have to define a grid size (eg.\n ``tidy3d.Simulation(size=[size_x, size_y, 0])``) and specify a periodic boundary condition in that direction.\n\n .. TODO sort out inheritance problem https://aware-moon.cloudvent.net/tidy3d/examples/notebooks/RingResonator/\n\n See further parameter explanations below.\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>>> from tidy3d import Medium\n>>> sim = Simulation(\n... size=(3.0, 3.0, 3.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=(0, 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... 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... )\n\nSee Also\n--------\n\n**Notebooks:**\n * `Quickstart <../../notebooks/StartHere.html>`_: Usage in a basic simulation flow.\n * `Using automatic nonuniform meshing <../../notebooks/AutoGrid.html>`_\n * See nearly all notebooks for :class:`Simulation` applications.\n\n**Lectures:**\n * `Introduction to FDTD Simulation `_: Usage in a basic simulation flow.\n * `Prelude to Integrated Photonics Simulation: Mode Injection `_\n\n**GUI:**\n * `FDTD Walkthrough `_", "type": "object", "properties": { "attrs": { @@ -570,7 +570,7 @@ "version": { "title": "Version", "description": "String specifying the front end version number.", - "default": "2.7.6", + "default": "2.7.7", "type": "string" }, "lumped_elements": { @@ -621,9 +621,11 @@ "simulation_type": { "title": "Simulation Type", "description": "Tag used internally to distinguish types of simulations for ``autograd`` gradient processing.", + "default": "tidy3d", "enum": [ "autograd_fwd", - "autograd_bwd" + "autograd_bwd", + "tidy3d" ], "type": "string" }, @@ -882,7 +884,7 @@ }, "KerrNonlinearity": { "title": "KerrNonlinearity", - "description": "Model for Kerr nonlinearity which gives an intensity-dependent refractive index\nof the form :math:`n = n_0 + n_2 I`. The expression for the nonlinear polarization\nis given below.\n\nParameters\n----------\nattrs : dict = {}\n Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, ``attrs`` are mutable. For example, the following is allowed for setting an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\nn2 : Union[tidycomplex, ComplexNumber] = 0\n [units = um^2 / W]. Nonlinear refractive index in the Kerr nonlinearity.\nn0 : Union[tidycomplex, ComplexNumber, NoneType] = None\n Complex linear refractive index of the medium, computed for instance using 'medium.nk_model'. If not provided, it is calculated automatically using the central frequencies of the simulation sources (as long as these are all equal).\n\nNote\n----\n.. math::\n\n P_{NL} = \\varepsilon_0 c_0 n_0 \\operatorname{Re}(n_0) n_2 |E|^2 E\n\nNote\n----\nThe fields in this equation are complex-valued, allowing a direct implementation of the Kerr\nnonlinearity. In contrast, the model :class:`.NonlinearSusceptibility` implements a\nchi3 nonlinear susceptibility using real-valued fields, giving rise to Kerr nonlinearity\nas well as third-harmonic generation. The relationship between the parameters is given by\n:math:`n_2 = \\frac{3}{4} \\frac{1}{\\varepsilon_0 c_0 n_0 \\operatorname{Re}(n_0)} \\chi_3`. The additional\nfactor of :math:`\\frac{3}{4}` comes from the usage of complex-valued fields for the Kerr\nnonlinearity and real-valued fields for the nonlinear susceptibility.\n\nNote\n----\nDifferent field components do not interact nonlinearly. For example,\nwhen calculating :math:`P_{NL, x}`, we approximate :math:`|E|^2 \\approx |E_x|^2`.\nThis approximation is valid when the E field is predominantly polarized along one\nof the x, y, or z axes.\n\nExample\n-------\n>>> kerr_model = KerrNonlinearity(n2=1)", + "description": "Model for Kerr nonlinearity which gives an intensity-dependent refractive index\nof the form :math:`n = n_0 + n_2 I`. The expression for the nonlinear polarization\nis given below.\n\nParameters\n----------\nattrs : dict = {}\n Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, ``attrs`` are mutable. For example, the following is allowed for setting an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\nn2 : Union[tidycomplex, ComplexNumber] = 0\n [units = um^2 / W]. Nonlinear refractive index in the Kerr nonlinearity.\nn0 : Union[tidycomplex, ComplexNumber, NoneType] = None\n Complex linear refractive index of the medium, computed for instance using 'medium.nk_model'. If not provided, it is calculated automatically using the central frequencies of the simulation sources (as long as these are all equal).\n\nNote\n----\n.. math::\n\n P_{NL} = \\varepsilon_0 c_0 n_0 \\operatorname{Re}(n_0) n_2 |E|^2 E\n\nNote\n----\nThe fields in this equation are complex-valued, allowing a direct implementation of the Kerr\nnonlinearity. In contrast, the model :class:`.NonlinearSusceptibility` implements a\nchi3 nonlinear susceptibility using real-valued fields, giving rise to Kerr nonlinearity\nas well as third-harmonic generation and other effects. The relationship between the parameters is given by\n:math:`n_2 = \\frac{3}{4} \\frac{1}{\\varepsilon_0 c_0 n_0 \\operatorname{Re}(n_0)} \\chi_3`. The additional\nfactor of :math:`\\frac{3}{4}` comes from the usage of complex-valued fields for the Kerr\nnonlinearity and real-valued fields for the nonlinear susceptibility.\n\nNote\n----\nDifferent field components do not interact nonlinearly. For example,\nwhen calculating :math:`P_{NL, x}`, we approximate :math:`|E|^2 \\approx |E_x|^2`.\nThis approximation is valid when the E field is predominantly polarized along one\nof the x, y, or z axes.\n\nExample\n-------\n>>> kerr_model = KerrNonlinearity(n2=1)", "type": "object", "properties": { "attrs": { @@ -6378,7 +6380,7 @@ }, "Structure": { "title": "Structure", - "description": "Defines a physical object that interacts with the electromagnetic fields.\nA :class:`Structure` is a combination of a material property (:class:`AbstractMedium`)\nand a :class:`Geometry`.\n\nParameters\n----------\nattrs : dict = {}\n Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, ``attrs`` are mutable. For example, the following is allowed for setting an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ngeometry : Union[Box, Transformed, ClipOperation, GeometryGroup, Sphere, Cylinder, PolySlab, ComplexPolySlabBase, TriangleMesh]\n Defines geometric properties of the structure.\nname : Optional[str] = None\n Optional name for the structure.\nbackground_permittivity : Optional[ConstrainedFloatValue] = None\n Relative permittivity used for the background of this structure when performing shape optimization with autograd.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D, AnisotropicMediumFromMedium2D]\n Defines the electromagnetic properties of the structure's medium.\n\nNotes\n------\n\n Structures can indeed be larger than the simulation domain in ``tidy3d``. In such cases, ``tidy3d`` will\n automatically truncate the geometry that goes beyond the domain boundaries. For best results, structures that\n intersect with absorbing boundaries or simulation edges should extend all the way through. In many such\n cases, an \u201cinfinite\u201d size :class:`td.inf` can be used to define the size along that dimension.\n\nExample\n-------\n>>> from tidy3d import Box, Medium\n>>> box = Box(center=(0,0,1), size=(2, 2, 2))\n>>> glass = Medium(permittivity=3.9)\n>>> struct = Structure(geometry=box, medium=glass, name='glass_box')\n\nSee Also\n--------\n\n**Notebooks:**\n\n* `Quickstart <../../notebooks/StartHere.html>`_: Usage in a basic simulation flow.\n* `First walkthrough <../../notebooks/Simulation.html>`_: Usage in a basic simulation flow.\n* `Visualizing geometries in Tidy3D <../../notebooks/VizSimulation.html>`_\n\n**Lectures:**\n\n* `Using FDTD to Compute a Transmission Spectrum `_\n\n**GUI:**\n\n* `Structures `_", + "description": "Defines a physical object that interacts with the electromagnetic fields.\nA :class:`Structure` is a combination of a material property (:class:`AbstractMedium`)\nand a :class:`Geometry`.\n\nParameters\n----------\nattrs : dict = {}\n Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, ``attrs`` are mutable. For example, the following is allowed for setting an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ngeometry : Union[Box, Transformed, ClipOperation, GeometryGroup, Sphere, Cylinder, PolySlab, ComplexPolySlabBase, TriangleMesh]\n Defines geometric properties of the structure.\nname : Optional[str] = None\n Optional name for the structure.\nbackground_permittivity : Optional[ConstrainedFloatValue] = None\n DEPRECATED: Use ``Structure.background_medium``. Relative permittivity used for the background of this structure when performing shape optimization with autograd.\nbackground_medium : Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D, AnisotropicMediumFromMedium2D] = None\n Medium used for the background of this structure when performing shape optimization with autograd. This is required when the structure is embedded in another structure as autograd will use the permittivity of the ``Simulation`` by default to compute the shape derivatives.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D, AnisotropicMediumFromMedium2D]\n Defines the electromagnetic properties of the structure's medium.\n\nNotes\n------\n\n Structures can indeed be larger than the simulation domain in ``tidy3d``. In such cases, ``tidy3d`` will\n automatically truncate the geometry that goes beyond the domain boundaries. For best results, structures that\n intersect with absorbing boundaries or simulation edges should extend all the way through. In many such\n cases, an \u201cinfinite\u201d size :class:`td.inf` can be used to define the size along that dimension.\n\nExample\n-------\n>>> from tidy3d import Box, Medium\n>>> box = Box(center=(0,0,1), size=(2, 2, 2))\n>>> glass = Medium(permittivity=3.9)\n>>> struct = Structure(geometry=box, medium=glass, name='glass_box')\n\nSee Also\n--------\n\n**Notebooks:**\n\n* `Quickstart <../../notebooks/StartHere.html>`_: Usage in a basic simulation flow.\n* `First walkthrough <../../notebooks/Simulation.html>`_: Usage in a basic simulation flow.\n* `Visualizing geometries in Tidy3D <../../notebooks/VizSimulation.html>`_\n\n**Lectures:**\n\n* `Using FDTD to Compute a Transmission Spectrum `_\n\n**GUI:**\n\n* `Structures `_", "type": "object", "properties": { "attrs": { @@ -6441,10 +6443,76 @@ }, "background_permittivity": { "title": "Background Permittivity", - "description": "Relative permittivity used for the background of this structure when performing shape optimization with autograd.", + "description": "DEPRECATED: Use ``Structure.background_medium``. Relative permittivity used for the background of this structure when performing shape optimization with autograd.", "minimum": 1.0, "type": "number" }, + "background_medium": { + "title": "Background Medium", + "description": "Medium used for the background of this structure when performing shape optimization with autograd. This is required when the structure is embedded in another structure as autograd will use the permittivity of the ``Simulation`` by default to compute the shape derivatives.", + "anyOf": [ + { + "$ref": "#/definitions/Medium" + }, + { + "$ref": "#/definitions/AnisotropicMedium" + }, + { + "$ref": "#/definitions/PECMedium" + }, + { + "$ref": "#/definitions/PoleResidue" + }, + { + "$ref": "#/definitions/Sellmeier" + }, + { + "$ref": "#/definitions/Lorentz" + }, + { + "$ref": "#/definitions/Debye" + }, + { + "$ref": "#/definitions/Drude" + }, + { + "$ref": "#/definitions/FullyAnisotropicMedium" + }, + { + "$ref": "#/definitions/CustomMedium" + }, + { + "$ref": "#/definitions/CustomPoleResidue" + }, + { + "$ref": "#/definitions/CustomSellmeier" + }, + { + "$ref": "#/definitions/CustomLorentz" + }, + { + "$ref": "#/definitions/CustomDebye" + }, + { + "$ref": "#/definitions/CustomDrude" + }, + { + "$ref": "#/definitions/CustomAnisotropicMedium" + }, + { + "$ref": "#/definitions/PerturbationMedium" + }, + { + "$ref": "#/definitions/PerturbationPoleResidue" + }, + { + "$ref": "#/definitions/Medium2D" + }, + { + "$ref": "#/definitions/AnisotropicMediumFromMedium2D" + } + ] + }, "type": { "title": "Type", "default": "Structure", @@ -8991,7 +9059,7 @@ }, "PML": { "title": "PML", - "description": "Specifies a standard PML along a single dimension.\n\nParameters\n----------\nattrs : dict = {}\n Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, ``attrs`` are mutable. For example, the following is allowed for setting an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\nname : Optional[str] = None\n Optional unique name for boundary.\nnum_layers : NonNegativeInt = 12\n Number of layers of standard PML.\nparameters : PMLParams = PMLParams(attrs={}, sigma_order=3, sigma_min=0.0, sigma_max=1.5, type='PMLParams', kappa_order=3, kappa_min=1.0, kappa_max=3.0, alpha_order=1, alpha_min=0.0, alpha_max=0.0)\n Parameters of the complex frequency-shifted absorption poles.\n\nNotes\n------\n\n **1D Model Illustration**\n\n Consider a transformed wave equation in the :math:`x` dimension below _`[1]`:\n\n .. math::\n\n \\left( \\left( \\frac{1}{s(x)} \\frac{\\delta}{\\delta x} \\right)^2 - \\frac{1}{c^2} \\frac{\\delta^2}{\\delta t^2} \\right) E = 0\n\n where the wave stretch factor :math:`s(x)` depends on the PML boundary position in the :math:`x` dimension.\n\n .. TODO what is x at 0?\n\n .. math::\n\n s(x) = \\left \\{\n \\begin{array}{lr}\n 1, & \\text{for } x < 0 \\\\\n 1 - \\frac{\\sigma}{i \\omega \\epsilon_0}, & \\text{for } x > 0\n \\end{array}\n \\right \\}\n\n The wave equation can be solved and plotted accordingly as a function of the :math:`x` dimension.\n\n .. math::\n\n E(x) = \\left \\{\n \\begin{array}{lr}\n e^{i(kx - \\omega t)}, & \\text{for } x < 0 \\\\\n e^{i(kx - \\omega t)} \\times e^{-\\frac{\\sigma x}{c \\epsilon_0}} & \\text{for } x > 0\n \\end{array}\n \\right \\}\n\n Hence, we see how this PML stretch factor induces frequency-independent exponential attentation and no\n reflection after the boundary at :math:`x=0`.\n\n .. image:: ../../_static/img/pml_boundary.png\n\n .. TODO make this image better\n\n **Usage Caveats**\n\n A perfectly matched layer (PML) is the most commonly used boundary condition in FDTD simulations to truncate\n a simulation domain and absorb outgoing radiation. However, many divergence issues are associated with the\n use of PML. One of the most common causes of a diverged simulation is structures inserted into PML at an angle.\n\n .. TODO links to absorber boundaries\n\n .. image:: ../../notebooks/img/diverged-fdtd-simulation.png\n\n Incorporating a dispersive material into the PML can also cause simulation divergence in certain scenarios.\n If your simulation lacks any structures inserted into the PML at an angle, but includes dispersive material\n in PML, it is advisable to substitute a nondispersive material for the dispersive material. Alternatively,\n if dispersion is necessary, switching from the :class:`PML` to :class:`Absorber` can effectively address the\n issue.\n\n The PML can effectively absorb outgoing radiation with minimum reflection as if the radiation just propagates\n into the free space. However, it\u2019s important to keep in mind that the PML only absorbs propagating fields. For\n evanescent fields, the PML can act as an amplification medium and cause a simulation to diverge. In Tidy3D,\n a warning will appear if the distance between a structure is smaller than half of a wavelength to prevent\n evanescent fields from leaking into PML. In most cases, the evanescent field will naturally die off within\n half a wavelength, but in some instances, a larger distance may be required.\n\n .. image:: ../../notebooks/img/diverged-fdtd-simulation1.png\n\n\n **References**\n\n .. [1] W.C. Chew and W.H. Weedon, Microwave and Optical Tech. Lett., 7 (13), 599,1994; S. Johnson, arXiv 2108.05348, 2021\n .. [2] Antonios Giannopoulos, IEEE Transactions on Antennas and Propagation, 56(9), 2995, 2008\n\nNote\n----\n\n For best results, structures that intersect with the PML or simulation edges should extend extend all the way\n through. In many such cases, an \u201cinfinite\u201d size ``td.inf`` can be used to define the size along that dimension.\n\nExample\n-------\n>>> pml = PML(num_layers=10)\n\nSee Also\n--------\n\n:class:`StablePML`:\n This PML deals handles possibly divergent simulations better, but at the expense of more layers.\n\n:class:`Absorber`:\n Specifies an adiabatic absorber along a single dimension.\n\n**Notebooks:**\n * `How to troubleshoot a diverged FDTD simulation <../../notebooks/DivergedFDTDSimulation.html>`_\n\n**Lectures:**\n * `Using FDTD to Compute a Transmission Spectrum `__\n * `Introduction to perfectly matched layer (PML) tutorial `__", + "description": "Specifies a standard PML along a single dimension.\n\nParameters\n----------\nattrs : dict = {}\n Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, ``attrs`` are mutable. For example, the following is allowed for setting an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\nname : Optional[str] = None\n Optional unique name for boundary.\nnum_layers : ConstrainedIntValue = 12\n Number of layers of standard PML.\nparameters : PMLParams = PMLParams(attrs={}, sigma_order=3, sigma_min=0.0, sigma_max=1.5, type='PMLParams', kappa_order=3, kappa_min=1.0, kappa_max=3.0, alpha_order=1, alpha_min=0.0, alpha_max=0.0)\n Parameters of the complex frequency-shifted absorption poles.\n\nNotes\n------\n\n **1D Model Illustration**\n\n Consider a transformed wave equation in the :math:`x` dimension below _`[1]`:\n\n .. math::\n\n \\left( \\left( \\frac{1}{s(x)} \\frac{\\delta}{\\delta x} \\right)^2 - \\frac{1}{c^2} \\frac{\\delta^2}{\\delta t^2} \\right) E = 0\n\n where the wave stretch factor :math:`s(x)` depends on the PML boundary position in the :math:`x` dimension.\n\n .. TODO what is x at 0?\n\n .. math::\n\n s(x) = \\left \\{\n \\begin{array}{lr}\n 1, & \\text{for } x < 0 \\\\\n 1 - \\frac{\\sigma}{i \\omega \\epsilon_0}, & \\text{for } x > 0\n \\end{array}\n \\right \\}\n\n The wave equation can be solved and plotted accordingly as a function of the :math:`x` dimension.\n\n .. math::\n\n E(x) = \\left \\{\n \\begin{array}{lr}\n e^{i(kx - \\omega t)}, & \\text{for } x < 0 \\\\\n e^{i(kx - \\omega t)} \\times e^{-\\frac{\\sigma x}{c \\epsilon_0}} & \\text{for } x > 0\n \\end{array}\n \\right \\}\n\n Hence, we see how this PML stretch factor induces frequency-independent exponential attentation and no\n reflection after the boundary at :math:`x=0`.\n\n .. image:: ../../_static/img/pml_boundary.png\n\n .. TODO make this image better\n\n **Usage Caveats**\n\n A perfectly matched layer (PML) is the most commonly used boundary condition in FDTD simulations to truncate\n a simulation domain and absorb outgoing radiation. However, many divergence issues are associated with the\n use of PML. One of the most common causes of a diverged simulation is structures inserted into PML at an angle.\n\n .. TODO links to absorber boundaries\n\n .. image:: ../../notebooks/img/diverged-fdtd-simulation.png\n\n Incorporating a dispersive material into the PML can also cause simulation divergence in certain scenarios.\n If your simulation lacks any structures inserted into the PML at an angle, but includes dispersive material\n in PML, it is advisable to substitute a nondispersive material for the dispersive material. Alternatively,\n if dispersion is necessary, switching from the :class:`PML` to :class:`Absorber` can effectively address the\n issue.\n\n The PML can effectively absorb outgoing radiation with minimum reflection as if the radiation just propagates\n into the free space. However, it\u2019s important to keep in mind that the PML only absorbs propagating fields. For\n evanescent fields, the PML can act as an amplification medium and cause a simulation to diverge. In Tidy3D,\n a warning will appear if the distance between a structure is smaller than half of a wavelength to prevent\n evanescent fields from leaking into PML. In most cases, the evanescent field will naturally die off within\n half a wavelength, but in some instances, a larger distance may be required.\n\n .. image:: ../../notebooks/img/diverged-fdtd-simulation1.png\n\n\n **References**\n\n .. [1] W.C. Chew and W.H. Weedon, Microwave and Optical Tech. Lett., 7 (13), 599,1994; S. Johnson, arXiv 2108.05348, 2021\n .. [2] Antonios Giannopoulos, IEEE Transactions on Antennas and Propagation, 56(9), 2995, 2008\n\nNote\n----\n\n For best results, structures that intersect with the PML or simulation edges should extend extend all the way\n through. In many such cases, an \u201cinfinite\u201d size ``td.inf`` can be used to define the size along that dimension.\n\nExample\n-------\n>>> pml = PML(num_layers=10)\n\nSee Also\n--------\n\n:class:`StablePML`:\n This PML deals handles possibly divergent simulations better, but at the expense of more layers.\n\n:class:`Absorber`:\n Specifies an adiabatic absorber along a single dimension.\n\n**Notebooks:**\n * `How to troubleshoot a diverged FDTD simulation <../../notebooks/DivergedFDTDSimulation.html>`_\n\n**Lectures:**\n * `Using FDTD to Compute a Transmission Spectrum `__\n * `Introduction to perfectly matched layer (PML) tutorial `__", "type": "object", "properties": { "attrs": { @@ -9017,7 +9085,7 @@ "title": "Number of Layers", "description": "Number of layers of standard PML.", "default": 12, - "minimum": 0, + "minimum": 6, "type": "integer" }, "parameters": { @@ -9047,7 +9115,7 @@ }, "StablePML": { "title": "StablePML", - "description": "Specifies a 'stable' PML along a single dimension.\nThis PML deals handles possibly divergent simulations better, but at the expense of more layers.\n\nParameters\n----------\nattrs : dict = {}\n Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, ``attrs`` are mutable. For example, the following is allowed for setting an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\nname : Optional[str] = None\n Optional unique name for boundary.\nnum_layers : NonNegativeInt = 40\n Number of layers of 'stable' PML.\nparameters : PMLParams = PMLParams(attrs={}, sigma_order=3, sigma_min=0.0, sigma_max=1.0, type='PMLParams', kappa_order=3, kappa_min=1.0, kappa_max=5.0, alpha_order=1, alpha_min=0.0, alpha_max=0.9)\n 'Stable' parameters of the complex frequency-shifted absorption poles.\n\nExample\n-------\n>>> pml = StablePML(num_layers=40)\n\nSee Also\n--------\n\n:class:`PML`:\n A standard PML along a single dimension.\n\n:class:`Absorber`:\n Specifies an adiabatic absorber along a single dimension.\n\n**Notebooks:**\n * `How to troubleshoot a diverged FDTD simulation <../../notebooks/DivergedFDTDSimulation.html>`_\n\n**Lectures:**\n * `Introduction to perfectly matched layer (PML) tutorial `__", + "description": "Specifies a 'stable' PML along a single dimension.\nThis PML deals handles possibly divergent simulations better, but at the expense of more layers.\n\nParameters\n----------\nattrs : dict = {}\n Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, ``attrs`` are mutable. For example, the following is allowed for setting an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\nname : Optional[str] = None\n Optional unique name for boundary.\nnum_layers : ConstrainedIntValue = 40\n Number of layers of 'stable' PML.\nparameters : PMLParams = PMLParams(attrs={}, sigma_order=3, sigma_min=0.0, sigma_max=1.0, type='PMLParams', kappa_order=3, kappa_min=1.0, kappa_max=5.0, alpha_order=1, alpha_min=0.0, alpha_max=0.9)\n 'Stable' parameters of the complex frequency-shifted absorption poles.\n\nExample\n-------\n>>> pml = StablePML(num_layers=40)\n\nSee Also\n--------\n\n:class:`PML`:\n A standard PML along a single dimension.\n\n:class:`Absorber`:\n Specifies an adiabatic absorber along a single dimension.\n\n**Notebooks:**\n * `How to troubleshoot a diverged FDTD simulation <../../notebooks/DivergedFDTDSimulation.html>`_\n\n**Lectures:**\n * `Introduction to perfectly matched layer (PML) tutorial `__", "type": "object", "properties": { "attrs": { @@ -9073,7 +9141,7 @@ "title": "Number of Layers", "description": "Number of layers of 'stable' PML.", "default": 40, - "minimum": 0, + "minimum": 6, "type": "integer" }, "parameters": { @@ -9148,7 +9216,7 @@ }, "Absorber": { "title": "Absorber", - "description": "Specifies an adiabatic absorber along a single dimension.\n\nParameters\n----------\nattrs : dict = {}\n Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, ``attrs`` are mutable. For example, the following is allowed for setting an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\nname : Optional[str] = None\n Optional unique name for boundary.\nnum_layers : NonNegativeInt = 40\n Number of layers of absorber to add to + and - boundaries.\nparameters : AbsorberParams = AbsorberParams(attrs={}, sigma_order=3, sigma_min=0.0, sigma_max=6.4, type='AbsorberParams')\n Adiabatic absorber parameters.\n\nNotes\n-----\n\n This absorber is well-suited for dispersive materials intersecting with absorbing edges of the simulation at the\n expense of more layers.\n\n **Usage Caveats**\n\n Using absorber boundary is often a good remedy to resolve divergence issues related to :class:`PML`. The\n adiabatic absorber is a multilayer system with gradually increasing conductivity. The absorber usually has a\n larger undesired reflection compared to :class:`PML`. In practice, this small difference rarely matters,\n but is important to understand for simulations that require high accuracy.\n\n There are two possible sources for the reflection from absorbers. The first, and more common one, is that the\n ramping up of the conductivity is not sufficiently slow, which can be remedied by increasing the number of\n absorber layers (40 by default). The second one is that the absorption is not high enough, such that the\n light reaches the :class:`PEC` boundary at the end of the :class:`Absorber`, travels back through it,\n and is still not fully attenuated before re-entering the simulation region. If this is the case, increasing\n the maximum conductivity :class:`AbsorberParams` can help. In both cases, changing the order of the scaling\n of the conductivity (:attr:`tidy3d.AbsorberParams.sigma_order`) can also have an effect, but this is a more\n advanced setting that we typically do not recommend modifying.\n\nExample\n-------\n>>> pml = Absorber(num_layers=40)\n\nSee Also\n--------\n\n:class:`PML`:\n A standard PML along a single dimension.\n\n**Notebooks:**\n * `How to troubleshoot a diverged FDTD simulation <../../notebooks/DivergedFDTDSimulation.html>`_", + "description": "Specifies an adiabatic absorber along a single dimension.\n\nParameters\n----------\nattrs : dict = {}\n Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, ``attrs`` are mutable. For example, the following is allowed for setting an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\nname : Optional[str] = None\n Optional unique name for boundary.\nnum_layers : ConstrainedIntValue = 40\n Number of layers of absorber to add to + and - boundaries.\nparameters : AbsorberParams = AbsorberParams(attrs={}, sigma_order=3, sigma_min=0.0, sigma_max=6.4, type='AbsorberParams')\n Adiabatic absorber parameters.\n\nNotes\n-----\n\n This absorber is well-suited for dispersive materials intersecting with absorbing edges of the simulation at the\n expense of more layers.\n\n **Usage Caveats**\n\n Using absorber boundary is often a good remedy to resolve divergence issues related to :class:`PML`. The\n adiabatic absorber is a multilayer system with gradually increasing conductivity. The absorber usually has a\n larger undesired reflection compared to :class:`PML`. In practice, this small difference rarely matters,\n but is important to understand for simulations that require high accuracy.\n\n There are two possible sources for the reflection from absorbers. The first, and more common one, is that the\n ramping up of the conductivity is not sufficiently slow, which can be remedied by increasing the number of\n absorber layers (40 by default). The second one is that the absorption is not high enough, such that the\n light reaches the :class:`PEC` boundary at the end of the :class:`Absorber`, travels back through it,\n and is still not fully attenuated before re-entering the simulation region. If this is the case, increasing\n the maximum conductivity :class:`AbsorberParams` can help. In both cases, changing the order of the scaling\n of the conductivity (:attr:`tidy3d.AbsorberParams.sigma_order`) can also have an effect, but this is a more\n advanced setting that we typically do not recommend modifying.\n\nExample\n-------\n>>> pml = Absorber(num_layers=40)\n\nSee Also\n--------\n\n:class:`PML`:\n A standard PML along a single dimension.\n\n**Notebooks:**\n * `How to troubleshoot a diverged FDTD simulation <../../notebooks/DivergedFDTDSimulation.html>`_", "type": "object", "properties": { "attrs": { @@ -9174,7 +9242,7 @@ "title": "Number of Layers", "description": "Number of layers of absorber to add to + and - boundaries.", "default": 40, - "minimum": 0, + "minimum": 6, "type": "integer" }, "parameters": { @@ -12790,7 +12858,7 @@ }, "MeshOverrideStructure": { "title": "MeshOverrideStructure", - "description": "Defines an object that is only used in the process of generating the mesh.\n\nParameters\n----------\nattrs : dict = {}\n Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, ``attrs`` are mutable. For example, the following is allowed for setting an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ngeometry : Union[Box, Transformed, ClipOperation, GeometryGroup, Sphere, Cylinder, PolySlab, ComplexPolySlabBase, TriangleMesh]\n Defines geometric properties of the structure.\nname : Optional[str] = None\n Optional name for the structure.\nbackground_permittivity : Optional[ConstrainedFloatValue] = None\n Relative permittivity used for the background of this structure when performing shape optimization with autograd.\ndl : Tuple[PositiveFloat, PositiveFloat, PositiveFloat]\n [units = um]. Grid size along x, y, z directions.\nenforce : bool = False\n If ``True``, enforce the grid size setup inside the structure even if the structure is inside a structure of smaller grid size. In the intersection region of multiple structures of ``enforce=True``, grid size is decided by the last added structure of ``enforce=True``.\n\nNotes\n-----\n\n A :class:`MeshOverrideStructure` is a combination of geometry :class:`Geometry`,\n grid size along ``x``, ``y``, ``z`` directions, and a boolean on whether the override\n will be enforced.\n\nExample\n-------\n>>> from tidy3d import Box\n>>> box = Box(center=(0,0,1), size=(2, 2, 2))\n>>> struct_override = MeshOverrideStructure(geometry=box, dl=(0.1,0.2,0.3), name='override_box')", + "description": "Defines an object that is only used in the process of generating the mesh.\n\nParameters\n----------\nattrs : dict = {}\n Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, ``attrs`` are mutable. For example, the following is allowed for setting an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ngeometry : Union[Box, Transformed, ClipOperation, GeometryGroup, Sphere, Cylinder, PolySlab, ComplexPolySlabBase, TriangleMesh]\n Defines geometric properties of the structure.\nname : Optional[str] = None\n Optional name for the structure.\nbackground_permittivity : Optional[ConstrainedFloatValue] = None\n DEPRECATED: Use ``Structure.background_medium``. Relative permittivity used for the background of this structure when performing shape optimization with autograd.\nbackground_medium : Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D, AnisotropicMediumFromMedium2D] = None\n Medium used for the background of this structure when performing shape optimization with autograd. This is required when the structure is embedded in another structure as autograd will use the permittivity of the ``Simulation`` by default to compute the shape derivatives.\ndl : Tuple[PositiveFloat, PositiveFloat, PositiveFloat]\n [units = um]. Grid size along x, y, z directions.\nenforce : bool = False\n If ``True``, enforce the grid size setup inside the structure even if the structure is inside a structure of smaller grid size. In the intersection region of multiple structures of ``enforce=True``, grid size is decided by the last added structure of ``enforce=True``.\n\nNotes\n-----\n\n A :class:`MeshOverrideStructure` is a combination of geometry :class:`Geometry`,\n grid size along ``x``, ``y``, ``z`` directions, and a boolean on whether the override\n will be enforced.\n\nExample\n-------\n>>> from tidy3d import Box\n>>> box = Box(center=(0,0,1), size=(2, 2, 2))\n>>> struct_override = MeshOverrideStructure(geometry=box, dl=(0.1,0.2,0.3), name='override_box')", "type": "object", "properties": { "attrs": { @@ -12853,10 +12921,76 @@ }, "background_permittivity": { "title": "Background Permittivity", - "description": "Relative permittivity used for the background of this structure when performing shape optimization with autograd.", + "description": "DEPRECATED: Use ``Structure.background_medium``. Relative permittivity used for the background of this structure when performing shape optimization with autograd.", "minimum": 1.0, "type": "number" }, + "background_medium": { + "title": "Background Medium", + "description": "Medium used for the background of this structure when performing shape optimization with autograd. This is required when the structure is embedded in another structure as autograd will use the permittivity of the ``Simulation`` by default to compute the shape derivatives.", + "anyOf": [ + { + "$ref": "#/definitions/Medium" + }, + { + "$ref": "#/definitions/AnisotropicMedium" + }, + { + "$ref": "#/definitions/PECMedium" + }, + { + "$ref": "#/definitions/PoleResidue" + }, + { + "$ref": "#/definitions/Sellmeier" + }, + { + "$ref": "#/definitions/Lorentz" + }, + { + "$ref": "#/definitions/Debye" + }, + { + "$ref": "#/definitions/Drude" + }, + { + "$ref": "#/definitions/FullyAnisotropicMedium" + }, + { + "$ref": "#/definitions/CustomMedium" + }, + { + "$ref": "#/definitions/CustomPoleResidue" + }, + { + "$ref": "#/definitions/CustomSellmeier" + }, + { + "$ref": "#/definitions/CustomLorentz" + }, + { + "$ref": "#/definitions/CustomDebye" + }, + { + "$ref": "#/definitions/CustomDrude" + }, + { + "$ref": "#/definitions/CustomAnisotropicMedium" + }, + { + "$ref": "#/definitions/PerturbationMedium" + }, + { + "$ref": "#/definitions/PerturbationPoleResidue" + }, + { + "$ref": "#/definitions/Medium2D" + }, + { + "$ref": "#/definitions/AnisotropicMediumFromMedium2D" + } + ] + }, "type": { "title": "Type", "default": "MeshOverrideStructure",