diff --git a/tidy3d/components/geometry/polyslab.py b/tidy3d/components/geometry/polyslab.py index d0076b197..77ba405cb 100644 --- a/tidy3d/components/geometry/polyslab.py +++ b/tidy3d/components/geometry/polyslab.py @@ -53,7 +53,7 @@ class PolySlab(base.Planar): ) vertices: ArrayFloat2D = pydantic.Field( - ArrayFloat2D, + ..., title="Vertices", description="List of (d1, d2) defining the 2 dimensional positions of the polygon " "face vertices at the ``reference_plane``. " diff --git a/tidy3d/schema.json b/tidy3d/schema.json index e004e523a..ef79ad945 100644 --- a/tidy3d/schema.json +++ b/tidy3d/schema.json @@ -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, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium] = Medium(name=None, frequency_range=None, allow_gain=False, 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, 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.\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, 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(x=Boundary(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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``, 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 = 2.4.0rc1\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=(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... 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, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue] = Medium(name=None, frequency_range=None, allow_gain=False, nonlinear_spec=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, 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.\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, 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(x=Boundary(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(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 = 2.4.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=(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... )", "type": "object", "properties": { "type": { @@ -71,11 +71,35 @@ "name": null, "frequency_range": null, "allow_gain": false, + "nonlinear_spec": null, "type": "Medium", "permittivity": 1.0, "conductivity": 0.0 }, - "anyOf": [ + "discriminator": { + "propertyName": "type", + "mapping": { + "Medium": "#/definitions/Medium", + "AnisotropicMedium": "#/definitions/AnisotropicMedium", + "PECMedium": "#/definitions/PECMedium", + "PoleResidue": "#/definitions/PoleResidue", + "Sellmeier": "#/definitions/Sellmeier", + "Lorentz": "#/definitions/Lorentz", + "Debye": "#/definitions/Debye", + "Drude": "#/definitions/Drude", + "FullyAnisotropicMedium": "#/definitions/FullyAnisotropicMedium", + "CustomMedium": "#/definitions/CustomMedium", + "CustomPoleResidue": "#/definitions/CustomPoleResidue", + "CustomSellmeier": "#/definitions/CustomSellmeier", + "CustomLorentz": "#/definitions/CustomLorentz", + "CustomDebye": "#/definitions/CustomDebye", + "CustomDrude": "#/definitions/CustomDrude", + "CustomAnisotropicMedium": "#/definitions/CustomAnisotropicMedium", + "PerturbationMedium": "#/definitions/PerturbationMedium", + "PerturbationPoleResidue": "#/definitions/PerturbationPoleResidue" + } + }, + "oneOf": [ { "$ref": "#/definitions/Medium" }, @@ -123,6 +147,12 @@ }, { "$ref": "#/definitions/CustomAnisotropicMedium" + }, + { + "$ref": "#/definitions/PerturbationMedium" + }, + { + "$ref": "#/definitions/PerturbationPoleResidue" } ] }, @@ -226,7 +256,7 @@ }, "boundary_spec": { "title": "Boundaries", - "description": "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.", + "description": "Specification of boundary conditions along each dimension. If ``None``, PML boundary conditions are applied on all sides.", "default": { "x": { "plus": { @@ -478,7 +508,7 @@ "version": { "title": "Version", "description": "String specifying the front end version number.", - "default": "2.4.0rc1", + "default": "2.4.0rc2", "type": "string" } }, @@ -488,9 +518,41 @@ ], "additionalProperties": false, "definitions": { + "NonlinearSusceptibility": { + "title": "NonlinearSusceptibility", + "description": "Specification adding an instantaneous nonlinear susceptibility to a medium.\n\nParameters\n----------\nnumiters : PositiveInt = 1\n Number of iterations for solving nonlinear constitutive relation.\nchi3 : float\n [units = um^2 / V^2]. Chi3 nonlinear susceptibility.\n\nNote\n----\nThe instantaneous nonlinear polarization is given by\n.. math::\n\n P_{NL} = \\epsilon_0 \\chi_3 |E|^2 E\n\nNote\n----\nThe nonlinear constitutive relation is solved iteratively; it may not converge\nfor strong nonlinearities. Increasing `numiters` can help with convergence.\n\nNote\n----\nFor complex fields (e.g. when using Bloch boundary conditions), the nonlinearity\nis applied separately to the real and imaginary parts, so that the above equation\nholds when both E and :math:`P_{NL}` are replaced by their real or imaginary parts.\nThe nonlinearity is only applied to the real-valued fields since they are the\nphysical fields.\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>>> medium = Medium(permittivity=2, nonlinear_spec=NonlinearSusceptibility(chi3=1))", + "type": "object", + "properties": { + "numiters": { + "title": "Number of iterations", + "description": "Number of iterations for solving nonlinear constitutive relation.", + "default": 1, + "exclusiveMinimum": 0, + "type": "integer" + }, + "type": { + "title": "Type", + "default": "NonlinearSusceptibility", + "enum": [ + "NonlinearSusceptibility" + ], + "type": "string" + }, + "chi3": { + "title": "Chi3", + "description": "Chi3 nonlinear susceptibility.", + "units": "um^2 / V^2", + "type": "number" + } + }, + "required": [ + "chi3" + ], + "additionalProperties": false + }, "Medium": { "title": "Medium", - "description": "Dispersionless medium.\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\npermittivity : ConstrainedFloatValue = 1.0\n [units = None (relative permittivity)]. Relative permittivity.\nconductivity : float = 0.0\n [units = S/um]. Electric conductivity. Defined such that the imaginary part of the complex permittivity at angular frequency omega is given by conductivity/omega.\n\nExample\n-------\n>>> dielectric = Medium(permittivity=4.0, name='my_medium')\n>>> eps = dielectric.eps_model(200e12)", + "description": "Dispersionless medium.\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\npermittivity : ConstrainedFloatValue = 1.0\n [units = None (relative permittivity)]. Relative permittivity.\nconductivity : float = 0.0\n [units = S/um]. Electric conductivity. Defined such that the imaginary part of the complex permittivity at angular frequency omega is given by conductivity/omega.\n\nExample\n-------\n>>> dielectric = Medium(permittivity=4.0, name='my_medium')\n>>> eps = dielectric.eps_model(200e12)", "type": "object", "properties": { "name": { @@ -523,6 +585,15 @@ "default": false, "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "Medium", @@ -570,7 +641,7 @@ }, "PoleResidue": { "title": "PoleResidue", - "description": "A dispersive medium described by the pole-residue pair model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\neps_inf : PositiveFloat = 1.0\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\npoles : Tuple[Tuple[Union[tidy3d.components.types.tidycomplex, tidy3d.components.types.ComplexNumber], Union[tidy3d.components.types.tidycomplex, tidy3d.components.types.ComplexNumber]], ...] = ()\n [units = (rad/sec, rad/sec)]. Tuple of complex-valued (:math:`a_i, c_i`) poles for the model.\n\nNote\n----\n.. math::\n\n \\epsilon(\\omega) = \\epsilon_\\infty - \\sum_i\n \\left[\\frac{c_i}{j \\omega + a_i} +\n \\frac{c_i^*}{j \\omega + a_i^*}\\right]\n\nExample\n-------\n>>> pole_res = PoleResidue(eps_inf=2.0, poles=[((-1+2j), (3+4j)), ((-5+6j), (7+8j))])\n>>> eps = pole_res.eps_model(200e12)", + "description": "A dispersive medium described by the pole-residue pair model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\neps_inf : PositiveFloat = 1.0\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\npoles : Tuple[Tuple[Union[tidy3d.components.types.tidycomplex, tidy3d.components.types.ComplexNumber], Union[tidy3d.components.types.tidycomplex, tidy3d.components.types.ComplexNumber]], ...] = ()\n [units = (rad/sec, rad/sec)]. Tuple of complex-valued (:math:`a_i, c_i`) poles for the model.\n\nNote\n----\n.. math::\n\n \\epsilon(\\omega) = \\epsilon_\\infty - \\sum_i\n \\left[\\frac{c_i}{j \\omega + a_i} +\n \\frac{c_i^*}{j \\omega + a_i^*}\\right]\n\nExample\n-------\n>>> pole_res = PoleResidue(eps_inf=2.0, poles=[((-1+2j), (3+4j)), ((-5+6j), (7+8j))])\n>>> eps = pole_res.eps_model(200e12)", "type": "object", "properties": { "name": { @@ -603,6 +674,15 @@ "default": false, "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "PoleResidue", @@ -693,7 +773,7 @@ }, "Sellmeier": { "title": "Sellmeier", - "description": "A dispersive medium described by the Sellmeier model.\nThe frequency-dependence of the refractive index is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\ncoeffs : Tuple[Tuple[float, pydantic.types.PositiveFloat], ...]\n [units = (None, um^2)]. List of Sellmeier (:math:`B_i, C_i`) coefficients.\n\nNote\n----\n.. math::\n\n n(\\lambda)^2 = 1 + \\sum_i \\frac{B_i \\lambda^2}{\\lambda^2 - C_i}\n\nExample\n-------\n>>> sellmeier_medium = Sellmeier(coeffs=[(1,2), (3,4)])\n>>> eps = sellmeier_medium.eps_model(200e12)", + "description": "A dispersive medium described by the Sellmeier model.\nThe frequency-dependence of the refractive index is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\ncoeffs : Tuple[Tuple[float, pydantic.v1.types.PositiveFloat], ...]\n [units = (None, um^2)]. List of Sellmeier (:math:`B_i, C_i`) coefficients.\n\nNote\n----\n.. math::\n\n n(\\lambda)^2 = 1 + \\sum_i \\frac{B_i \\lambda^2}{\\lambda^2 - C_i}\n\nExample\n-------\n>>> sellmeier_medium = Sellmeier(coeffs=[(1,2), (3,4)])\n>>> eps = sellmeier_medium.eps_model(200e12)", "type": "object", "properties": { "name": { @@ -726,6 +806,15 @@ "default": false, "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "Sellmeier", @@ -765,7 +854,7 @@ }, "Lorentz": { "title": "Lorentz", - "description": "A dispersive medium described by the Lorentz model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\neps_inf : PositiveFloat = 1.0\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[float, float, pydantic.types.NonNegativeFloat], ...]\n [units = (None (relative permittivity), Hz, Hz)]. List of (:math:`\\Delta\\epsilon_i, f_i, \\delta_i`) values for model.\n\nNote\n----\n.. math::\n\n \\epsilon(f) = \\epsilon_\\infty + \\sum_i\n \\frac{\\Delta\\epsilon_i f_i^2}{f_i^2 - 2jf\\delta_i - f^2}\n\nExample\n-------\n>>> lorentz_medium = Lorentz(eps_inf=2.0, coeffs=[(1,2,3), (4,5,6)])\n>>> eps = lorentz_medium.eps_model(200e12)", + "description": "A dispersive medium described by the Lorentz model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\neps_inf : PositiveFloat = 1.0\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[float, float, pydantic.v1.types.NonNegativeFloat], ...]\n [units = (None (relative permittivity), Hz, Hz)]. List of (:math:`\\Delta\\epsilon_i, f_i, \\delta_i`) values for model.\n\nNote\n----\n.. math::\n\n \\epsilon(f) = \\epsilon_\\infty + \\sum_i\n \\frac{\\Delta\\epsilon_i f_i^2}{f_i^2 - 2jf\\delta_i - f^2}\n\nExample\n-------\n>>> lorentz_medium = Lorentz(eps_inf=2.0, coeffs=[(1,2,3), (4,5,6)])\n>>> eps = lorentz_medium.eps_model(200e12)", "type": "object", "properties": { "name": { @@ -798,6 +887,15 @@ "default": false, "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "Lorentz", @@ -849,7 +947,7 @@ }, "Debye": { "title": "Debye", - "description": "A dispersive medium described by the Debye model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\neps_inf : PositiveFloat = 1.0\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[float, pydantic.types.PositiveFloat], ...]\n [units = (None (relative permittivity), sec)]. List of (:math:`\\Delta\\epsilon_i, \\tau_i`) values for model.\n\nNote\n----\n.. math::\n\n \\epsilon(f) = \\epsilon_\\infty + \\sum_i\n \\frac{\\Delta\\epsilon_i}{1 - jf\\tau_i}\n\nExample\n-------\n>>> debye_medium = Debye(eps_inf=2.0, coeffs=[(1,2),(3,4)])\n>>> eps = debye_medium.eps_model(200e12)", + "description": "A dispersive medium described by the Debye model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\neps_inf : PositiveFloat = 1.0\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[float, pydantic.v1.types.PositiveFloat], ...]\n [units = (None (relative permittivity), sec)]. List of (:math:`\\Delta\\epsilon_i, \\tau_i`) values for model.\n\nNote\n----\n.. math::\n\n \\epsilon(f) = \\epsilon_\\infty + \\sum_i\n \\frac{\\Delta\\epsilon_i}{1 - jf\\tau_i}\n\nExample\n-------\n>>> debye_medium = Debye(eps_inf=2.0, coeffs=[(1,2),(3,4)])\n>>> eps = debye_medium.eps_model(200e12)", "type": "object", "properties": { "name": { @@ -882,6 +980,15 @@ "default": false, "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "Debye", @@ -929,7 +1036,7 @@ }, "Drude": { "title": "Drude", - "description": "A dispersive medium described by the Drude model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\neps_inf : PositiveFloat = 1.0\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[float, pydantic.types.PositiveFloat], ...]\n [units = (Hz, Hz)]. List of (:math:`f_i, \\delta_i`) values for model.\n\nNote\n----\n.. math::\n\n \\epsilon(f) = \\epsilon_\\infty - \\sum_i\n \\frac{ f_i^2}{f^2 + jf\\delta_i}\n\nExample\n-------\n>>> drude_medium = Drude(eps_inf=2.0, coeffs=[(1,2), (3,4)])\n>>> eps = drude_medium.eps_model(200e12)", + "description": "A dispersive medium described by the Drude model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\neps_inf : PositiveFloat = 1.0\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[float, pydantic.v1.types.PositiveFloat], ...]\n [units = (Hz, Hz)]. List of (:math:`f_i, \\delta_i`) values for model.\n\nNote\n----\n.. math::\n\n \\epsilon(f) = \\epsilon_\\infty - \\sum_i\n \\frac{ f_i^2}{f^2 + jf\\delta_i}\n\nExample\n-------\n>>> drude_medium = Drude(eps_inf=2.0, coeffs=[(1,2), (3,4)])\n>>> eps = drude_medium.eps_model(200e12)", "type": "object", "properties": { "name": { @@ -962,6 +1069,15 @@ "default": false, "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "Drude", @@ -1009,7 +1125,7 @@ }, "AnisotropicMedium": { "title": "AnisotropicMedium", - "description": "Diagonally anisotropic medium.\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : Optional[bool] = None\n This field is ignored. Please set ``allow_gain`` in each component\nxx : Union[Medium, PoleResidue, Sellmeier, Lorentz, Debye, Drude]\n Medium describing the xx-component of the diagonal permittivity tensor.\nyy : Union[Medium, PoleResidue, Sellmeier, Lorentz, Debye, Drude]\n Medium describing the yy-component of the diagonal permittivity tensor.\nzz : Union[Medium, PoleResidue, Sellmeier, Lorentz, Debye, Drude]\n Medium describing the zz-component of the diagonal permittivity tensor.\n\nNote\n----\nOnly diagonal anisotropy is currently supported.\n\nExample\n-------\n>>> medium_xx = Medium(permittivity=4.0)\n>>> medium_yy = Medium(permittivity=4.1)\n>>> medium_zz = Medium(permittivity=3.9)\n>>> anisotropic_dielectric = AnisotropicMedium(xx=medium_xx, yy=medium_yy, zz=medium_zz)", + "description": "Diagonally anisotropic medium.\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : Optional[bool] = None\n This field is ignored. Please set ``allow_gain`` in each component\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\nxx : Union[Medium, PoleResidue, Sellmeier, Lorentz, Debye, Drude]\n Medium describing the xx-component of the diagonal permittivity tensor.\nyy : Union[Medium, PoleResidue, Sellmeier, Lorentz, Debye, Drude]\n Medium describing the yy-component of the diagonal permittivity tensor.\nzz : Union[Medium, PoleResidue, Sellmeier, Lorentz, Debye, Drude]\n Medium describing the zz-component of the diagonal permittivity tensor.\n\nNote\n----\nOnly diagonal anisotropy is currently supported.\n\nExample\n-------\n>>> medium_xx = Medium(permittivity=4.0)\n>>> medium_yy = Medium(permittivity=4.1)\n>>> medium_zz = Medium(permittivity=3.9)\n>>> anisotropic_dielectric = AnisotropicMedium(xx=medium_xx, yy=medium_yy, zz=medium_zz)", "type": "object", "properties": { "name": { @@ -1041,6 +1157,15 @@ "description": "This field is ignored. Please set ``allow_gain`` in each component", "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "AnisotropicMedium", @@ -1164,7 +1289,7 @@ }, "PECMedium": { "title": "PECMedium", - "description": "Perfect electrical conductor class.\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\n\nNote\n----\nTo avoid confusion from duplicate PECs, must import ``tidy3d.PEC`` instance directly.", + "description": "Perfect electrical conductor class.\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\n\nNote\n----\nTo avoid confusion from duplicate PECs, must import ``tidy3d.PEC`` instance directly.", "type": "object", "properties": { "name": { @@ -1197,6 +1322,15 @@ "default": false, "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "PECMedium", @@ -1210,7 +1344,7 @@ }, "FullyAnisotropicMedium": { "title": "FullyAnisotropicMedium", - "description": "Fully anisotropic medium including all 9 components of the permittivity and conductivity\ntensors. Provided permittivity tensor and the symmetric part of the conductivity tensor must\nhave coinciding main directions. A non-symmetric conductivity tensor can be used to model\nmagneto-optic effects. Note that dispersive properties and subpixel averaging are currently not\nsupported for fully anisotropic materials.\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\npermittivity : ArrayLike[dtype=float, ndim=2, shape=(3, 3)] = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]\n [units = None (relative permittivity)]. Relative permittivity tensor.\nconductivity : ArrayLike[dtype=float, ndim=2, shape=(3, 3)] = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]\n [units = S/um]. Electric conductivity tensor. Defined such that the imaginary part of the complex permittivity at angular frequency omega is given by conductivity/omega.\n\nNote\n----\nSimulations involving fully anisotropic materials are computationally more intensive, thus,\nthey take longer time to complete. This increase strongly depends on the filling fraction of\nthe simulation domain by fully anisotropic materials, varying approximately in the range from\n1.5 to 5. Cost of running a simulation is adjusted correspondingly.\n\nExample\n-------\n>>> perm = [[2, 0, 0], [0, 1, 0], [0, 0, 3]]\n>>> cond = [[0.1, 0, 0], [0, 0, 0], [0, 0, 0]]\n>>> anisotropic_dielectric = FullyAnisotropicMedium(permittivity=perm, conductivity=cond)", + "description": "Fully anisotropic medium including all 9 components of the permittivity and conductivity\ntensors. Provided permittivity tensor and the symmetric part of the conductivity tensor must\nhave coinciding main directions. A non-symmetric conductivity tensor can be used to model\nmagneto-optic effects. Note that dispersive properties and subpixel averaging are currently not\nsupported for fully anisotropic materials.\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\npermittivity : ArrayLike[dtype=float, ndim=2, shape=(3, 3)] = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]\n [units = None (relative permittivity)]. Relative permittivity tensor.\nconductivity : ArrayLike[dtype=float, ndim=2, shape=(3, 3)] = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]\n [units = S/um]. Electric conductivity tensor. Defined such that the imaginary part of the complex permittivity at angular frequency omega is given by conductivity/omega.\n\nNote\n----\nSimulations involving fully anisotropic materials are computationally more intensive, thus,\nthey take longer time to complete. This increase strongly depends on the filling fraction of\nthe simulation domain by fully anisotropic materials, varying approximately in the range from\n1.5 to 5. Cost of running a simulation is adjusted correspondingly.\n\nExample\n-------\n>>> perm = [[2, 0, 0], [0, 1, 0], [0, 0, 3]]\n>>> cond = [[0.1, 0, 0], [0, 0, 0], [0, 0, 0]]\n>>> anisotropic_dielectric = FullyAnisotropicMedium(permittivity=perm, conductivity=cond)", "type": "object", "properties": { "name": { @@ -1243,6 +1377,15 @@ "default": false, "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "FullyAnisotropicMedium", @@ -1365,7 +1508,7 @@ }, "CustomMedium": { "title": "CustomMedium", - "description": ":class:`.Medium` with user-supplied permittivity distribution.\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\ninterp_method : Literal['nearest', 'linear'] = nearest\n Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.\nsubpixel : bool = False\n If ``True`` and simulation's ``subpixel`` is also ``True``, applies subpixel averaging of the permittivity on the interface of the structure, including exterior boundary and intersection interfaces with other structures.\npermittivity : Optional[SpatialDataArray] = None\n [units = None (relative permittivity)]. Spatial profile of relative permittivity.\nconductivity : Optional[SpatialDataArray] = None\n [units = S/um]. Spatial profile Electric conductivity. Defined such that the imaginary part of the complex permittivity at angular frequency omega is given by conductivity/omega.\neps_dataset : Optional[PermittivityDataset] = None\n [To be deprecated] User-supplied dataset containing complex-valued permittivity as a function of space. Permittivity distribution over the Yee-grid will be interpolated based on ``interp_method``.\n\nExample\n-------\n>>> Nx, Ny, Nz = 10, 9, 8\n>>> X = np.linspace(-1, 1, Nx)\n>>> Y = np.linspace(-1, 1, Ny)\n>>> Z = np.linspace(-1, 1, Nz)\n>>> coords = dict(x=X, y=Y, z=Z)\n>>> permittivity= SpatialDataArray(np.ones((Nx, Ny, Nz)), coords=coords)\n>>> conductivity= SpatialDataArray(np.ones((Nx, Ny, Nz)), coords=coords)\n>>> dielectric = CustomMedium(permittivity=permittivity, conductivity=conductivity)\n>>> eps = dielectric.eps_model(200e12)", + "description": ":class:`.Medium` with user-supplied permittivity distribution.\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\ninterp_method : Literal['nearest', 'linear'] = nearest\n Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.\nsubpixel : bool = False\n If ``True`` and simulation's ``subpixel`` is also ``True``, applies subpixel averaging of the permittivity on the interface of the structure, including exterior boundary and intersection interfaces with other structures.\npermittivity : Optional[SpatialDataArray] = None\n [units = None (relative permittivity)]. Spatial profile of relative permittivity.\nconductivity : Optional[SpatialDataArray] = None\n [units = S/um]. Spatial profile Electric conductivity. Defined such that the imaginary part of the complex permittivity at angular frequency omega is given by conductivity/omega.\neps_dataset : Optional[PermittivityDataset] = None\n [To be deprecated] User-supplied dataset containing complex-valued permittivity as a function of space. Permittivity distribution over the Yee-grid will be interpolated based on ``interp_method``.\n\nExample\n-------\n>>> Nx, Ny, Nz = 10, 9, 8\n>>> X = np.linspace(-1, 1, Nx)\n>>> Y = np.linspace(-1, 1, Ny)\n>>> Z = np.linspace(-1, 1, Nz)\n>>> coords = dict(x=X, y=Y, z=Z)\n>>> permittivity= SpatialDataArray(np.ones((Nx, Ny, Nz)), coords=coords)\n>>> conductivity= SpatialDataArray(np.ones((Nx, Ny, Nz)), coords=coords)\n>>> dielectric = CustomMedium(permittivity=permittivity, conductivity=conductivity)\n>>> eps = dielectric.eps_model(200e12)", "type": "object", "properties": { "name": { @@ -1398,6 +1541,15 @@ "default": false, "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "CustomMedium", @@ -1466,7 +1618,7 @@ }, "CustomPoleResidue": { "title": "CustomPoleResidue", - "description": "A spatially varying dispersive medium described by the pole-residue pair model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\neps_inf : SpatialDataArray\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\npoles : Tuple[Tuple[tidy3d.components.data.data_array.SpatialDataArray, tidy3d.components.data.data_array.SpatialDataArray], ...] = ()\n [units = (rad/sec, rad/sec)]. Tuple of complex-valued (:math:`a_i, c_i`) poles for the model.\ninterp_method : Literal['nearest', 'linear'] = nearest\n Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.\nsubpixel : bool = False\n If ``True`` and simulation's ``subpixel`` is also ``True``, applies subpixel averaging of the permittivity on the interface of the structure, including exterior boundary and intersection interfaces with other structures.\n\nNote\n----\n.. math::\n\n \\epsilon(\\omega) = \\epsilon_\\infty - \\sum_i\n \\left[\\frac{c_i}{j \\omega + a_i} +\n \\frac{c_i^*}{j \\omega + a_i^*}\\right]\n\nExample\n-------\n>>> x = np.linspace(-1, 1, 5)\n>>> y = np.linspace(-1, 1, 6)\n>>> z = np.linspace(-1, 1, 7)\n>>> coords = dict(x=x, y=y, z=z)\n>>> eps_inf = SpatialDataArray(np.ones((5, 6, 7)), coords=coords)\n>>> a1 = SpatialDataArray(-np.random.random((5, 6, 7)), coords=coords)\n>>> c1 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> a2 = SpatialDataArray(-np.random.random((5, 6, 7)), coords=coords)\n>>> c2 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> pole_res = CustomPoleResidue(eps_inf=eps_inf, poles=[(a1, c1), (a2, c2)])\n>>> eps = pole_res.eps_model(200e12)", + "description": "A spatially varying dispersive medium described by the pole-residue pair model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\neps_inf : SpatialDataArray\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\npoles : Tuple[Tuple[tidy3d.components.data.data_array.SpatialDataArray, tidy3d.components.data.data_array.SpatialDataArray], ...] = ()\n [units = (rad/sec, rad/sec)]. Tuple of complex-valued (:math:`a_i, c_i`) poles for the model.\ninterp_method : Literal['nearest', 'linear'] = nearest\n Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.\nsubpixel : bool = False\n If ``True`` and simulation's ``subpixel`` is also ``True``, applies subpixel averaging of the permittivity on the interface of the structure, including exterior boundary and intersection interfaces with other structures.\n\nNote\n----\n.. math::\n\n \\epsilon(\\omega) = \\epsilon_\\infty - \\sum_i\n \\left[\\frac{c_i}{j \\omega + a_i} +\n \\frac{c_i^*}{j \\omega + a_i^*}\\right]\n\nExample\n-------\n>>> x = np.linspace(-1, 1, 5)\n>>> y = np.linspace(-1, 1, 6)\n>>> z = np.linspace(-1, 1, 7)\n>>> coords = dict(x=x, y=y, z=z)\n>>> eps_inf = SpatialDataArray(np.ones((5, 6, 7)), coords=coords)\n>>> a1 = SpatialDataArray(-np.random.random((5, 6, 7)), coords=coords)\n>>> c1 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> a2 = SpatialDataArray(-np.random.random((5, 6, 7)), coords=coords)\n>>> c2 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> pole_res = CustomPoleResidue(eps_inf=eps_inf, poles=[(a1, c1), (a2, c2)])\n>>> eps = pole_res.eps_model(200e12)", "type": "object", "properties": { "name": { @@ -1499,6 +1651,15 @@ "default": false, "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "CustomPoleResidue", @@ -1589,7 +1750,7 @@ }, "CustomSellmeier": { "title": "CustomSellmeier", - "description": "A spatially varying dispersive medium described by the Sellmeier model.\nThe frequency-dependence of the refractive index is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\ncoeffs : Tuple[Tuple[tidy3d.components.data.data_array.SpatialDataArray, tidy3d.components.data.data_array.SpatialDataArray], ...]\n [units = (None, um^2)]. List of Sellmeier (:math:`B_i, C_i`) coefficients.\ninterp_method : Literal['nearest', 'linear'] = nearest\n Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.\nsubpixel : bool = False\n If ``True`` and simulation's ``subpixel`` is also ``True``, applies subpixel averaging of the permittivity on the interface of the structure, including exterior boundary and intersection interfaces with other structures.\n\nNote\n----\n.. math::\n\n n(\\lambda)^2 = 1 + \\sum_i \\frac{B_i \\lambda^2}{\\lambda^2 - C_i}\n\nExample\n-------\n>>> x = np.linspace(-1, 1, 5)\n>>> y = np.linspace(-1, 1, 6)\n>>> z = np.linspace(-1, 1, 7)\n>>> coords = dict(x=x, y=y, z=z)\n>>> b1 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> c1 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> sellmeier_medium = CustomSellmeier(coeffs=[(b1,c1),])\n>>> eps = sellmeier_medium.eps_model(200e12)", + "description": "A spatially varying dispersive medium described by the Sellmeier model.\nThe frequency-dependence of the refractive index is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\ncoeffs : Tuple[Tuple[tidy3d.components.data.data_array.SpatialDataArray, tidy3d.components.data.data_array.SpatialDataArray], ...]\n [units = (None, um^2)]. List of Sellmeier (:math:`B_i, C_i`) coefficients.\ninterp_method : Literal['nearest', 'linear'] = nearest\n Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.\nsubpixel : bool = False\n If ``True`` and simulation's ``subpixel`` is also ``True``, applies subpixel averaging of the permittivity on the interface of the structure, including exterior boundary and intersection interfaces with other structures.\n\nNote\n----\n.. math::\n\n n(\\lambda)^2 = 1 + \\sum_i \\frac{B_i \\lambda^2}{\\lambda^2 - C_i}\n\nExample\n-------\n>>> x = np.linspace(-1, 1, 5)\n>>> y = np.linspace(-1, 1, 6)\n>>> z = np.linspace(-1, 1, 7)\n>>> coords = dict(x=x, y=y, z=z)\n>>> b1 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> c1 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> sellmeier_medium = CustomSellmeier(coeffs=[(b1,c1),])\n>>> eps = sellmeier_medium.eps_model(200e12)", "type": "object", "properties": { "name": { @@ -1622,6 +1783,15 @@ "default": false, "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "CustomSellmeier", @@ -1696,7 +1866,7 @@ }, "CustomLorentz": { "title": "CustomLorentz", - "description": "A spatially varying dispersive medium described by the Lorentz model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\neps_inf : SpatialDataArray\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[tidy3d.components.data.data_array.SpatialDataArray, tidy3d.components.data.data_array.SpatialDataArray, tidy3d.components.data.data_array.SpatialDataArray], ...]\n [units = (None (relative permittivity), Hz, Hz)]. List of (:math:`\\Delta\\epsilon_i, f_i, \\delta_i`) values for model.\ninterp_method : Literal['nearest', 'linear'] = nearest\n Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.\nsubpixel : bool = False\n If ``True`` and simulation's ``subpixel`` is also ``True``, applies subpixel averaging of the permittivity on the interface of the structure, including exterior boundary and intersection interfaces with other structures.\n\nNote\n----\n.. math::\n\n \\epsilon(f) = \\epsilon_\\infty + \\sum_i\n \\frac{\\Delta\\epsilon_i f_i^2}{f_i^2 - 2jf\\delta_i - f^2}\n\nExample\n-------\n>>> x = np.linspace(-1, 1, 5)\n>>> y = np.linspace(-1, 1, 6)\n>>> z = np.linspace(-1, 1, 7)\n>>> coords = dict(x=x, y=y, z=z)\n>>> eps_inf = SpatialDataArray(np.ones((5, 6, 7)), coords=coords)\n>>> d_epsilon = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> f = SpatialDataArray(1+np.random.random((5, 6, 7)), coords=coords)\n>>> delta = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> lorentz_medium = CustomLorentz(eps_inf=eps_inf, coeffs=[(d_epsilon,f,delta),])\n>>> eps = lorentz_medium.eps_model(200e12)", + "description": "A spatially varying dispersive medium described by the Lorentz model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\neps_inf : SpatialDataArray\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[tidy3d.components.data.data_array.SpatialDataArray, tidy3d.components.data.data_array.SpatialDataArray, tidy3d.components.data.data_array.SpatialDataArray], ...]\n [units = (None (relative permittivity), Hz, Hz)]. List of (:math:`\\Delta\\epsilon_i, f_i, \\delta_i`) values for model.\ninterp_method : Literal['nearest', 'linear'] = nearest\n Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.\nsubpixel : bool = False\n If ``True`` and simulation's ``subpixel`` is also ``True``, applies subpixel averaging of the permittivity on the interface of the structure, including exterior boundary and intersection interfaces with other structures.\n\nNote\n----\n.. math::\n\n \\epsilon(f) = \\epsilon_\\infty + \\sum_i\n \\frac{\\Delta\\epsilon_i f_i^2}{f_i^2 - 2jf\\delta_i - f^2}\n\nExample\n-------\n>>> x = np.linspace(-1, 1, 5)\n>>> y = np.linspace(-1, 1, 6)\n>>> z = np.linspace(-1, 1, 7)\n>>> coords = dict(x=x, y=y, z=z)\n>>> eps_inf = SpatialDataArray(np.ones((5, 6, 7)), coords=coords)\n>>> d_epsilon = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> f = SpatialDataArray(1+np.random.random((5, 6, 7)), coords=coords)\n>>> delta = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> lorentz_medium = CustomLorentz(eps_inf=eps_inf, coeffs=[(d_epsilon,f,delta),])\n>>> eps = lorentz_medium.eps_model(200e12)", "type": "object", "properties": { "name": { @@ -1729,6 +1899,15 @@ "default": false, "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "CustomLorentz", @@ -1833,7 +2012,7 @@ }, "CustomDebye": { "title": "CustomDebye", - "description": "A spatially varying dispersive medium described by the Debye model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\neps_inf : SpatialDataArray\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[tidy3d.components.data.data_array.SpatialDataArray, tidy3d.components.data.data_array.SpatialDataArray], ...]\n [units = (None (relative permittivity), sec)]. List of (:math:`\\Delta\\epsilon_i, \\tau_i`) values for model.\ninterp_method : Literal['nearest', 'linear'] = nearest\n Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.\nsubpixel : bool = False\n If ``True`` and simulation's ``subpixel`` is also ``True``, applies subpixel averaging of the permittivity on the interface of the structure, including exterior boundary and intersection interfaces with other structures.\n\nNote\n----\n.. math::\n\n \\epsilon(f) = \\epsilon_\\infty + \\sum_i\n \\frac{\\Delta\\epsilon_i}{1 - jf\\tau_i}\n\nExample\n-------\n>>> x = np.linspace(-1, 1, 5)\n>>> y = np.linspace(-1, 1, 6)\n>>> z = np.linspace(-1, 1, 7)\n>>> coords = dict(x=x, y=y, z=z)\n>>> eps_inf = SpatialDataArray(1+np.random.random((5, 6, 7)), coords=coords)\n>>> eps1 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> tau1 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> debye_medium = CustomDebye(eps_inf=eps_inf, coeffs=[(eps1,tau1),])\n>>> eps = debye_medium.eps_model(200e12)", + "description": "A spatially varying dispersive medium described by the Debye model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\neps_inf : SpatialDataArray\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[tidy3d.components.data.data_array.SpatialDataArray, tidy3d.components.data.data_array.SpatialDataArray], ...]\n [units = (None (relative permittivity), sec)]. List of (:math:`\\Delta\\epsilon_i, \\tau_i`) values for model.\ninterp_method : Literal['nearest', 'linear'] = nearest\n Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.\nsubpixel : bool = False\n If ``True`` and simulation's ``subpixel`` is also ``True``, applies subpixel averaging of the permittivity on the interface of the structure, including exterior boundary and intersection interfaces with other structures.\n\nNote\n----\n.. math::\n\n \\epsilon(f) = \\epsilon_\\infty + \\sum_i\n \\frac{\\Delta\\epsilon_i}{1 - jf\\tau_i}\n\nExample\n-------\n>>> x = np.linspace(-1, 1, 5)\n>>> y = np.linspace(-1, 1, 6)\n>>> z = np.linspace(-1, 1, 7)\n>>> coords = dict(x=x, y=y, z=z)\n>>> eps_inf = SpatialDataArray(1+np.random.random((5, 6, 7)), coords=coords)\n>>> eps1 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> tau1 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> debye_medium = CustomDebye(eps_inf=eps_inf, coeffs=[(eps1,tau1),])\n>>> eps = debye_medium.eps_model(200e12)", "type": "object", "properties": { "name": { @@ -1866,6 +2045,15 @@ "default": false, "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "CustomDebye", @@ -1956,7 +2144,7 @@ }, "CustomDrude": { "title": "CustomDrude", - "description": "A spatially varying dispersive medium described by the Drude model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\neps_inf : SpatialDataArray\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[tidy3d.components.data.data_array.SpatialDataArray, tidy3d.components.data.data_array.SpatialDataArray], ...]\n [units = (Hz, Hz)]. List of (:math:`f_i, \\delta_i`) values for model.\ninterp_method : Literal['nearest', 'linear'] = nearest\n Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.\nsubpixel : bool = False\n If ``True`` and simulation's ``subpixel`` is also ``True``, applies subpixel averaging of the permittivity on the interface of the structure, including exterior boundary and intersection interfaces with other structures.\n\nNote\n----\n.. math::\n\n \\epsilon(f) = \\epsilon_\\infty - \\sum_i\n \\frac{ f_i^2}{f^2 + jf\\delta_i}\n\nExample\n-------\n>>> x = np.linspace(-1, 1, 5)\n>>> y = np.linspace(-1, 1, 6)\n>>> z = np.linspace(-1, 1, 7)\n>>> coords = dict(x=x, y=y, z=z)\n>>> eps_inf = SpatialDataArray(np.ones((5, 6, 7)), coords=coords)\n>>> f1 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> delta1 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> drude_medium = CustomDrude(eps_inf=eps_inf, coeffs=[(f1,delta1),])\n>>> eps = drude_medium.eps_model(200e12)", + "description": "A spatially varying dispersive medium described by the Drude model.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\neps_inf : SpatialDataArray\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[tidy3d.components.data.data_array.SpatialDataArray, tidy3d.components.data.data_array.SpatialDataArray], ...]\n [units = (Hz, Hz)]. List of (:math:`f_i, \\delta_i`) values for model.\ninterp_method : Literal['nearest', 'linear'] = nearest\n Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.\nsubpixel : bool = False\n If ``True`` and simulation's ``subpixel`` is also ``True``, applies subpixel averaging of the permittivity on the interface of the structure, including exterior boundary and intersection interfaces with other structures.\n\nNote\n----\n.. math::\n\n \\epsilon(f) = \\epsilon_\\infty - \\sum_i\n \\frac{ f_i^2}{f^2 + jf\\delta_i}\n\nExample\n-------\n>>> x = np.linspace(-1, 1, 5)\n>>> y = np.linspace(-1, 1, 6)\n>>> z = np.linspace(-1, 1, 7)\n>>> coords = dict(x=x, y=y, z=z)\n>>> eps_inf = SpatialDataArray(np.ones((5, 6, 7)), coords=coords)\n>>> f1 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> delta1 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\n>>> drude_medium = CustomDrude(eps_inf=eps_inf, coeffs=[(f1,delta1),])\n>>> eps = drude_medium.eps_model(200e12)", "type": "object", "properties": { "name": { @@ -1989,6 +2177,15 @@ "default": false, "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "CustomDrude", @@ -2079,7 +2276,7 @@ }, "CustomAnisotropicMedium": { "title": "CustomAnisotropicMedium", - "description": "Diagonally anisotropic medium with spatially varying permittivity in each component.\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : Optional[bool] = None\n This field is ignored. Please set ``allow_gain`` in each component\nxx : Union[CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomMedium]\n Medium describing the xx-component of the diagonal permittivity tensor.\nyy : Union[CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomMedium]\n Medium describing the yy-component of the diagonal permittivity tensor.\nzz : Union[CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomMedium]\n Medium describing the zz-component of the diagonal permittivity tensor.\ninterp_method : Optional[Literal['nearest', 'linear']] = None\n When the value is 'None', each component will follow its own interpolation method. When the value is other than 'None', the interpolation method specified by this field will override the one in each component.\nsubpixel : Optional[bool] = None\n This field is ignored. Please set ``subpixel`` in each component\n\nNote\n----\nOnly diagonal anisotropy is currently supported.\n\nExample\n-------\n>>> Nx, Ny, Nz = 10, 9, 8\n>>> x = np.linspace(-1, 1, Nx)\n>>> y = np.linspace(-1, 1, Ny)\n>>> z = np.linspace(-1, 1, Nz)\n>>> coords = dict(x=x, y=y, z=z)\n>>> permittivity= SpatialDataArray(np.ones((Nx, Ny, Nz)), coords=coords)\n>>> conductivity= SpatialDataArray(np.ones((Nx, Ny, Nz)), coords=coords)\n>>> medium_xx = CustomMedium(permittivity=permittivity, conductivity=conductivity)\n>>> medium_yy = CustomMedium(permittivity=permittivity, conductivity=conductivity)\n>>> d_epsilon = SpatialDataArray(np.random.random((Nx, Ny, Nz)), coords=coords)\n>>> f = SpatialDataArray(1+np.random.random((Nx, Ny, Nz)), coords=coords)\n>>> delta = SpatialDataArray(np.random.random((Nx, Ny, Nz)), coords=coords)\n>>> medium_zz = CustomLorentz(eps_inf=permittivity, coeffs=[(d_epsilon,f,delta),])\n>>> anisotropic_dielectric = CustomAnisotropicMedium(xx=medium_xx, yy=medium_yy, zz=medium_zz)", + "description": "Diagonally anisotropic medium with spatially varying permittivity in each component.\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : Optional[bool] = None\n This field is ignored. Please set ``allow_gain`` in each component\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\nxx : Union[CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomMedium]\n Medium describing the xx-component of the diagonal permittivity tensor.\nyy : Union[CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomMedium]\n Medium describing the yy-component of the diagonal permittivity tensor.\nzz : Union[CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomMedium]\n Medium describing the zz-component of the diagonal permittivity tensor.\ninterp_method : Optional[Literal['nearest', 'linear']] = None\n When the value is 'None', each component will follow its own interpolation method. When the value is other than 'None', the interpolation method specified by this field will override the one in each component.\nsubpixel : Optional[bool] = None\n This field is ignored. Please set ``subpixel`` in each component\n\nNote\n----\nOnly diagonal anisotropy is currently supported.\n\nExample\n-------\n>>> Nx, Ny, Nz = 10, 9, 8\n>>> x = np.linspace(-1, 1, Nx)\n>>> y = np.linspace(-1, 1, Ny)\n>>> z = np.linspace(-1, 1, Nz)\n>>> coords = dict(x=x, y=y, z=z)\n>>> permittivity= SpatialDataArray(np.ones((Nx, Ny, Nz)), coords=coords)\n>>> conductivity= SpatialDataArray(np.ones((Nx, Ny, Nz)), coords=coords)\n>>> medium_xx = CustomMedium(permittivity=permittivity, conductivity=conductivity)\n>>> medium_yy = CustomMedium(permittivity=permittivity, conductivity=conductivity)\n>>> d_epsilon = SpatialDataArray(np.random.random((Nx, Ny, Nz)), coords=coords)\n>>> f = SpatialDataArray(1+np.random.random((Nx, Ny, Nz)), coords=coords)\n>>> delta = SpatialDataArray(np.random.random((Nx, Ny, Nz)), coords=coords)\n>>> medium_zz = CustomLorentz(eps_inf=permittivity, coeffs=[(d_epsilon,f,delta),])\n>>> anisotropic_dielectric = CustomAnisotropicMedium(xx=medium_xx, yy=medium_yy, zz=medium_zz)", "type": "object", "properties": { "name": { @@ -2111,6 +2308,15 @@ "description": "This field is ignored. Please set ``allow_gain`` in each component", "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "CustomAnisotropicMedium", @@ -2246,50 +2452,107 @@ ], "additionalProperties": false }, - "Box": { - "title": "Box", - "description": "Rectangular prism.\n Also base class for :class:`Simulation`, :class:`Monitor`, and :class:`Source`.\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.\n\nExample\n-------\n>>> b = Box(center=(1,2,3), size=(2,2,2))", + "LinearHeatPerturbation": { + "title": "LinearHeatPerturbation", + "description": "Specifies parameter's perturbation due to thermal effects as a linear function of\ntemperature:\n\nParameters\n----------\ntemperature_range : Tuple[NonNegativeFloat, NonNegativeFloat] = (0, inf)\n [units = K]. Temparature range in which perturbation model is valid.\ntemperature_ref : NonNegativeFloat\n [units = K]. Temperature at which perturbation is zero.\ncoeff : Union[float, tidycomplex, ComplexNumber]\n [units = 1/K]. Sensitivity (derivative) of perturbation with respect to temperature.\n\nNote\n----\n.. math::\n\n \\Delta X (T) = \\text{coeff} \\times (T - \\text{temperature\\_ref}),\n\nwhere ``coeff`` is the parameter's sensitivity (thermo-optic coefficient) to temperature and\n``temperature_ref`` is the reference temperature point. A temperature range in which such\na model is deemed accurate may be provided as a field ``temperature_range``\n(default: ``[0, inf]``). Wherever is applied, Tidy3D will check that the parameter's value\ndoes not go out of its physical bounds within ``temperature_range`` due to perturbations and\nraise a warning if this check fails. A warning is also issued if the perturbation model is\nevaluated outside of ``temperature_range``.\n\nExample\n-------\n>>> heat_perturb = LinearHeatPerturbation(\n... temperature_ref=300,\n... coeff=0.0001,\n... temperature_range=[200, 500],\n... )", "type": "object", "properties": { "type": { "title": "Type", - "default": "Box", + "default": "LinearHeatPerturbation", "enum": [ - "Box" + "LinearHeatPerturbation" ], "type": "string" }, - "center": { - "title": "Center", - "description": "Center of object in x, y, and z.", + "temperature_range": { + "title": "Temperature range", + "description": "Temparature range in which perturbation model is valid.", "default": [ - 0.0, - 0.0, - 0.0 + 0, + Infinity ], - "units": "um", + "units": "K", "type": "array", - "minItems": 3, - "maxItems": 3, + "minItems": 2, + "maxItems": 2, "items": [ { - "type": "number" + "type": "number", + "minimum": 0 }, + { + "type": "number", + "minimum": 0 + } + ] + }, + "temperature_ref": { + "title": "Reference temperature", + "description": "Temperature at which perturbation is zero.", + "units": "K", + "minimum": 0, + "type": "number" + }, + "coeff": { + "title": "Thermo-optic Coefficient", + "description": "Sensitivity (derivative) of perturbation with respect to temperature.", + "units": "1/K", + "anyOf": [ { "type": "number" }, { - "type": "number" + "title": "ComplexNumber", + "description": "Complex number with a well defined schema.", + "type": "object", + "properties": { + "real": { + "title": "Real", + "type": "number" + }, + "imag": { + "title": "Imag", + "type": "number" + } + }, + "required": [ + "real", + "imag" + ] + }, + { + "$ref": "#/definitions/ComplexNumber" } ] + } + }, + "required": [ + "temperature_ref", + "coeff" + ], + "additionalProperties": false + }, + "CustomHeatPerturbation": { + "title": "CustomHeatPerturbation", + "description": "Specifies parameter's perturbation due to thermal effects as a custom function of\ntemperature defined as an array of perturbation values at sample temperature points. The linear\ninterpolation is used to calculate perturbation values between sample temperature points. For\ntemperature values outside of the provided sample region the perturbation value is extrapolated\nas a constant.\nThe temperature range, ``temperature_range``, in which the perturbation model is assumed to be\naccurate is calculated automatically as the minimal and maximal sample temperature points.\nWherever is applied, Tidy3D will check that the parameter's value\ndoes not go out of its physical bounds within ``temperature_range`` due to perturbations and\nraise a warning if this check fails. A warning is also issued if the perturbation model is\nevaluated outside of ``temperature_range``.\n\nParameters\n----------\ntemperature_range : Optional[Tuple[NonNegativeFloat, NonNegativeFloat]] = None\n [units = K]. Temparature range in which perturbation model is valid. For :class:`.CustomHeatPerturbation` this field is computed automatically based on temperature sample points provided in ``perturbation_values``.\nperturbation_values : HeatDataArray\n Sampled perturbation values.\ninterp_method : Literal['nearest', 'linear'] = linear\n Interpolation method to obtain perturbation values between sample points.\n\nExample\n-------\n>>> from tidy3d import HeatDataArray\n>>> perturbation_data = HeatDataArray([0.001, 0.002, 0.004], coords=dict(T=[250, 300, 350]))\n>>> heat_perturb = CustomHeatPerturbation(\n... perturbation_values=perturbation_data\n... )", + "type": "object", + "properties": { + "type": { + "title": "Type", + "default": "CustomHeatPerturbation", + "enum": [ + "CustomHeatPerturbation" + ], + "type": "string" }, - "size": { - "title": "Size", - "description": "Size in x, y, and z directions.", - "units": "um", + "temperature_range": { + "title": "Temperature range", + "description": "Temparature range in which perturbation model is valid. For :class:`.CustomHeatPerturbation` this field is computed automatically based on temperature sample points provided in ``perturbation_values``.", + "units": "K", "type": "array", - "minItems": 3, - "maxItems": 3, + "minItems": 2, + "maxItems": 2, "items": [ { "type": "number", @@ -2298,90 +2561,649 @@ { "type": "number", "minimum": 0 - }, - { - "type": "number", - "minimum": 0 } ] + }, + "perturbation_values": { + "title": "DataArray", + "description": "Sampled perturbation values.", + "type": "xr.DataArray", + "properties": { + "_dims": { + "title": "_dims", + "type": "Tuple[str, ...]" + } + }, + "required": [ + "_dims" + ] + }, + "interp_method": { + "title": "Interpolation method", + "description": "Interpolation method to obtain perturbation values between sample points.", + "default": "linear", + "enum": [ + "nearest", + "linear" + ], + "type": "string" } }, "required": [ - "size" + "perturbation_values" ], "additionalProperties": false }, - "Sphere": { - "title": "Sphere", - "description": "Spherical geometry.\n\nParameters\n----------\nradius : NonNegativeFloat\n [units = um]. Radius of geometry.\ncenter : Tuple[float, float, float] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\n\nExample\n-------\n>>> b = Sphere(center=(1,2,3), radius=2)", + "LinearChargePerturbation": { + "title": "LinearChargePerturbation", + "description": "Specifies parameter's perturbation due to free carrier effects as a linear function of\nelectron and hole densities:\n\nParameters\n----------\nelectron_range : Tuple[NonNegativeFloat, NonNegativeFloat] = (0, inf)\n Range of electrons densities in which perturbation model is valid.\nhole_range : Tuple[NonNegativeFloat, NonNegativeFloat] = (0, inf)\n Range of holes densities in which perturbation model is valid.\nelectron_ref : NonNegativeFloat\n [units = 1/cm^3]. Electron density value at which there is no perturbation due to electrons's presence.\nhole_ref : NonNegativeFloat\n [units = 1/cm^3]. Hole density value at which there is no perturbation due to holes' presence.\nelectron_coeff : float\n [units = cm^3]. Sensitivity (derivative) of perturbation with respect to electron density.\nhole_coeff : float\n [units = cm^3]. Sensitivity (derivative) of perturbation with respect to hole density.\n\nNote\n----\n.. math::\n\n \\Delta X (T) = \\text{electron\\_coeff} \\times (N_e - \\text{electron\\_ref})\n + \\text{hole\\_coeff} \\times (N_h - \\text{hole\\_ref}),\n\nwhere ``electron_coeff`` and ``hole_coeff`` are the parameter's sensitivities to electron and\nhole densities, while ``electron_ref`` and ``hole_ref`` are reference electron and hole density\nvalues. Ranges of electron and hole densities in which such\na model is deemed accurate may be provided as fields ``electron_range`` and ``hole_range``\n(default: ``[0, inf]`` each). Wherever is applied, Tidy3D will check that the parameter's value\ndoes not go out of its physical bounds within ``electron_range`` x ``hole_range`` due to\nperturbations and raise a warning if this check fails. A warning is also issued if\nthe perturbation model is evaluated outside of ``electron_range`` x ``hole_range``.\n\nExample\n-------\n>>> charge_perturb = LinearChargePerturbation(\n... electron_ref=0,\n... electron_coeff=0.0001,\n... electron_range=[0, 1e19],\n... hole_ref=0,\n... hole_coeff=0.0002,\n... hole_range=[0, 2e19],\n... )", "type": "object", "properties": { "type": { "title": "Type", - "default": "Sphere", + "default": "LinearChargePerturbation", "enum": [ - "Sphere" + "LinearChargePerturbation" ], "type": "string" }, - "radius": { - "title": "Radius", - "description": "Radius of geometry.", - "units": "um", - "minimum": 0, - "type": "number" - }, - "center": { - "title": "Center", - "description": "Center of object in x, y, and z.", + "electron_range": { + "title": "Electron Density Range", + "description": "Range of electrons densities in which perturbation model is valid.", "default": [ - 0.0, - 0.0, - 0.0 + 0, + Infinity ], - "units": "um", "type": "array", - "minItems": 3, - "maxItems": 3, + "minItems": 2, + "maxItems": 2, "items": [ { - "type": "number" + "type": "number", + "minimum": 0 }, { - "type": "number" + "type": "number", + "minimum": 0 + } + ] + }, + "hole_range": { + "title": "Hole Density Range", + "description": "Range of holes densities in which perturbation model is valid.", + "default": [ + 0, + Infinity + ], + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ + { + "type": "number", + "minimum": 0 }, { - "type": "number" + "type": "number", + "minimum": 0 } ] + }, + "electron_ref": { + "title": "Reference Electron Density", + "description": "Electron density value at which there is no perturbation due to electrons's presence.", + "units": "1/cm^3", + "minimum": 0, + "type": "number" + }, + "hole_ref": { + "title": "Reference Hole Density", + "description": "Hole density value at which there is no perturbation due to holes' presence.", + "units": "1/cm^3", + "minimum": 0, + "type": "number" + }, + "electron_coeff": { + "title": "Sensitivity to Electron Density", + "description": "Sensitivity (derivative) of perturbation with respect to electron density.", + "units": "cm^3", + "type": "number" + }, + "hole_coeff": { + "title": "Sensitivity to Hole Density", + "description": "Sensitivity (derivative) of perturbation with respect to hole density.", + "units": "cm^3", + "type": "number" } }, "required": [ - "radius" + "electron_ref", + "hole_ref", + "electron_coeff", + "hole_coeff" ], "additionalProperties": false }, - "Cylinder": { - "title": "Cylinder", - "description": "Cylindrical geometry with optional sidewall angle along axis\ndirection. When ``sidewall_angle`` is nonzero, the shape is a\nconical frustum or a cone.\n\nParameters\n----------\naxis : Literal[0, 1, 2] = 2\n Specifies dimension of the planar axis (0,1,2) -> (x,y,z).\nsidewall_angle : ConstrainedFloatValue = 0.0\n [units = rad]. Angle of the sidewall. ``sidewall_angle=0`` (default) specifies a vertical wall; ``0>> c = Cylinder(center=(1,2,3), radius=2, length=5, axis=2)", + "CustomChargePerturbation": { + "title": "CustomChargePerturbation", + "description": "Specifies parameter's perturbation due to free carrier effects as a custom function of\nelectron and hole densities defined as a two-dimensional array of perturbation values at sample\nelectron and hole density points. The linear interpolation is used to calculate perturbation\nvalues between sample points. For electron and hole density values outside of the provided\nsample region the perturbation value is extrapolated as a constant.\nThe electron and hole density ranges, ``electron_range`` and ``hole_range``, in which\nthe perturbation model is assumed to be accurate is calculated automatically as the minimal and\nmaximal density values provided in ``perturbation_values``. Wherever is applied, Tidy3D will\ncheck that the parameter's value does not go out of its physical bounds within\n``electron_range`` x ``hole_range`` due to perturbations and raise a warning if this check\nfails. A warning is also issued if the perturbation model is evaluated outside of\n``electron_range`` x ``hole_range``.\n\nParameters\n----------\nelectron_range : Optional[Tuple[NonNegativeFloat, NonNegativeFloat]] = None\n Range of electrons densities in which perturbation model is valid. For :class:`.CustomChargePerturbation` this field is computed automatically based on provided ``perturbation_values``\nhole_range : Optional[Tuple[NonNegativeFloat, NonNegativeFloat]] = None\n Range of holes densities in which perturbation model is valid. For :class:`.CustomChargePerturbation` this field is computed automatically based on provided ``perturbation_values``\nperturbation_values : ChargeDataArray\n 2D array (vs electron and hole densities) of sampled perturbation values.\ninterp_method : Literal['nearest', 'linear'] = linear\n Interpolation method to obtain perturbation values between sample points.\n\nExample\n-------\n>>> from tidy3d import ChargeDataArray\n>>> perturbation_data = ChargeDataArray(\n... [[0.001, 0.002, 0.004], [0.003, 0.002, 0.001]],\n... coords=dict(n=[2e15, 2e19], p=[1e16, 1e17, 1e18]),\n... )\n>>> charge_perturb = CustomChargePerturbation(\n... perturbation_values=perturbation_data,\n... )", "type": "object", "properties": { "type": { "title": "Type", - "default": "Cylinder", + "default": "CustomChargePerturbation", "enum": [ - "Cylinder" + "CustomChargePerturbation" ], "type": "string" }, - "axis": { - "title": "Axis", - "description": "Specifies dimension of the planar axis (0,1,2) -> (x,y,z).", - "default": 2, - "enum": [ - 0, - 1, - 2 + "electron_range": { + "title": "Electron Density Range", + "description": "Range of electrons densities in which perturbation model is valid. For :class:`.CustomChargePerturbation` this field is computed automatically based on provided ``perturbation_values``", + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ + { + "type": "number", + "minimum": 0 + }, + { + "type": "number", + "minimum": 0 + } + ] + }, + "hole_range": { + "title": "Hole Density Range", + "description": "Range of holes densities in which perturbation model is valid. For :class:`.CustomChargePerturbation` this field is computed automatically based on provided ``perturbation_values``", + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ + { + "type": "number", + "minimum": 0 + }, + { + "type": "number", + "minimum": 0 + } + ] + }, + "perturbation_values": { + "title": "DataArray", + "description": "2D array (vs electron and hole densities) of sampled perturbation values.", + "type": "xr.DataArray", + "properties": { + "_dims": { + "title": "_dims", + "type": "Tuple[str, ...]" + } + }, + "required": [ + "_dims" + ] + }, + "interp_method": { + "title": "Interpolation method", + "description": "Interpolation method to obtain perturbation values between sample points.", + "default": "linear", + "enum": [ + "nearest", + "linear" + ], + "type": "string" + } + }, + "required": [ + "perturbation_values" + ], + "additionalProperties": false + }, + "ParameterPerturbation": { + "title": "ParameterPerturbation", + "description": "Stores information about parameter perturbations due to different physical effect. If both\nheat and charge perturbation models are included their effects are superimposed.\n\nParameters\n----------\nheat : Union[LinearHeatPerturbation, CustomHeatPerturbation] = None\n Heat perturbation to apply.\ncharge : Union[LinearChargePerturbation, CustomChargePerturbation] = None\n Charge perturbation to apply.\n\nExample\n-------\n>>> from tidy3d import LinearChargePerturbation, CustomHeatPerturbation, HeatDataArray\n>>>\n>>> perturbation_data = HeatDataArray([0.001, 0.002, 0.004], coords=dict(T=[250, 300, 350]))\n>>> heat_perturb = CustomHeatPerturbation(\n... perturbation_values=perturbation_data\n... )\n>>> charge_perturb = LinearChargePerturbation(\n... electron_ref=0,\n... electron_coeff=0.0001,\n... electron_range=[0, 1e19],\n... hole_ref=0,\n... hole_coeff=0.0002,\n... hole_range=[0, 2e19],\n... )\n>>> param_perturb = ParameterPerturbation(heat=heat_perturb, charge=charge_perturb)", + "type": "object", + "properties": { + "heat": { + "title": "Heat Perturbation", + "description": "Heat perturbation to apply.", + "anyOf": [ + { + "$ref": "#/definitions/LinearHeatPerturbation" + }, + { + "$ref": "#/definitions/CustomHeatPerturbation" + } + ] + }, + "charge": { + "title": "Charge Perturbation", + "description": "Charge perturbation to apply.", + "anyOf": [ + { + "$ref": "#/definitions/LinearChargePerturbation" + }, + { + "$ref": "#/definitions/CustomChargePerturbation" + } + ] + }, + "type": { + "title": "Type", + "default": "ParameterPerturbation", + "enum": [ + "ParameterPerturbation" + ], + "type": "string" + } + }, + "additionalProperties": false + }, + "PerturbationMedium": { + "title": "PerturbationMedium", + "description": "Dispersionless medium with perturbations.\n\nParameters\n----------\nsubpixel : bool = True\n This value will be transferred to the resulting custom medium. That is, if ``True``, the subpixel averaging will be applied to the custom medium provided the corresponding ``Simulation``'s field ``subpixel`` is set to ``True`` as well. If the resulting medium is not a custom medium (no perturbations), this field does not have an effect.\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\npermittivity : ConstrainedFloatValue = 1.0\n [units = None (relative permittivity)]. Relative permittivity.\nconductivity : float = 0.0\n [units = S/um]. Electric conductivity. Defined such that the imaginary part of the complex permittivity at angular frequency omega is given by conductivity/omega.\npermittivity_perturbation : Optional[ParameterPerturbation] = None\n [units = None (relative permittivity)]. List of heat and/or charge perturbations to permittivity.\nconductivity_perturbation : Optional[ParameterPerturbation] = None\n [units = S/um]. List of heat and/or charge perturbations to permittivity.\n\nExample\n-------\n>>> from tidy3d import ParameterPerturbation, LinearHeatPerturbation\n>>> dielectric = PerturbationMedium(\n... permittivity=4.0,\n... permittivity_perturbation=ParameterPerturbation(\n... heat=LinearHeatPerturbation(temperature_ref=300, coeff=0.0001),\n... ),\n... name='my_medium',\n... )", + "type": "object", + "properties": { + "subpixel": { + "title": "Subpixel averaging", + "description": "This value will be transferred to the resulting custom medium. That is, if ``True``, the subpixel averaging will be applied to the custom medium provided the corresponding ``Simulation``'s field ``subpixel`` is set to ``True`` as well. If the resulting medium is not a custom medium (no perturbations), this field does not have an effect.", + "default": true, + "type": "boolean" + }, + "type": { + "title": "Type", + "default": "PerturbationMedium", + "enum": [ + "PerturbationMedium" + ], + "type": "string" + }, + "name": { + "title": "Name", + "description": "Optional unique name for medium.", + "type": "string" + }, + "frequency_range": { + "title": "Frequency Range", + "description": "Optional range of validity for the medium.", + "units": [ + "Hz", + "Hz" + ], + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ + { + "type": "number" + }, + { + "type": "number" + } + ] + }, + "allow_gain": { + "title": "Allow gain medium", + "description": "Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.", + "default": false, + "type": "boolean" + }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, + "permittivity": { + "title": "Permittivity", + "description": "Relative permittivity.", + "default": 1.0, + "minimum": 1.0, + "units": "None (relative permittivity)", + "type": "number" + }, + "conductivity": { + "title": "Conductivity", + "description": "Electric conductivity. Defined such that the imaginary part of the complex permittivity at angular frequency omega is given by conductivity/omega.", + "default": 0.0, + "units": "S/um", + "type": "number" + }, + "permittivity_perturbation": { + "title": "Permittivity Perturbation", + "description": "List of heat and/or charge perturbations to permittivity.", + "units": "None (relative permittivity)", + "allOf": [ + { + "$ref": "#/definitions/ParameterPerturbation" + } + ] + }, + "conductivity_perturbation": { + "title": "Permittivity Perturbation", + "description": "List of heat and/or charge perturbations to permittivity.", + "units": "S/um", + "allOf": [ + { + "$ref": "#/definitions/ParameterPerturbation" + } + ] + } + }, + "additionalProperties": false + }, + "PerturbationPoleResidue": { + "title": "PerturbationPoleResidue", + "description": "A dispersive medium described by the pole-residue pair model with perturbations.\nThe frequency-dependence of the complex-valued permittivity is described by:\n\nParameters\n----------\nsubpixel : bool = True\n This value will be transferred to the resulting custom medium. That is, if ``True``, the subpixel averaging will be applied to the custom medium provided the corresponding ``Simulation``'s field ``subpixel`` is set to ``True`` as well. If the resulting medium is not a custom medium (no perturbations), this field does not have an effect.\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\neps_inf : PositiveFloat = 1.0\n [units = None (relative permittivity)]. Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\npoles : Tuple[Tuple[Union[tidy3d.components.types.tidycomplex, tidy3d.components.types.ComplexNumber], Union[tidy3d.components.types.tidycomplex, tidy3d.components.types.ComplexNumber]], ...] = ()\n [units = (rad/sec, rad/sec)]. Tuple of complex-valued (:math:`a_i, c_i`) poles for the model.\neps_inf_perturbation : Optional[ParameterPerturbation] = None\n [units = None (relative permittivity)]. Perturbations to relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\npoles_perturbation : Tuple[Tuple[Optional[tidy3d.components.parameter_perturbation.ParameterPerturbation], Optional[tidy3d.components.parameter_perturbation.ParameterPerturbation]], ...] = ()\n [units = (rad/sec, rad/sec)]. Perturbations to poles of the model.\n\nNote\n----\n.. math::\n\n \\epsilon(\\omega) = \\epsilon_\\infty - \\sum_i\n \\left[\\frac{c_i}{j \\omega + a_i} +\n \\frac{c_i^*}{j \\omega + a_i^*}\\right]\n\nExample\n-------\n>>> from tidy3d import ParameterPerturbation, LinearHeatPerturbation\n>>> c0_perturbation = ParameterPerturbation(\n... heat=LinearHeatPerturbation(temperature_ref=300, coeff=0.0001),\n... )\n>>> pole_res = PerturbationPoleResidue(\n... eps_inf=2.0,\n... poles=[((-1+2j), (3+4j)), ((-5+6j), (7+8j))],\n... poles_perturbation=[(None, c0_perturbation), (None, None)],\n... )", + "type": "object", + "properties": { + "subpixel": { + "title": "Subpixel averaging", + "description": "This value will be transferred to the resulting custom medium. That is, if ``True``, the subpixel averaging will be applied to the custom medium provided the corresponding ``Simulation``'s field ``subpixel`` is set to ``True`` as well. If the resulting medium is not a custom medium (no perturbations), this field does not have an effect.", + "default": true, + "type": "boolean" + }, + "type": { + "title": "Type", + "default": "PerturbationPoleResidue", + "enum": [ + "PerturbationPoleResidue" + ], + "type": "string" + }, + "name": { + "title": "Name", + "description": "Optional unique name for medium.", + "type": "string" + }, + "frequency_range": { + "title": "Frequency Range", + "description": "Optional range of validity for the medium.", + "units": [ + "Hz", + "Hz" + ], + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ + { + "type": "number" + }, + { + "type": "number" + } + ] + }, + "allow_gain": { + "title": "Allow gain medium", + "description": "Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.", + "default": false, + "type": "boolean" + }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, + "eps_inf": { + "title": "Epsilon at Infinity", + "description": "Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).", + "default": 1.0, + "units": "None (relative permittivity)", + "exclusiveMinimum": 0, + "type": "number" + }, + "poles": { + "title": "Poles", + "description": "Tuple of complex-valued (:math:`a_i, c_i`) poles for the model.", + "default": [], + "units": [ + "rad/sec", + "rad/sec" + ], + "type": "array", + "items": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ + { + "anyOf": [ + { + "title": "ComplexNumber", + "description": "Complex number with a well defined schema.", + "type": "object", + "properties": { + "real": { + "title": "Real", + "type": "number" + }, + "imag": { + "title": "Imag", + "type": "number" + } + }, + "required": [ + "real", + "imag" + ] + }, + { + "$ref": "#/definitions/ComplexNumber" + } + ] + }, + { + "anyOf": [ + { + "title": "ComplexNumber", + "description": "Complex number with a well defined schema.", + "type": "object", + "properties": { + "real": { + "title": "Real", + "type": "number" + }, + "imag": { + "title": "Imag", + "type": "number" + } + }, + "required": [ + "real", + "imag" + ] + }, + { + "$ref": "#/definitions/ComplexNumber" + } + ] + } + ] + } + }, + "eps_inf_perturbation": { + "title": "Perturbation of Epsilon at Infinity", + "description": "Perturbations to relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).", + "units": "None (relative permittivity)", + "allOf": [ + { + "$ref": "#/definitions/ParameterPerturbation" + } + ] + }, + "poles_perturbation": { + "title": "Perturbations of Poles", + "description": "Perturbations to poles of the model.", + "default": [], + "units": [ + "rad/sec", + "rad/sec" + ], + "type": "array", + "items": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ + { + "$ref": "#/definitions/ParameterPerturbation" + }, + { + "$ref": "#/definitions/ParameterPerturbation" + } + ] + } + } + }, + "additionalProperties": false + }, + "Box": { + "title": "Box", + "description": "Rectangular prism.\n Also base class for :class:`Simulation`, :class:`Monitor`, and :class:`Source`.\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.\n\nExample\n-------\n>>> b = Box(center=(1,2,3), size=(2,2,2))", + "type": "object", + "properties": { + "type": { + "title": "Type", + "default": "Box", + "enum": [ + "Box" + ], + "type": "string" + }, + "center": { + "title": "Center", + "description": "Center of object in x, y, and z.", + "default": [ + 0.0, + 0.0, + 0.0 + ], + "units": "um", + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "number" + }, + { + "type": "number" + }, + { + "type": "number" + } + ] + }, + "size": { + "title": "Size", + "description": "Size in x, y, and z directions.", + "units": "um", + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "number", + "minimum": 0 + }, + { + "type": "number", + "minimum": 0 + }, + { + "type": "number", + "minimum": 0 + } + ] + } + }, + "required": [ + "size" + ], + "additionalProperties": false + }, + "Sphere": { + "title": "Sphere", + "description": "Spherical geometry.\n\nParameters\n----------\nradius : NonNegativeFloat\n [units = um]. Radius of geometry.\ncenter : Tuple[float, float, float] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\n\nExample\n-------\n>>> b = Sphere(center=(1,2,3), radius=2)", + "type": "object", + "properties": { + "type": { + "title": "Type", + "default": "Sphere", + "enum": [ + "Sphere" + ], + "type": "string" + }, + "radius": { + "title": "Radius", + "description": "Radius of geometry.", + "units": "um", + "minimum": 0, + "type": "number" + }, + "center": { + "title": "Center", + "description": "Center of object in x, y, and z.", + "default": [ + 0.0, + 0.0, + 0.0 + ], + "units": "um", + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "number" + }, + { + "type": "number" + }, + { + "type": "number" + } + ] + } + }, + "required": [ + "radius" + ], + "additionalProperties": false + }, + "Cylinder": { + "title": "Cylinder", + "description": "Cylindrical geometry with optional sidewall angle along axis\ndirection. When ``sidewall_angle`` is nonzero, the shape is a\nconical frustum or a cone.\n\nParameters\n----------\naxis : Literal[0, 1, 2] = 2\n Specifies dimension of the planar axis (0,1,2) -> (x,y,z).\nsidewall_angle : ConstrainedFloatValue = 0.0\n [units = rad]. Angle of the sidewall. ``sidewall_angle=0`` (default) specifies a vertical wall; ``0>> c = Cylinder(center=(1,2,3), radius=2, length=5, axis=2)", + "type": "object", + "properties": { + "type": { + "title": "Type", + "default": "Cylinder", + "enum": [ + "Cylinder" + ], + "type": "string" + }, + "axis": { + "title": "Axis", + "description": "Specifies dimension of the planar axis (0,1,2) -> (x,y,z).", + "default": 2, + "enum": [ + 0, + 1, + 2 ], "type": "integer" }, @@ -2530,6 +3352,86 @@ ], "additionalProperties": false }, + "ComplexPolySlabBase": { + "title": "ComplexPolySlabBase", + "description": "Interface for dividing a complex polyslab where self-intersecting polygon can\noccur during extrusion. This class should not be used directly. Use instead\n:class:`plugins.polyslab.ComplexPolySlab`.\n\nParameters\n----------\naxis : Literal[0, 1, 2] = 2\n Specifies dimension of the planar axis (0,1,2) -> (x,y,z).\nsidewall_angle : ConstrainedFloatValue = 0.0\n [units = rad]. Angle of the sidewall. ``sidewall_angle=0`` (default) specifies a vertical wall; ``0 (x,y,z).", + "default": 2, + "enum": [ + 0, + 1, + 2 + ], + "type": "integer" + }, + "sidewall_angle": { + "title": "Sidewall angle", + "description": "Angle of the sidewall. ``sidewall_angle=0`` (default) specifies a vertical wall; ``0>> drude_medium = Drude(eps_inf=2.0, coeffs=[(1,2), (3,4)])\n>>> medium2d = Medium2D(ss=drude_medium, tt=drude_medium)", + "description": "2D diagonally anisotropic medium.\n\nParameters\n----------\nname : Optional[str] = None\n Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n [units = (Hz, Hz)]. Optional range of validity for the medium.\nallow_gain : bool = False\n Allow the medium to be active. Caution: simulations with gain medium are unstable, and are likely to diverge.Simulations where 'allow_gain' is set to 'True' will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.\nnonlinear_spec : Optional[NonlinearSusceptibility] = None\n Nonlinear spec applied on top of the base medium properties.\nss : Union[Medium, PoleResidue, Sellmeier, Lorentz, Debye, Drude]\n Medium describing the ss-component of the diagonal permittivity tensor. The ss-component refers to the in-plane dimension of the medium that is the first component in order of 'x', 'y', 'z'. If the 2D material is normal to the y-axis, for example, then this determines the xx-component of the corresponding 3D medium.\ntt : Union[Medium, PoleResidue, Sellmeier, Lorentz, Debye, Drude]\n Medium describing the tt-component of the diagonal permittivity tensor. The tt-component refers to the in-plane dimension of the medium that is the second component in order of 'x', 'y', 'z'. If the 2D material is normal to the y-axis, for example, then this determines the zz-component of the corresponding 3D medium.\n\nNote\n----\nOnly diagonal anisotropy is currently supported.\n\nExample\n-------\n>>> drude_medium = Drude(eps_inf=2.0, coeffs=[(1,2), (3,4)])\n>>> medium2d = Medium2D(ss=drude_medium, tt=drude_medium)", "type": "object", "properties": { "name": { @@ -2679,6 +3685,15 @@ "default": false, "type": "boolean" }, + "nonlinear_spec": { + "title": "Nonlinear Spec", + "description": "Nonlinear spec applied on top of the base medium properties.", + "allOf": [ + { + "$ref": "#/definitions/NonlinearSusceptibility" + } + ] + }, "type": { "title": "Type", "default": "Medium2D", @@ -2766,7 +3781,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----------\ngeometry : Union[Box, Sphere, Cylinder, PolySlab, TriangleMesh, GeometryGroup]\n Defines geometric properties of the structure.\nname : Optional[str] = None\n Optional name for the structure.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, Medium2D]\n Defines the electromagnetic properties of the structure's medium.\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')", + "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----------\ngeometry : Union[Box, ClipOperation, GeometryGroup, Sphere, Cylinder, PolySlab, ComplexPolySlabBase, TriangleMesh]\n Defines geometric properties of the structure.\nname : Optional[str] = None\n Optional name for the structure.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D]\n Defines the electromagnetic properties of the structure's medium.\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')", "type": "object", "properties": { "geometry": { @@ -2776,17 +3791,25 @@ "propertyName": "type", "mapping": { "Box": "#/definitions/Box", + "ClipOperation": "#/definitions/ClipOperation", + "GeometryGroup": "#/definitions/GeometryGroup", "Sphere": "#/definitions/Sphere", "Cylinder": "#/definitions/Cylinder", "PolySlab": "#/definitions/PolySlab", - "TriangleMesh": "#/definitions/TriangleMesh", - "GeometryGroup": "#/definitions/GeometryGroup" + "ComplexPolySlabBase": "#/definitions/ComplexPolySlabBase", + "TriangleMesh": "#/definitions/TriangleMesh" } }, "oneOf": [ { "$ref": "#/definitions/Box" }, + { + "$ref": "#/definitions/ClipOperation" + }, + { + "$ref": "#/definitions/GeometryGroup" + }, { "$ref": "#/definitions/Sphere" }, @@ -2797,10 +3820,10 @@ "$ref": "#/definitions/PolySlab" }, { - "$ref": "#/definitions/TriangleMesh" + "$ref": "#/definitions/ComplexPolySlabBase" }, { - "$ref": "#/definitions/GeometryGroup" + "$ref": "#/definitions/TriangleMesh" } ] }, @@ -2839,6 +3862,8 @@ "CustomDebye": "#/definitions/CustomDebye", "CustomDrude": "#/definitions/CustomDrude", "CustomAnisotropicMedium": "#/definitions/CustomAnisotropicMedium", + "PerturbationMedium": "#/definitions/PerturbationMedium", + "PerturbationPoleResidue": "#/definitions/PerturbationPoleResidue", "Medium2D": "#/definitions/Medium2D" } }, @@ -2891,6 +3916,12 @@ { "$ref": "#/definitions/CustomAnisotropicMedium" }, + { + "$ref": "#/definitions/PerturbationMedium" + }, + { + "$ref": "#/definitions/PerturbationPoleResidue" + }, { "$ref": "#/definitions/Medium2D" } @@ -2905,7 +3936,7 @@ }, "GaussianPulse": { "title": "GaussianPulse", - "description": "Source time dependence that describes a Gaussian pulse.\n\nParameters\n----------\namplitude : NonNegativeFloat = 1.0\n Real-valued maximum amplitude of the time dependence.\nphase : float = 0.0\n [units = rad]. Phase shift of the time dependence.\nfreq0 : PositiveFloat\n [units = Hz]. Central frequency of the pulse.\nfwidth : PositiveFloat\n [units = Hz]. Standard deviation of the frequency content of the pulse.\noffset : ConstrainedFloatValue = 5.0\n Time delay of the maximum value of the pulse in units of 1 / (``2pi * fwidth``).\n\nExample\n-------\n>>> pulse = GaussianPulse(freq0=200e12, fwidth=20e12)", + "description": "Source time dependence that describes a Gaussian pulse.\n\nParameters\n----------\namplitude : NonNegativeFloat = 1.0\n Real-valued maximum amplitude of the time dependence.\nphase : float = 0.0\n [units = rad]. Phase shift of the time dependence.\nfreq0 : PositiveFloat\n [units = Hz]. Central frequency of the pulse.\nfwidth : PositiveFloat\n [units = Hz]. Standard deviation of the frequency content of the pulse.\noffset : ConstrainedFloatValue = 5.0\n Time delay of the maximum value of the pulse in units of 1 / (``2pi * fwidth``).\nremove_dc_component : bool = True\n Whether to remove the DC component in the Gaussian pulse spectrum. If ``True``, the Gaussian pulse is modified at low frequencies to zero out the DC component, which is usually desirable so that the fields will decay. However, for broadband simulations, it may be better to have non-vanishing source power near zero frequency. Setting this to ``False`` results in an unmodified Gaussian pulse spectrum which can have a nonzero DC component.\n\nExample\n-------\n>>> pulse = GaussianPulse(freq0=200e12, fwidth=20e12)", "type": "object", "properties": { "amplitude": { @@ -2950,6 +3981,12 @@ "default": 5.0, "minimum": 2.5, "type": "number" + }, + "remove_dc_component": { + "title": "Remove DC Component", + "description": "Whether to remove the DC component in the Gaussian pulse spectrum. If ``True``, the Gaussian pulse is modified at low frequencies to zero out the DC component, which is usually desirable so that the fields will decay. However, for broadband simulations, it may be better to have non-vanishing source power near zero frequency. Setting this to ``False`` results in an unmodified Gaussian pulse spectrum which can have a nonzero DC component.", + "default": true, + "type": "boolean" } }, "required": [ @@ -3048,7 +4085,7 @@ }, "CustomSourceTime": { "title": "CustomSourceTime", - "description": "Custom source time dependence, real or complex valued.\n\nParameters\n----------\namplitude : NonNegativeFloat = 1.0\n Real-valued maximum amplitude of the time dependence.\nphase : float = 0.0\n [units = rad]. Phase shift of the time dependence.\nfreq0 : PositiveFloat\n [units = Hz]. Central frequency of the pulse.\nfwidth : PositiveFloat\n [units = Hz]. Standard deviation of the frequency content of the pulse.\noffset : ConstrainedFloatValue = 5.0\n Time delay of the maximum value of the pulse in units of 1 / (``2pi * fwidth``).\nsource_time_dataset : Optional[TimeDataset]\n Dataset for storing the custom source time.\n\nNote\n----\nThe source time dependence is linearly interpolated to the simulation time steps.\nTo ensure that this interpolation does not introduce artifacts, it is necessary\nto use a sampling rate that is sufficiently fast relative to the simulation time step.\n\nExample\n-------\n>>> cst = td.CustomSourceTime.from_values(freq0=1, fwidth=0.1,\n>>> values=np.linspace(0, 9, 10), dt=0.1)", + "description": "Custom source time dependence consisting of a real or complex envelope\nmodulated at a central frequency, as shown below.\n\nParameters\n----------\namplitude : NonNegativeFloat = 1.0\n Real-valued maximum amplitude of the time dependence.\nphase : float = 0.0\n [units = rad]. Phase shift of the time dependence.\nfreq0 : PositiveFloat\n [units = Hz]. Central frequency of the pulse.\nfwidth : PositiveFloat\n [units = Hz]. Standard deviation of the frequency content of the pulse.\noffset : float = 0.0\n Time delay of the envelope in units of 1 / (``2pi * fwidth``).\nsource_time_dataset : Optional[TimeDataset]\n Dataset for storing the envelope of the custom source time. This envelope will be modulated by a complex exponential at frequency ``freq0``.\n\nNote\n----\n.. math::\n\n amp\\_time(t) = amplitude \\cdot \\\n e^{i \\cdot phase - 2 \\pi i \\cdot freq0 \\cdot t} \\cdot \\\n envelope(t - offset / (2 \\pi \\cdot fwidth))\n\nNote\n----\nThe source time dependence is linearly interpolated to the simulation time steps.\nTo ensure that this interpolation does not introduce artifacts, it is necessary\nto use a sampling rate that is sufficiently fast relative to the simulation time step.\nThe source should also ideally start at zero and ramp up smoothly.\nThe first and last values of the envelope will be used for times that are out of range\nof the provided data.\n\nExample\n-------\n>>> cst = CustomSourceTime.from_values(freq0=1, fwidth=0.1,\n... values=np.linspace(0, 9, 10), dt=0.1)", "type": "object", "properties": { "amplitude": { @@ -3089,14 +4126,13 @@ }, "offset": { "title": "Offset", - "description": "Time delay of the maximum value of the pulse in units of 1 / (``2pi * fwidth``).", - "default": 5.0, - "minimum": 2.5, + "description": "Time delay of the envelope in units of 1 / (``2pi * fwidth``).", + "default": 0.0, "type": "number" }, "source_time_dataset": { "title": "Source time dataset", - "description": "Dataset for storing the custom source time.", + "description": "Dataset for storing the envelope of the custom source time. This envelope will be modulated by a complex exponential at frequency ``freq0``.", "allOf": [ { "$ref": "#/definitions/TimeDataset" @@ -3335,7 +4371,7 @@ }, "GaussianBeam": { "title": "GaussianBeam", - "description": "Guassian distribution on finite extent plane.\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.\nsource_time : Union[GaussianPulse, ContinuousWave, CustomSourceTime]\n Specification of the source time-dependence.\nname : Optional[str] = None\n Optional name for the source.\nnum_freqs : ConstrainedIntValue = 1\n Number of points used to approximate the frequency dependence of injected field. A Chebyshev interpolation is used, thus, only a small number of points, i.e., less than 20, is typically sufficient to obtain converged results.\ndirection : Literal['+', '-']\n Specifies propagation in the positive or negative direction of the injection axis.\nangle_theta : float = 0.0\n [units = rad]. Polar angle of the propagation axis from the injection axis.\nangle_phi : float = 0.0\n [units = rad]. Azimuth angle of the propagation axis in the plane orthogonal to the injection axis.\npol_angle : float = 0\n [units = rad]. Specifies the angle between the electric field polarization of the source and the plane defined by the injection axis and the propagation axis (rad). ``pol_angle=0`` (default) specifies P polarization, while ``pol_angle=np.pi/2`` specifies S polarization. At normal incidence when S and P are undefined, ``pol_angle=0`` defines: - ``Ey`` polarization for propagation along ``x``.- ``Ex`` polarization for propagation along ``y``.- ``Ex`` polarization for propagation along ``z``.\nwaist_radius : PositiveFloat = 1.0\n [units = um]. Radius of the beam at the waist.\nwaist_distance : float = 0.0\n [units = um]. Distance from the beam waist along the propagation direction.\n\nExample\n-------\n>>> pulse = GaussianPulse(freq0=200e12, fwidth=20e12)\n>>> gauss = GaussianBeam(\n... size=(0,3,3),\n... source_time=pulse,\n... pol_angle=np.pi / 2,\n... direction='+',\n... waist_radius=1.0)", + "description": "Guassian distribution on finite extent plane.\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.\nsource_time : Union[GaussianPulse, ContinuousWave, CustomSourceTime]\n Specification of the source time-dependence.\nname : Optional[str] = None\n Optional name for the source.\nnum_freqs : ConstrainedIntValue = 1\n Number of points used to approximate the frequency dependence of injected field. A Chebyshev interpolation is used, thus, only a small number of points, i.e., less than 20, is typically sufficient to obtain converged results.\ndirection : Literal['+', '-']\n Specifies propagation in the positive or negative direction of the injection axis.\nangle_theta : float = 0.0\n [units = rad]. Polar angle of the propagation axis from the injection axis.\nangle_phi : float = 0.0\n [units = rad]. Azimuth angle of the propagation axis in the plane orthogonal to the injection axis.\npol_angle : float = 0\n [units = rad]. Specifies the angle between the electric field polarization of the source and the plane defined by the injection axis and the propagation axis (rad). ``pol_angle=0`` (default) specifies P polarization, while ``pol_angle=np.pi/2`` specifies S polarization. At normal incidence when S and P are undefined, ``pol_angle=0`` defines: - ``Ey`` polarization for propagation along ``x``.- ``Ex`` polarization for propagation along ``y``.- ``Ex`` polarization for propagation along ``z``.\nwaist_radius : PositiveFloat = 1.0\n [units = um]. Radius of the beam at the waist.\nwaist_distance : float = 0.0\n [units = um]. Distance from the beam waist along the propagation direction. When ``direction`` is ``+`` and ``waist_distance`` is positive, the waist is on the ``-`` side (behind) the source plane. When ``direction`` is ``+`` and ``waist_distance``is negative, the waist is on the ``+`` side (in front) of the source plane.\n\nExample\n-------\n>>> pulse = GaussianPulse(freq0=200e12, fwidth=20e12)\n>>> gauss = GaussianBeam(\n... size=(0,3,3),\n... source_time=pulse,\n... pol_angle=np.pi / 2,\n... direction='+',\n... waist_radius=1.0)", "type": "object", "properties": { "type": { @@ -3460,7 +4496,7 @@ }, "waist_distance": { "title": "Waist Distance", - "description": "Distance from the beam waist along the propagation direction.", + "description": "Distance from the beam waist along the propagation direction. When ``direction`` is ``+`` and ``waist_distance`` is positive, the waist is on the ``-`` side (behind) the source plane. When ``direction`` is ``+`` and ``waist_distance``is negative, the waist is on the ``+`` side (in front) of the source plane.", "default": 0.0, "units": "um", "type": "number" @@ -3475,7 +4511,7 @@ }, "AstigmaticGaussianBeam": { "title": "AstigmaticGaussianBeam", - "description": "This class implements the simple astigmatic Gaussian beam described in Kochkina et al.,\nApplied Optics, vol. 52, issue 24, 2013. The simple astigmatic Guassian distribution allows\nboth an elliptical intensity profile and different waist locations for the two principal axes\nof the ellipse. When equal waist sizes and equal waist distances are specified in the two\ndirections, this source becomes equivalent to :class:`GaussianBeam`.\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.\nsource_time : Union[GaussianPulse, ContinuousWave, CustomSourceTime]\n Specification of the source time-dependence.\nname : Optional[str] = None\n Optional name for the source.\nnum_freqs : ConstrainedIntValue = 1\n Number of points used to approximate the frequency dependence of injected field. A Chebyshev interpolation is used, thus, only a small number of points, i.e., less than 20, is typically sufficient to obtain converged results.\ndirection : Literal['+', '-']\n Specifies propagation in the positive or negative direction of the injection axis.\nangle_theta : float = 0.0\n [units = rad]. Polar angle of the propagation axis from the injection axis.\nangle_phi : float = 0.0\n [units = rad]. Azimuth angle of the propagation axis in the plane orthogonal to the injection axis.\npol_angle : float = 0\n [units = rad]. Specifies the angle between the electric field polarization of the source and the plane defined by the injection axis and the propagation axis (rad). ``pol_angle=0`` (default) specifies P polarization, while ``pol_angle=np.pi/2`` specifies S polarization. At normal incidence when S and P are undefined, ``pol_angle=0`` defines: - ``Ey`` polarization for propagation along ``x``.- ``Ex`` polarization for propagation along ``y``.- ``Ex`` polarization for propagation along ``z``.\nwaist_sizes : Tuple[PositiveFloat, PositiveFloat] = (1.0, 1.0)\n [units = um]. Size of the beam at the waist in the local x and y directions.\nwaist_distances : Tuple[float, float] = (0.0, 0.0)\n [units = um]. Distance to the beam waist along the propagation direction for the waist sizes in the local x and y directions.\n\nExample\n-------\n>>> pulse = GaussianPulse(freq0=200e12, fwidth=20e12)\n>>> gauss = AstigmaticGaussianBeam(\n... size=(0,3,3),\n... source_time=pulse,\n... pol_angle=np.pi / 2,\n... direction='+',\n... waist_sizes=(1.0, 2.0),\n... waist_distances = (3.0, 4.0))", + "description": "This class implements the simple astigmatic Gaussian beam described in Kochkina et al.,\nApplied Optics, vol. 52, issue 24, 2013. The simple astigmatic Guassian distribution allows\nboth an elliptical intensity profile and different waist locations for the two principal axes\nof the ellipse. When equal waist sizes and equal waist distances are specified in the two\ndirections, this source becomes equivalent to :class:`GaussianBeam`.\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.\nsource_time : Union[GaussianPulse, ContinuousWave, CustomSourceTime]\n Specification of the source time-dependence.\nname : Optional[str] = None\n Optional name for the source.\nnum_freqs : ConstrainedIntValue = 1\n Number of points used to approximate the frequency dependence of injected field. A Chebyshev interpolation is used, thus, only a small number of points, i.e., less than 20, is typically sufficient to obtain converged results.\ndirection : Literal['+', '-']\n Specifies propagation in the positive or negative direction of the injection axis.\nangle_theta : float = 0.0\n [units = rad]. Polar angle of the propagation axis from the injection axis.\nangle_phi : float = 0.0\n [units = rad]. Azimuth angle of the propagation axis in the plane orthogonal to the injection axis.\npol_angle : float = 0\n [units = rad]. Specifies the angle between the electric field polarization of the source and the plane defined by the injection axis and the propagation axis (rad). ``pol_angle=0`` (default) specifies P polarization, while ``pol_angle=np.pi/2`` specifies S polarization. At normal incidence when S and P are undefined, ``pol_angle=0`` defines: - ``Ey`` polarization for propagation along ``x``.- ``Ex`` polarization for propagation along ``y``.- ``Ex`` polarization for propagation along ``z``.\nwaist_sizes : Tuple[PositiveFloat, PositiveFloat] = (1.0, 1.0)\n [units = um]. Size of the beam at the waist in the local x and y directions.\nwaist_distances : Tuple[float, float] = (0.0, 0.0)\n [units = um]. Distance to the beam waist along the propagation direction for the waist sizes in the local x and y directions. When ``direction`` is ``+`` and ``waist_distances`` are positive, the waist is on the ``-`` side (behind) the source plane. When ``direction`` is ``+`` and ``waist_distances`` are negative, the waist is on the ``+`` side (in front) of the source plane.\n\nExample\n-------\n>>> pulse = GaussianPulse(freq0=200e12, fwidth=20e12)\n>>> gauss = AstigmaticGaussianBeam(\n... size=(0,3,3),\n... source_time=pulse,\n... pol_angle=np.pi / 2,\n... direction='+',\n... waist_sizes=(1.0, 2.0),\n... waist_distances = (3.0, 4.0))", "type": "object", "properties": { "type": { @@ -3614,7 +4650,7 @@ }, "waist_distances": { "title": "Waist distances", - "description": "Distance to the beam waist along the propagation direction for the waist sizes in the local x and y directions.", + "description": "Distance to the beam waist along the propagation direction for the waist sizes in the local x and y directions. When ``direction`` is ``+`` and ``waist_distances`` are positive, the waist is on the ``-`` side (behind) the source plane. When ``direction`` is ``+`` and ``waist_distances`` are negative, the waist is on the ``+`` side (in front) of the source plane.", "default": [ 0.0, 0.0 @@ -5117,7 +6153,7 @@ }, "FieldMonitor": { "title": "FieldMonitor", - "description": ":class:`Monitor` that records electromagnetic fields in the frequency domain.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nfields : Tuple[Literal['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz'], ...] = ['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz']\n Collection of field components to store in the monitor.\ninterval_space : Tuple[PositiveInt, PositiveInt, PositiveInt] = (1, 1, 1)\n Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, fields will be downsampled and automatically colocated.\ncolocate : Optional[bool] = None\n Toggle whether fields should be colocated to grid cell centers. Default: ``False`` if ``interval_space`` is 1 in each direction, ``True`` if ``interval_space`` is greater than one in any direction.\n\nExample\n-------\n>>> monitor = FieldMonitor(\n... center=(1,2,3),\n... size=(2,2,2),\n... fields=['Hx'],\n... freqs=[250e12, 300e12],\n... name='steady_state_monitor')", + "description": ":class:`Monitor` that records electromagnetic fields in the frequency domain.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\ninterval_space : Tuple[PositiveInt, PositiveInt, PositiveInt] = (1, 1, 1)\n Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included.\ncolocate : Optional[bool] = None\n Toggle whether fields should be colocated to grid cell boundaries (i.e. primal grid nodes). Default is ``True``.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nfields : Tuple[Literal['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz'], ...] = ['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz']\n Collection of field components to store in the monitor.\n\nExample\n-------\n>>> monitor = FieldMonitor(\n... center=(1,2,3),\n... size=(2,2,2),\n... fields=['Hx'],\n... freqs=[250e12, 300e12],\n... name='steady_state_monitor',\n... colocate=True)", "type": "object", "properties": { "type": { @@ -5180,6 +6216,37 @@ "minLength": 1, "type": "string" }, + "interval_space": { + "title": "Spatial interval", + "description": "Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included.", + "default": [ + 1, + 1, + 1 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "integer", + "exclusiveMinimum": 0 + }, + { + "type": "integer", + "exclusiveMinimum": 0 + }, + { + "type": "integer", + "exclusiveMinimum": 0 + } + ] + }, + "colocate": { + "title": "Colocate fields", + "description": "Toggle whether fields should be colocated to grid cell boundaries (i.e. primal grid nodes). Default is ``True``.", + "type": "boolean" + }, "freqs": { "title": "Frequencies", "description": "Array or list of frequencies stored by the field monitor.", @@ -5234,37 +6301,6 @@ ], "type": "string" } - }, - "interval_space": { - "title": "Spatial interval", - "description": "Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, fields will be downsampled and automatically colocated.", - "default": [ - 1, - 1, - 1 - ], - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "integer", - "exclusiveMinimum": 0 - }, - { - "type": "integer", - "exclusiveMinimum": 0 - }, - { - "type": "integer", - "exclusiveMinimum": 0 - } - ] - }, - "colocate": { - "title": "Colocate fields", - "description": "Toggle whether fields should be colocated to grid cell centers. Default: ``False`` if ``interval_space`` is 1 in each direction, ``True`` if ``interval_space`` is greater than one in any direction.", - "type": "boolean" } }, "required": [ @@ -5276,7 +6312,7 @@ }, "FieldTimeMonitor": { "title": "FieldTimeMonitor", - "description": ":class:`Monitor` that records electromagnetic fields in the time domain.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\nstart : NonNegativeFloat = 0.0\n [units = sec]. Time at which to start monitor recording.\nstop : Optional[NonNegativeFloat] = None\n [units = sec]. Time at which to stop monitor recording. If not specified, record until end of simulation.\ninterval : PositiveInt = 1\n Number of time step intervals between monitor recordings.\nfields : Tuple[Literal['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz'], ...] = ['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz']\n Collection of field components to store in the monitor.\ninterval_space : Tuple[PositiveInt, PositiveInt, PositiveInt] = (1, 1, 1)\n Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, fields will be downsampled and automatically colocated.\ncolocate : Optional[bool] = None\n Toggle whether fields should be colocated to grid cell centers. Default: ``False`` if ``interval_space`` is 1 in each direction, ``True`` if ``interval_space`` is greater than one in any direction.\n\nExample\n-------\n>>> monitor = FieldTimeMonitor(\n... center=(1,2,3),\n... size=(2,2,2),\n... fields=['Hx'],\n... start=1e-13,\n... stop=5e-13,\n... interval=2,\n... name='movie_monitor')", + "description": ":class:`Monitor` that records electromagnetic fields in the time domain.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\ninterval_space : Tuple[PositiveInt, PositiveInt, PositiveInt] = (1, 1, 1)\n Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included.\ncolocate : Optional[bool] = None\n Toggle whether fields should be colocated to grid cell boundaries (i.e. primal grid nodes). Default is ``True``.\nstart : NonNegativeFloat = 0.0\n [units = sec]. Time at which to start monitor recording.\nstop : Optional[NonNegativeFloat] = None\n [units = sec]. Time at which to stop monitor recording. If not specified, record until end of simulation.\ninterval : PositiveInt = 1\n Number of time step intervals between monitor recordings.\nfields : Tuple[Literal['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz'], ...] = ['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz']\n Collection of field components to store in the monitor.\n\nExample\n-------\n>>> monitor = FieldTimeMonitor(\n... center=(1,2,3),\n... size=(2,2,2),\n... fields=['Hx'],\n... start=1e-13,\n... stop=5e-13,\n... interval=2,\n... colocate=True,\n... name='movie_monitor')", "type": "object", "properties": { "type": { @@ -5339,6 +6375,37 @@ "minLength": 1, "type": "string" }, + "interval_space": { + "title": "Spatial interval", + "description": "Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included.", + "default": [ + 1, + 1, + 1 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "integer", + "exclusiveMinimum": 0 + }, + { + "type": "integer", + "exclusiveMinimum": 0 + }, + { + "type": "integer", + "exclusiveMinimum": 0 + } + ] + }, + "colocate": { + "title": "Colocate fields", + "description": "Toggle whether fields should be colocated to grid cell boundaries (i.e. primal grid nodes). Default is ``True``.", + "type": "boolean" + }, "start": { "title": "Start time", "description": "Time at which to start monitor recording.", @@ -5384,37 +6451,6 @@ ], "type": "string" } - }, - "interval_space": { - "title": "Spatial interval", - "description": "Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, fields will be downsampled and automatically colocated.", - "default": [ - 1, - 1, - 1 - ], - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [ - { - "type": "integer", - "exclusiveMinimum": 0 - }, - { - "type": "integer", - "exclusiveMinimum": 0 - }, - { - "type": "integer", - "exclusiveMinimum": 0 - } - ] - }, - "colocate": { - "title": "Colocate fields", - "description": "Toggle whether fields should be colocated to grid cell centers. Default: ``False`` if ``interval_space`` is 1 in each direction, ``True`` if ``interval_space`` is greater than one in any direction.", - "type": "boolean" } }, "required": [ @@ -5425,7 +6461,7 @@ }, "PermittivityMonitor": { "title": "PermittivityMonitor", - "description": ":class:`Monitor` that records the diagonal components of the complex-valued relative\npermittivity tensor in the frequency domain. The recorded data has the same shape as a\n:class:`.FieldMonitor` of the same geometry: the permittivity values are saved at the\nYee grid locations, and can be interpolated to any point inside the monitor.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\n\nNote\n----\nIf 2D materials are present, then the permittivity values correspond to the\nvolumetric equivalent of the 2D materials.\n\nExample\n-------\n>>> monitor = PermittivityMonitor(\n... center=(1,2,3),\n... size=(2,2,2),\n... freqs=[250e12, 300e12],\n... name='eps_monitor')", + "description": ":class:`Monitor` that records the diagonal components of the complex-valued relative\npermittivity tensor in the frequency domain. The recorded data has the same shape as a\n:class:`.FieldMonitor` of the same geometry: the permittivity values are saved at the\nYee grid locations, and can be interpolated to any point inside the monitor.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\ninterval_space : Tuple[PositiveInt, PositiveInt, PositiveInt] = (1, 1, 1)\n Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included.\ncolocate : Literal[False] = False\n Colocation turned off, since colocated permittivity values do not have a physical meaning - they do not correspond to the subpixel-averaged ones.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\n\nNote\n----\nIf 2D materials are present, then the permittivity values correspond to the\nvolumetric equivalent of the 2D materials.\n\nExample\n-------\n>>> monitor = PermittivityMonitor(\n... center=(1,2,3),\n... size=(2,2,2),\n... freqs=[250e12, 300e12],\n... name='eps_monitor')", "type": "object", "properties": { "type": { @@ -5488,6 +6524,41 @@ "minLength": 1, "type": "string" }, + "interval_space": { + "title": "Spatial interval", + "description": "Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included.", + "default": [ + 1, + 1, + 1 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "integer", + "exclusiveMinimum": 0 + }, + { + "type": "integer", + "exclusiveMinimum": 0 + }, + { + "type": "integer", + "exclusiveMinimum": 0 + } + ] + }, + "colocate": { + "title": "Colocate fields", + "description": "Colocation turned off, since colocated permittivity values do not have a physical meaning - they do not correspond to the subpixel-averaged ones.", + "default": false, + "enum": [ + false + ], + "type": "boolean" + }, "freqs": { "title": "Frequencies", "description": "Array or list of frequencies stored by the field monitor.", @@ -5529,7 +6600,7 @@ }, "FluxMonitor": { "title": "FluxMonitor", - "description": ":class:`Monitor` that records power flux in the frequency domain.\nIf the monitor geometry is a 2D box, the total flux through this plane is returned, with a\npositive sign corresponding to power flow in the positive direction along the axis normal to\nthe plane. If the geometry is a 3D box, the total power coming out of the box is returned by\nintegrating the flux over all box surfaces (excpet the ones defined in ``exclude_surfaces``).\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.\nname : ConstrainedStrValue\n Unique name for monitor.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nnormal_dir : Optional[Literal['+', '-']] = None\n Direction of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of ``'+'`` or ``'-'``. Applies to surface monitors only, and defaults to ``'+'`` if not provided.\nexclude_surfaces : Optional[Tuple[Literal['x-', 'x+', 'y-', 'y+', 'z-', 'z+'], ...]] = None\n Surfaces to exclude in the integration, if a volume monitor.\n\nExample\n-------\n>>> monitor = FluxMonitor(\n... center=(1,2,3),\n... size=(2,2,0),\n... freqs=[200e12, 210e12],\n... name='flux_monitor')", + "description": ":class:`Monitor` that records power flux in the frequency domain.\nIf the monitor geometry is a 2D box, the total flux through this plane is returned, with a\npositive sign corresponding to power flow in the positive direction along the axis normal to\nthe plane. If the geometry is a 3D box, the total power coming out of the box is returned by\nintegrating the flux over all box surfaces (excpet the ones defined in ``exclude_surfaces``).\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.\nname : ConstrainedStrValue\n Unique name for monitor.\ninterval_space : Tuple[Literal[1], Literal[1], Literal[1]] = (1, 1, 1)\n Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.\ncolocate : Literal[True] = True\n Defines whether fields are colocated to grid cell boundaries (i.e. to the primal grid) on-the-fly during a solver run. Can be toggled for field recording monitors and is hard-coded for other monitors depending on their specific function.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nnormal_dir : Optional[Literal['+', '-']] = None\n Direction of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of ``'+'`` or ``'-'``. Applies to surface monitors only, and defaults to ``'+'`` if not provided.\nexclude_surfaces : Optional[Tuple[Literal['x-', 'x+', 'y-', 'y+', 'z-', 'z+'], ...]] = None\n Surfaces to exclude in the integration, if a volume monitor.\n\nExample\n-------\n>>> monitor = FluxMonitor(\n... center=(1,2,3),\n... size=(2,2,0),\n... freqs=[200e12, 210e12],\n... name='flux_monitor')", "type": "object", "properties": { "type": { @@ -5592,6 +6663,47 @@ "minLength": 1, "type": "string" }, + "interval_space": { + "title": "Spatial interval", + "description": "Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.", + "default": [ + 1, + 1, + 1 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + } + ] + }, + "colocate": { + "title": "Colocate fields", + "description": "Defines whether fields are colocated to grid cell boundaries (i.e. to the primal grid) on-the-fly during a solver run. Can be toggled for field recording monitors and is hard-coded for other monitors depending on their specific function.", + "default": true, + "enum": [ + true + ], + "type": "boolean" + }, "freqs": { "title": "Frequencies", "description": "Array or list of frequencies stored by the field monitor.", @@ -5658,7 +6770,7 @@ }, "FluxTimeMonitor": { "title": "FluxTimeMonitor", - "description": ":class:`Monitor` that records power flux in the time domain.\nIf the monitor geometry is a 2D box, the total flux through this plane is returned, with a\npositive sign corresponding to power flow in the positive direction along the axis normal to\nthe plane. If the geometry is a 3D box, the total power coming out of the box is returned by\nintegrating the flux over all box surfaces (excpet the ones defined in ``exclude_surfaces``).\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.\nname : ConstrainedStrValue\n Unique name for monitor.\nstart : NonNegativeFloat = 0.0\n [units = sec]. Time at which to start monitor recording.\nstop : Optional[NonNegativeFloat] = None\n [units = sec]. Time at which to stop monitor recording. If not specified, record until end of simulation.\ninterval : PositiveInt = 1\n Number of time step intervals between monitor recordings.\nnormal_dir : Optional[Literal['+', '-']] = None\n Direction of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of ``'+'`` or ``'-'``. Applies to surface monitors only, and defaults to ``'+'`` if not provided.\nexclude_surfaces : Optional[Tuple[Literal['x-', 'x+', 'y-', 'y+', 'z-', 'z+'], ...]] = None\n Surfaces to exclude in the integration, if a volume monitor.\n\nExample\n-------\n>>> monitor = FluxTimeMonitor(\n... center=(1,2,3),\n... size=(2,2,0),\n... start=1e-13,\n... stop=5e-13,\n... interval=2,\n... name='flux_vs_time')", + "description": ":class:`Monitor` that records power flux in the time domain.\nIf the monitor geometry is a 2D box, the total flux through this plane is returned, with a\npositive sign corresponding to power flow in the positive direction along the axis normal to\nthe plane. If the geometry is a 3D box, the total power coming out of the box is returned by\nintegrating the flux over all box surfaces (excpet the ones defined in ``exclude_surfaces``).\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.\nname : ConstrainedStrValue\n Unique name for monitor.\ninterval_space : Tuple[Literal[1], Literal[1], Literal[1]] = (1, 1, 1)\n Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.\ncolocate : Literal[True] = True\n Defines whether fields are colocated to grid cell boundaries (i.e. to the primal grid) on-the-fly during a solver run. Can be toggled for field recording monitors and is hard-coded for other monitors depending on their specific function.\nstart : NonNegativeFloat = 0.0\n [units = sec]. Time at which to start monitor recording.\nstop : Optional[NonNegativeFloat] = None\n [units = sec]. Time at which to stop monitor recording. If not specified, record until end of simulation.\ninterval : PositiveInt = 1\n Number of time step intervals between monitor recordings.\nnormal_dir : Optional[Literal['+', '-']] = None\n Direction of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of ``'+'`` or ``'-'``. Applies to surface monitors only, and defaults to ``'+'`` if not provided.\nexclude_surfaces : Optional[Tuple[Literal['x-', 'x+', 'y-', 'y+', 'z-', 'z+'], ...]] = None\n Surfaces to exclude in the integration, if a volume monitor.\n\nExample\n-------\n>>> monitor = FluxTimeMonitor(\n... center=(1,2,3),\n... size=(2,2,0),\n... start=1e-13,\n... stop=5e-13,\n... interval=2,\n... name='flux_vs_time')", "type": "object", "properties": { "type": { @@ -5721,6 +6833,47 @@ "minLength": 1, "type": "string" }, + "interval_space": { + "title": "Spatial interval", + "description": "Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.", + "default": [ + 1, + 1, + 1 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + } + ] + }, + "colocate": { + "title": "Colocate fields", + "description": "Defines whether fields are colocated to grid cell boundaries (i.e. to the primal grid) on-the-fly during a solver run. Can be toggled for field recording monitors and is hard-coded for other monitors depending on their specific function.", + "default": true, + "enum": [ + true + ], + "type": "boolean" + }, "start": { "title": "Start time", "description": "Time at which to start monitor recording.", @@ -5777,7 +6930,7 @@ }, "ModeMonitor": { "title": "ModeMonitor", - "description": ":class:`Monitor` that records amplitudes from modal decomposition of fields on plane.\nThe amplitudes are defined as\n``mode_solver_data.dot(recorded_field) / mode_solver_data.dot(mode_solver_data)``, where\n``recorded_field`` is the field data recorded in the FDTD simulation at the monitor frequencies,\nand ``mode_solver_data`` is the mode data from the mode solver at the monitor plane.\nThis gives the power amplitude of ``recorded_field`` carried by each mode.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nmode_spec : ModeSpec\n Parameters to feed to mode solver which determine modes measured by monitor.\n\nExample\n-------\n>>> mode_spec = ModeSpec(num_modes=3)\n>>> monitor = ModeMonitor(\n... center=(1,2,3),\n... size=(2,2,0),\n... freqs=[200e12, 210e12],\n... mode_spec=mode_spec,\n... name='mode_monitor')", + "description": ":class:`Monitor` that records amplitudes from modal decomposition of fields on plane.\nThe amplitudes are defined as\n``mode_solver_data.dot(recorded_field) / mode_solver_data.dot(mode_solver_data)``, where\n``recorded_field`` is the field data recorded in the FDTD simulation at the monitor frequencies,\nand ``mode_solver_data`` is the mode data from the mode solver at the monitor plane.\nThis gives the power amplitude of ``recorded_field`` carried by each mode.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\ninterval_space : Tuple[Literal[1], Literal[1], Literal[1]] = (1, 1, 1)\n Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.\ncolocate : Literal[False] = False\n Defines whether fields are colocated to grid cell boundaries (i.e. to the primal grid) on-the-fly during a solver run. Can be toggled for field recording monitors and is hard-coded for other monitors depending on their specific function.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nmode_spec : ModeSpec\n Parameters to feed to mode solver which determine modes measured by monitor.\n\nExample\n-------\n>>> mode_spec = ModeSpec(num_modes=3)\n>>> monitor = ModeMonitor(\n... center=(1,2,3),\n... size=(2,2,0),\n... freqs=[200e12, 210e12],\n... mode_spec=mode_spec,\n... name='mode_monitor')", "type": "object", "properties": { "type": { @@ -5840,6 +6993,47 @@ "minLength": 1, "type": "string" }, + "interval_space": { + "title": "Spatial interval", + "description": "Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.", + "default": [ + 1, + 1, + 1 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + } + ] + }, + "colocate": { + "title": "Colocate fields", + "description": "Defines whether fields are colocated to grid cell boundaries (i.e. to the primal grid) on-the-fly during a solver run. Can be toggled for field recording monitors and is hard-coded for other monitors depending on their specific function.", + "default": false, + "enum": [ + false + ], + "type": "boolean" + }, "freqs": { "title": "Frequencies", "description": "Array or list of frequencies stored by the field monitor.", @@ -5891,7 +7085,7 @@ }, "ModeSolverMonitor": { "title": "ModeSolverMonitor", - "description": ":class:`Monitor` that stores the mode field profiles returned by the mode solver in the\nmonitor plane.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nmode_spec : ModeSpec\n Parameters to feed to mode solver which determine modes measured by monitor.\ndirection : Literal['+', '-'] = +\n Direction of waveguide mode propagation along the axis defined by its normal dimension.\n\nExample\n-------\n>>> mode_spec = ModeSpec(num_modes=3)\n>>> monitor = ModeSolverMonitor(\n... center=(1,2,3),\n... size=(2,2,0),\n... freqs=[200e12, 210e12],\n... mode_spec=mode_spec,\n... name='mode_monitor')", + "description": ":class:`Monitor` that stores the mode field profiles returned by the mode solver in the\nmonitor plane.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\ninterval_space : Tuple[Literal[1], Literal[1], Literal[1]] = (1, 1, 1)\n Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.\ncolocate : bool = True\n Toggle whether fields should be colocated to grid cell boundaries (i.e. primal grid nodes). Default is ``True``.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nmode_spec : ModeSpec\n Parameters to feed to mode solver which determine modes measured by monitor.\ndirection : Literal['+', '-'] = +\n Direction of waveguide mode propagation along the axis defined by its normal dimension.\n\nExample\n-------\n>>> mode_spec = ModeSpec(num_modes=3)\n>>> monitor = ModeSolverMonitor(\n... center=(1,2,3),\n... size=(2,2,0),\n... freqs=[200e12, 210e12],\n... mode_spec=mode_spec,\n... name='mode_monitor')", "type": "object", "properties": { "type": { @@ -5954,6 +7148,44 @@ "minLength": 1, "type": "string" }, + "interval_space": { + "title": "Spatial interval", + "description": "Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.", + "default": [ + 1, + 1, + 1 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + } + ] + }, + "colocate": { + "title": "Colocate fields", + "description": "Toggle whether fields should be colocated to grid cell boundaries (i.e. primal grid nodes). Default is ``True``.", + "default": true, + "type": "boolean" + }, "freqs": { "title": "Frequencies", "description": "Array or list of frequencies stored by the field monitor.", @@ -6015,7 +7247,7 @@ }, "FieldProjectionAngleMonitor": { "title": "FieldProjectionAngleMonitor", - "description": ":class:`Monitor` that samples electromagnetic near fields in the frequency domain\nand projects them at given observation angles. The ``center`` and ``size`` fields define\nwhere the monitor will be placed in order to record near fields, typically very close\nto the structure of interest. The near fields are then projected\nto far-field locations defined by ``phi``, ``theta``, and ``proj_distance``, relative\nto the ``custom_origin``. If the distance between the near and far field locations is\nmuch larger than the size of the device, one can typically set ``far_field_approx`` to\n``True``, which will make use of the far-field approximation to speed up calculations.\nIf the projection distance is comparable to the size of the device, we recommend setting\n``far_field_approx`` to ``False``, so that the approximations are not used, and the\nprojection is accurate even just a few wavelengths away from the near field locations.\nFor applications where the monitor is an open surface rather than a box that\nencloses the device, it is advisable to pick the size of the monitor such that the\nrecorded near fields decay to negligible values near the edges of the monitor.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nnormal_dir : Optional[Literal['+', '-']] = None\n Direction of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of ``'+'`` or ``'-'``. Applies to surface monitors only, and defaults to ``'+'`` if not provided.\nexclude_surfaces : Optional[Tuple[Literal['x-', 'x+', 'y-', 'y+', 'z-', 'z+'], ...]] = None\n Surfaces to exclude in the integration, if a volume monitor.\ncustom_origin : Optional[Tuple[float, float, float]] = None\n [units = um]. Local origin used for defining observation points. If ``None``, uses the monitor's center.\nfar_field_approx : bool = True\n Whether to enable the far field approximation when projecting fields. If ``True``, terms that decay as O(1/r^2) are ignored, as are the radial components of fields. Typically, this should be set to ``True`` only when the projection distance is much larger than the size of the device being modeled, and the projected points are in the far field of the device.\nproj_distance : float = 1000000.0\n [units = um]. Radial distance of the projection points from ``local_origin``.\ntheta : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = rad]. Polar angles with respect to the global z axis, relative to the location of ``local_origin``, at which to project fields.\nphi : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = rad]. Azimuth angles with respect to the global z axis, relative to the location of ``local_origin``, at which to project fields.\n\nExample\n-------\n>>> monitor = FieldProjectionAngleMonitor(\n... center=(1,2,3),\n... size=(2,2,2),\n... freqs=[250e12, 300e12],\n... name='n2f_monitor',\n... custom_origin=(1,2,3),\n... phi=[0, np.pi/2],\n... theta=np.linspace(-np.pi/2, np.pi/2, 100)\n... )", + "description": ":class:`Monitor` that samples electromagnetic near fields in the frequency domain\nand projects them at given observation angles. The ``center`` and ``size`` fields define\nwhere the monitor will be placed in order to record near fields, typically very close\nto the structure of interest. The near fields are then projected\nto far-field locations defined by ``phi``, ``theta``, and ``proj_distance``, relative\nto the ``custom_origin``. If the distance between the near and far field locations is\nmuch larger than the size of the device, one can typically set ``far_field_approx`` to\n``True``, which will make use of the far-field approximation to speed up calculations.\nIf the projection distance is comparable to the size of the device, we recommend setting\n``far_field_approx`` to ``False``, so that the approximations are not used, and the\nprojection is accurate even just a few wavelengths away from the near field locations.\nFor applications where the monitor is an open surface rather than a box that\nencloses the device, it is advisable to pick the size of the monitor such that the\nrecorded near fields decay to negligible values near the edges of the monitor.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\ninterval_space : Tuple[Literal[1], Literal[1], Literal[1]] = (1, 1, 1)\n Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.\ncolocate : Literal[True] = True\n Defines whether fields are colocated to grid cell boundaries (i.e. to the primal grid) on-the-fly during a solver run. Can be toggled for field recording monitors and is hard-coded for other monitors depending on their specific function.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nnormal_dir : Optional[Literal['+', '-']] = None\n Direction of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of ``'+'`` or ``'-'``. Applies to surface monitors only, and defaults to ``'+'`` if not provided.\nexclude_surfaces : Optional[Tuple[Literal['x-', 'x+', 'y-', 'y+', 'z-', 'z+'], ...]] = None\n Surfaces to exclude in the integration, if a volume monitor.\ncustom_origin : Optional[Tuple[float, float, float]] = None\n [units = um]. Local origin used for defining observation points. If ``None``, uses the monitor's center.\nfar_field_approx : bool = True\n Whether to enable the far field approximation when projecting fields. If ``True``, terms that decay as O(1/r^2) are ignored, as are the radial components of fields. Typically, this should be set to ``True`` only when the projection distance is much larger than the size of the device being modeled, and the projected points are in the far field of the device.\nproj_distance : float = 1000000.0\n [units = um]. Radial distance of the projection points from ``local_origin``.\ntheta : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = rad]. Polar angles with respect to the global z axis, relative to the location of ``local_origin``, at which to project fields.\nphi : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = rad]. Azimuth angles with respect to the global z axis, relative to the location of ``local_origin``, at which to project fields.\n\nExample\n-------\n>>> monitor = FieldProjectionAngleMonitor(\n... center=(1,2,3),\n... size=(2,2,2),\n... freqs=[250e12, 300e12],\n... name='n2f_monitor',\n... custom_origin=(1,2,3),\n... phi=[0, np.pi/2],\n... theta=np.linspace(-np.pi/2, np.pi/2, 100)\n... )", "type": "object", "properties": { "type": { @@ -6078,6 +7310,47 @@ "minLength": 1, "type": "string" }, + "interval_space": { + "title": "Spatial interval", + "description": "Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.", + "default": [ + 1, + 1, + 1 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + } + ] + }, + "colocate": { + "title": "Colocate fields", + "description": "Defines whether fields are colocated to grid cell boundaries (i.e. to the primal grid) on-the-fly during a solver run. Can be toggled for field recording monitors and is hard-coded for other monitors depending on their specific function.", + "default": true, + "enum": [ + true + ], + "type": "boolean" + }, "freqs": { "title": "Frequencies", "description": "Array or list of frequencies stored by the field monitor.", @@ -6210,7 +7483,7 @@ }, "FieldProjectionCartesianMonitor": { "title": "FieldProjectionCartesianMonitor", - "description": ":class:`Monitor` that samples electromagnetic near fields in the frequency domain\nand projects them on a Cartesian observation plane. The ``center`` and ``size`` fields define\nwhere the monitor will be placed in order to record near fields, typically very close\nto the structure of interest. The near fields are then projected\nto far-field locations defined by ``x``, ``y``, and ``proj_distance``, relative\nto the ``custom_origin``. Here, ``x`` and ``y`` correspond to a local coordinate system\nwhere the local z axis is defined by ``proj_axis``: which is the axis normal to this monitor.\nIf the distance between the near and far field locations is much larger than the size of the\ndevice, one can typically set ``far_field_approx`` to ``True``, which will make use of the\nfar-field approximation to speed up calculations. If the projection distance is comparable\nto the size of the device, we recommend setting ``far_field_approx`` to ``False``,\nso that the approximations are not used, and the projection is accurate even just a few\nwavelengths away from the near field locations.\nFor applications where the monitor is an open surface rather than a box that\nencloses the device, it is advisable to pick the size of the monitor such that the\nrecorded near fields decay to negligible values near the edges of the monitor.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nnormal_dir : Optional[Literal['+', '-']] = None\n Direction of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of ``'+'`` or ``'-'``. Applies to surface monitors only, and defaults to ``'+'`` if not provided.\nexclude_surfaces : Optional[Tuple[Literal['x-', 'x+', 'y-', 'y+', 'z-', 'z+'], ...]] = None\n Surfaces to exclude in the integration, if a volume monitor.\ncustom_origin : Optional[Tuple[float, float, float]] = None\n [units = um]. Local origin used for defining observation points. If ``None``, uses the monitor's center.\nfar_field_approx : bool = True\n Whether to enable the far field approximation when projecting fields. If ``True``, terms that decay as O(1/r^2) are ignored, as are the radial components of fields. Typically, this should be set to ``True`` only when the projection distance is much larger than the size of the device being modeled, and the projected points are in the far field of the device.\nproj_axis : Literal[0, 1, 2]\n Axis along which the observation plane is oriented.\nproj_distance : float = 1000000.0\n [units = um]. Signed distance of the projection plane along ``proj_axis``. from the plane containing ``local_origin``.\nx : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = um]. Local x observation coordinates w.r.t. ``local_origin`` and ``proj_axis``. When ``proj_axis`` is 0, this corresponds to the global y axis. When ``proj_axis`` is 1, this corresponds to the global x axis. When ``proj_axis`` is 2, this corresponds to the global x axis. \ny : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = um]. Local y observation coordinates w.r.t. ``local_origin`` and ``proj_axis``. When ``proj_axis`` is 0, this corresponds to the global z axis. When ``proj_axis`` is 1, this corresponds to the global z axis. When ``proj_axis`` is 2, this corresponds to the global y axis. \n\nExample\n-------\n>>> monitor = FieldProjectionCartesianMonitor(\n... center=(1,2,3),\n... size=(2,2,2),\n... freqs=[250e12, 300e12],\n... name='n2f_monitor',\n... custom_origin=(1,2,3),\n... x=[-1, 0, 1],\n... y=[-2, -1, 0, 1, 2],\n... proj_axis=2,\n... proj_distance=5\n... )", + "description": ":class:`Monitor` that samples electromagnetic near fields in the frequency domain\nand projects them on a Cartesian observation plane. The ``center`` and ``size`` fields define\nwhere the monitor will be placed in order to record near fields, typically very close\nto the structure of interest. The near fields are then projected\nto far-field locations defined by ``x``, ``y``, and ``proj_distance``, relative\nto the ``custom_origin``. Here, ``x`` and ``y`` correspond to a local coordinate system\nwhere the local z axis is defined by ``proj_axis``: which is the axis normal to this monitor.\nIf the distance between the near and far field locations is much larger than the size of the\ndevice, one can typically set ``far_field_approx`` to ``True``, which will make use of the\nfar-field approximation to speed up calculations. If the projection distance is comparable\nto the size of the device, we recommend setting ``far_field_approx`` to ``False``,\nso that the approximations are not used, and the projection is accurate even just a few\nwavelengths away from the near field locations.\nFor applications where the monitor is an open surface rather than a box that\nencloses the device, it is advisable to pick the size of the monitor such that the\nrecorded near fields decay to negligible values near the edges of the monitor.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\ninterval_space : Tuple[Literal[1], Literal[1], Literal[1]] = (1, 1, 1)\n Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.\ncolocate : Literal[True] = True\n Defines whether fields are colocated to grid cell boundaries (i.e. to the primal grid) on-the-fly during a solver run. Can be toggled for field recording monitors and is hard-coded for other monitors depending on their specific function.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nnormal_dir : Optional[Literal['+', '-']] = None\n Direction of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of ``'+'`` or ``'-'``. Applies to surface monitors only, and defaults to ``'+'`` if not provided.\nexclude_surfaces : Optional[Tuple[Literal['x-', 'x+', 'y-', 'y+', 'z-', 'z+'], ...]] = None\n Surfaces to exclude in the integration, if a volume monitor.\ncustom_origin : Optional[Tuple[float, float, float]] = None\n [units = um]. Local origin used for defining observation points. If ``None``, uses the monitor's center.\nfar_field_approx : bool = True\n Whether to enable the far field approximation when projecting fields. If ``True``, terms that decay as O(1/r^2) are ignored, as are the radial components of fields. Typically, this should be set to ``True`` only when the projection distance is much larger than the size of the device being modeled, and the projected points are in the far field of the device.\nproj_axis : Literal[0, 1, 2]\n Axis along which the observation plane is oriented.\nproj_distance : float = 1000000.0\n [units = um]. Signed distance of the projection plane along ``proj_axis``. from the plane containing ``local_origin``.\nx : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = um]. Local x observation coordinates w.r.t. ``local_origin`` and ``proj_axis``. When ``proj_axis`` is 0, this corresponds to the global y axis. When ``proj_axis`` is 1, this corresponds to the global x axis. When ``proj_axis`` is 2, this corresponds to the global x axis. \ny : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = um]. Local y observation coordinates w.r.t. ``local_origin`` and ``proj_axis``. When ``proj_axis`` is 0, this corresponds to the global z axis. When ``proj_axis`` is 1, this corresponds to the global z axis. When ``proj_axis`` is 2, this corresponds to the global y axis. \n\nExample\n-------\n>>> monitor = FieldProjectionCartesianMonitor(\n... center=(1,2,3),\n... size=(2,2,2),\n... freqs=[250e12, 300e12],\n... name='n2f_monitor',\n... custom_origin=(1,2,3),\n... x=[-1, 0, 1],\n... y=[-2, -1, 0, 1, 2],\n... proj_axis=2,\n... proj_distance=5\n... )", "type": "object", "properties": { "type": { @@ -6273,6 +7546,47 @@ "minLength": 1, "type": "string" }, + "interval_space": { + "title": "Spatial interval", + "description": "Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.", + "default": [ + 1, + 1, + 1 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + } + ] + }, + "colocate": { + "title": "Colocate fields", + "description": "Defines whether fields are colocated to grid cell boundaries (i.e. to the primal grid) on-the-fly during a solver run. Can be toggled for field recording monitors and is hard-coded for other monitors depending on their specific function.", + "default": true, + "enum": [ + true + ], + "type": "boolean" + }, "freqs": { "title": "Frequencies", "description": "Array or list of frequencies stored by the field monitor.", @@ -6416,7 +7730,7 @@ }, "FieldProjectionKSpaceMonitor": { "title": "FieldProjectionKSpaceMonitor", - "description": ":class:`Monitor` that samples electromagnetic near fields in the frequency domain\nand projects them on an observation plane defined in k-space. The ``center`` and ``size``\nfields define where the monitor will be placed in order to record near fields, typically\nvery close to the structure of interest. The near fields are then\nprojected to far-field locations defined in k-space by ``ux``, ``uy``, and ``proj_distance``,\nrelative to the ``custom_origin``. Here, ``ux`` and ``uy`` are associated with a local\ncoordinate system where the local 'z' axis is defined by ``proj_axis``: which is the axis\nnormal to this monitor. If the distance between the near and far field locations is much\nlarger than the size of the device, one can typically set ``far_field_approx`` to ``True``,\nwhich will make use of the far-field approximation to speed up calculations. If the\nprojection distance is comparable to the size of the device, we recommend setting\n``far_field_approx`` to ``False``, so that the approximations are not used, and the\nprojection is accurate even just a few wavelengths away from the near field locations.\nFor applications where the monitor is an open surface rather than a box that\nencloses the device, it is advisable to pick the size of the monitor such that the\nrecorded near fields decay to negligible values near the edges of the monitor.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nnormal_dir : Optional[Literal['+', '-']] = None\n Direction of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of ``'+'`` or ``'-'``. Applies to surface monitors only, and defaults to ``'+'`` if not provided.\nexclude_surfaces : Optional[Tuple[Literal['x-', 'x+', 'y-', 'y+', 'z-', 'z+'], ...]] = None\n Surfaces to exclude in the integration, if a volume monitor.\ncustom_origin : Optional[Tuple[float, float, float]] = None\n [units = um]. Local origin used for defining observation points. If ``None``, uses the monitor's center.\nfar_field_approx : bool = True\n Whether to enable the far field approximation when projecting fields. If ``True``, terms that decay as O(1/r^2) are ignored, as are the radial components of fields. Typically, this should be set to ``True`` only when the projection distance is much larger than the size of the device being modeled, and the projected points are in the far field of the device.\nproj_axis : Literal[0, 1, 2]\n Axis along which the observation plane is oriented.\nproj_distance : float = 1000000.0\n [units = um]. Radial distance of the projection points from ``local_origin``.\nux : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n Local x component of wave vectors on the observation plane, relative to ``local_origin`` and oriented with respect to ``proj_axis``, normalized by (2*pi/lambda) where lambda is the wavelength associated with the background medium. Must be in the range [-1, 1].\nuy : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n Local y component of wave vectors on the observation plane, relative to ``local_origin`` and oriented with respect to ``proj_axis``, normalized by (2*pi/lambda) where lambda is the wavelength associated with the background medium. Must be in the range [-1, 1].\n\nExample\n-------\n>>> monitor = FieldProjectionKSpaceMonitor(\n... center=(1,2,3),\n... size=(2,2,2),\n... freqs=[250e12, 300e12],\n... name='n2f_monitor',\n... custom_origin=(1,2,3),\n... proj_axis=2,\n... ux=[0.1,0.2],\n... uy=[0.3,0.4,0.5]\n... )", + "description": ":class:`Monitor` that samples electromagnetic near fields in the frequency domain\nand projects them on an observation plane defined in k-space. The ``center`` and ``size``\nfields define where the monitor will be placed in order to record near fields, typically\nvery close to the structure of interest. The near fields are then\nprojected to far-field locations defined in k-space by ``ux``, ``uy``, and ``proj_distance``,\nrelative to the ``custom_origin``. Here, ``ux`` and ``uy`` are associated with a local\ncoordinate system where the local 'z' axis is defined by ``proj_axis``: which is the axis\nnormal to this monitor. If the distance between the near and far field locations is much\nlarger than the size of the device, one can typically set ``far_field_approx`` to ``True``,\nwhich will make use of the far-field approximation to speed up calculations. If the\nprojection distance is comparable to the size of the device, we recommend setting\n``far_field_approx`` to ``False``, so that the approximations are not used, and the\nprojection is accurate even just a few wavelengths away from the near field locations.\nFor applications where the monitor is an open surface rather than a box that\nencloses the device, it is advisable to pick the size of the monitor such that the\nrecorded near fields decay to negligible values near the edges of the monitor.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\ninterval_space : Tuple[Literal[1], Literal[1], Literal[1]] = (1, 1, 1)\n Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.\ncolocate : Literal[True] = True\n Defines whether fields are colocated to grid cell boundaries (i.e. to the primal grid) on-the-fly during a solver run. Can be toggled for field recording monitors and is hard-coded for other monitors depending on their specific function.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nnormal_dir : Optional[Literal['+', '-']] = None\n Direction of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of ``'+'`` or ``'-'``. Applies to surface monitors only, and defaults to ``'+'`` if not provided.\nexclude_surfaces : Optional[Tuple[Literal['x-', 'x+', 'y-', 'y+', 'z-', 'z+'], ...]] = None\n Surfaces to exclude in the integration, if a volume monitor.\ncustom_origin : Optional[Tuple[float, float, float]] = None\n [units = um]. Local origin used for defining observation points. If ``None``, uses the monitor's center.\nfar_field_approx : bool = True\n Whether to enable the far field approximation when projecting fields. If ``True``, terms that decay as O(1/r^2) are ignored, as are the radial components of fields. Typically, this should be set to ``True`` only when the projection distance is much larger than the size of the device being modeled, and the projected points are in the far field of the device.\nproj_axis : Literal[0, 1, 2]\n Axis along which the observation plane is oriented.\nproj_distance : float = 1000000.0\n [units = um]. Radial distance of the projection points from ``local_origin``.\nux : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n Local x component of wave vectors on the observation plane, relative to ``local_origin`` and oriented with respect to ``proj_axis``, normalized by (2*pi/lambda) where lambda is the wavelength associated with the background medium. Must be in the range [-1, 1].\nuy : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n Local y component of wave vectors on the observation plane, relative to ``local_origin`` and oriented with respect to ``proj_axis``, normalized by (2*pi/lambda) where lambda is the wavelength associated with the background medium. Must be in the range [-1, 1].\n\nExample\n-------\n>>> monitor = FieldProjectionKSpaceMonitor(\n... center=(1,2,3),\n... size=(2,2,2),\n... freqs=[250e12, 300e12],\n... name='n2f_monitor',\n... custom_origin=(1,2,3),\n... proj_axis=2,\n... ux=[0.1,0.2],\n... uy=[0.3,0.4,0.5]\n... )", "type": "object", "properties": { "type": { @@ -6479,6 +7793,47 @@ "minLength": 1, "type": "string" }, + "interval_space": { + "title": "Spatial interval", + "description": "Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.", + "default": [ + 1, + 1, + 1 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + } + ] + }, + "colocate": { + "title": "Colocate fields", + "description": "Defines whether fields are colocated to grid cell boundaries (i.e. to the primal grid) on-the-fly during a solver run. Can be toggled for field recording monitors and is hard-coded for other monitors depending on their specific function.", + "default": true, + "enum": [ + true + ], + "type": "boolean" + }, "freqs": { "title": "Frequencies", "description": "Array or list of frequencies stored by the field monitor.", @@ -6620,7 +7975,7 @@ }, "DiffractionMonitor": { "title": "DiffractionMonitor", - "description": ":class:`Monitor` that uses a 2D Fourier transform to compute the\ndiffraction amplitudes and efficiency for allowed diffraction orders.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nnormal_dir : Literal['+', '-'] = +\n Direction of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of ``'+'`` or ``'-'``. Defaults to ``'+'`` if not provided.\n\nExample\n-------\n>>> monitor = DiffractionMonitor(\n... center=(1,2,3),\n... size=(inf,inf,0),\n... freqs=[250e12, 300e12],\n... name='diffraction_monitor',\n... normal_dir='+',\n... )", + "description": ":class:`Monitor` that uses a 2D Fourier transform to compute the\ndiffraction amplitudes and efficiency for allowed diffraction orders.\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.\nname : ConstrainedStrValue\n Unique name for monitor.\ninterval_space : Tuple[Literal[1], Literal[1], Literal[1]] = (1, 1, 1)\n Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.\ncolocate : Literal[False] = False\n Defines whether fields are colocated to grid cell boundaries (i.e. to the primal grid) on-the-fly during a solver run. Can be toggled for field recording monitors and is hard-coded for other monitors depending on their specific function.\nfreqs : Union[Tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n [units = Hz]. Array or list of frequencies stored by the field monitor.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nnormal_dir : Literal['+', '-'] = +\n Direction of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of ``'+'`` or ``'-'``. Defaults to ``'+'`` if not provided.\n\nExample\n-------\n>>> monitor = DiffractionMonitor(\n... center=(1,2,3),\n... size=(inf,inf,0),\n... freqs=[250e12, 300e12],\n... name='diffraction_monitor',\n... normal_dir='+',\n... )", "type": "object", "properties": { "type": { @@ -6683,6 +8038,47 @@ "minLength": 1, "type": "string" }, + "interval_space": { + "title": "Spatial interval", + "description": "Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the last point of the monitor grid is always included. Not all monitors support values different from 1.", + "default": [ + 1, + 1, + 1 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + }, + { + "enum": [ + 1 + ], + "type": "integer" + } + ] + }, + "colocate": { + "title": "Colocate fields", + "description": "Defines whether fields are colocated to grid cell boundaries (i.e. to the primal grid) on-the-fly during a solver run. Can be toggled for field recording monitors and is hard-coded for other monitors depending on their specific function.", + "default": false, + "enum": [ + false + ], + "type": "boolean" + }, "freqs": { "title": "Frequencies", "description": "Array or list of frequencies stored by the field monitor.", @@ -6861,7 +8257,7 @@ }, "MeshOverrideStructure": { "title": "MeshOverrideStructure", - "description": "Defines an object that is only used in the process of generating the mesh.\nA :class:`MeshOverrideStructure` is a combination of geometry :class:`Geometry`,\ngrid size along x,y,z directions, and a boolean on whether the override\nwill be enforced.\n\nParameters\n----------\ngeometry : Union[Box, Sphere, Cylinder, PolySlab, TriangleMesh, GeometryGroup]\n Defines geometric properties of the structure.\nname : Optional[str] = None\n Optional name for the structure.\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\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.\nA :class:`MeshOverrideStructure` is a combination of geometry :class:`Geometry`,\ngrid size along x,y,z directions, and a boolean on whether the override\nwill be enforced.\n\nParameters\n----------\ngeometry : Union[Box, ClipOperation, GeometryGroup, Sphere, Cylinder, PolySlab, ComplexPolySlabBase, TriangleMesh]\n Defines geometric properties of the structure.\nname : Optional[str] = None\n Optional name for the structure.\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\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": { "geometry": { @@ -6871,17 +8267,25 @@ "propertyName": "type", "mapping": { "Box": "#/definitions/Box", + "ClipOperation": "#/definitions/ClipOperation", + "GeometryGroup": "#/definitions/GeometryGroup", "Sphere": "#/definitions/Sphere", "Cylinder": "#/definitions/Cylinder", "PolySlab": "#/definitions/PolySlab", - "TriangleMesh": "#/definitions/TriangleMesh", - "GeometryGroup": "#/definitions/GeometryGroup" + "ComplexPolySlabBase": "#/definitions/ComplexPolySlabBase", + "TriangleMesh": "#/definitions/TriangleMesh" } }, "oneOf": [ { "$ref": "#/definitions/Box" }, + { + "$ref": "#/definitions/ClipOperation" + }, + { + "$ref": "#/definitions/GeometryGroup" + }, { "$ref": "#/definitions/Sphere" }, @@ -6892,10 +8296,10 @@ "$ref": "#/definitions/PolySlab" }, { - "$ref": "#/definitions/TriangleMesh" + "$ref": "#/definitions/ComplexPolySlabBase" }, { - "$ref": "#/definitions/GeometryGroup" + "$ref": "#/definitions/TriangleMesh" } ] },