tidy3d.DiffractionData#

class tidy3d.DiffractionData#

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

Parameters
  • monitor (DiffractionMonitor) – Er : DiffractionDataArray Spatial distribution of r-component of the electric field.

  • Etheta (DiffractionDataArray) – Spatial distribution of the theta-component of the electric field.

  • Ephi (DiffractionDataArray) – Spatial distribution of phi-component of the electric field.

  • Hr (DiffractionDataArray) – Spatial distribution of r-component of the magnetic field.

  • Htheta (DiffractionDataArray) – Spatial distribution of theta-component of the magnetic field.

  • Hphi (DiffractionDataArray) – Spatial distribution of phi-component of the magnetic field.

  • medium (Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude] = Medium(name=None, frequency_range=None, type='Medium', permittivity=1.0, conductivity=0.0)) – Background medium through which to project fields.

  • sim_size (Tuple[float, float]) – [units = um]. Size of the near field in the local x and y directions.

  • bloch_vecs (Tuple[float, float]) – Bloch vectors along the local x and y directions in units of 2 * pi / (simulation size along the respective dimension).

Example

>>> from tidy3d import DiffractionDataArray
>>> f = np.linspace(1e14, 2e14, 10)
>>> orders_x = list(range(-4, 5))
>>> orders_y = list(range(-6, 7))
>>> pol = ["s", "p"]
>>> coords = dict(orders_x=orders_x, orders_y=orders_y, f=f)
>>> values = (1+1j) * np.random.random((len(orders_x), len(orders_y), len(f)))
>>> field = DiffractionDataArray(values, coords=coords)
>>> monitor = DiffractionMonitor(
...     center=(1,2,3), size=(np.inf,np.inf,0), freqs=f, name='diffraction'
... )
>>> data = DiffractionData(
...     monitor=monitor, sim_size=[1,1], bloch_vecs=[1,2],
...     Etheta=field, Ephi=field, Er=field,
...     Htheta=field, Hphi=field, Hr=field,
... )

Show JSON schema
{
   "title": "DiffractionData",
   "description": "Data for a :class:`.DiffractionMonitor`: complex components of diffracted far fields.\n\nParameters\n----------\nmonitor : DiffractionMonitor\n        Er : DiffractionDataArray\n    Spatial distribution of r-component of the electric field.\nEtheta : DiffractionDataArray\n    Spatial distribution of the theta-component of the electric field.\nEphi : DiffractionDataArray\n    Spatial distribution of phi-component of the electric field.\nHr : DiffractionDataArray\n    Spatial distribution of r-component of the magnetic field.\nHtheta : DiffractionDataArray\n    Spatial distribution of theta-component of the magnetic field.\nHphi : DiffractionDataArray\n    Spatial distribution of phi-component of the magnetic field.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude] = Medium(name=None, frequency_range=None, type='Medium', permittivity=1.0, conductivity=0.0)\n    Background medium through which to project fields.\nsim_size : Tuple[float, float]\n    [units = um].  Size of the near field in the local x and y directions.\nbloch_vecs : Tuple[float, float]\n    Bloch vectors along the local x and y directions in units of ``2 * pi / (simulation size along the respective dimension)``.\n\nExample\n-------\n>>> from tidy3d import DiffractionDataArray\n>>> f = np.linspace(1e14, 2e14, 10)\n>>> orders_x = list(range(-4, 5))\n>>> orders_y = list(range(-6, 7))\n>>> pol = [\"s\", \"p\"]\n>>> coords = dict(orders_x=orders_x, orders_y=orders_y, f=f)\n>>> values = (1+1j) * np.random.random((len(orders_x), len(orders_y), len(f)))\n>>> field = DiffractionDataArray(values, coords=coords)\n>>> monitor = DiffractionMonitor(\n...     center=(1,2,3), size=(np.inf,np.inf,0), freqs=f, name='diffraction'\n... )\n>>> data = DiffractionData(\n...     monitor=monitor, sim_size=[1,1], bloch_vecs=[1,2],\n...     Etheta=field, Ephi=field, Er=field,\n...     Htheta=field, Hphi=field, Hr=field,\n... )",
   "type": "object",
   "properties": {
      "type": {
         "title": "Type",
         "default": "DiffractionData",
         "enum": [
            "DiffractionData"
         ],
         "type": "string"
      },
      "monitor": {
         "$ref": "#/definitions/DiffractionMonitor"
      },
      "Er": {
         "title": "DataArray",
         "description": "Spatial distribution of r-component of the electric field.",
         "type": "xr.DataArray",
         "properties": {
            "_dims": {
               "title": "_dims",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "_dims"
         ]
      },
      "Etheta": {
         "title": "DataArray",
         "description": "Spatial distribution of the theta-component of the electric field.",
         "type": "xr.DataArray",
         "properties": {
            "_dims": {
               "title": "_dims",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "_dims"
         ]
      },
      "Ephi": {
         "title": "DataArray",
         "description": "Spatial distribution of phi-component of the electric field.",
         "type": "xr.DataArray",
         "properties": {
            "_dims": {
               "title": "_dims",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "_dims"
         ]
      },
      "Hr": {
         "title": "DataArray",
         "description": "Spatial distribution of r-component of the magnetic field.",
         "type": "xr.DataArray",
         "properties": {
            "_dims": {
               "title": "_dims",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "_dims"
         ]
      },
      "Htheta": {
         "title": "DataArray",
         "description": "Spatial distribution of theta-component of the magnetic field.",
         "type": "xr.DataArray",
         "properties": {
            "_dims": {
               "title": "_dims",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "_dims"
         ]
      },
      "Hphi": {
         "title": "DataArray",
         "description": "Spatial distribution of phi-component of the magnetic field.",
         "type": "xr.DataArray",
         "properties": {
            "_dims": {
               "title": "_dims",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "_dims"
         ]
      },
      "medium": {
         "title": "Background Medium",
         "description": "Background medium through which to project fields.",
         "default": {
            "name": null,
            "frequency_range": null,
            "type": "Medium",
            "permittivity": 1.0,
            "conductivity": 0.0
         },
         "anyOf": [
            {
               "$ref": "#/definitions/Medium"
            },
            {
               "$ref": "#/definitions/AnisotropicMedium"
            },
            {
               "$ref": "#/definitions/PECMedium"
            },
            {
               "$ref": "#/definitions/PoleResidue"
            },
            {
               "$ref": "#/definitions/Sellmeier"
            },
            {
               "$ref": "#/definitions/Lorentz"
            },
            {
               "$ref": "#/definitions/Debye"
            },
            {
               "$ref": "#/definitions/Drude"
            }
         ]
      },
      "sim_size": {
         "title": "Domain size",
         "description": "Size of the near field in the local x and y directions.",
         "units": "um",
         "type": "array",
         "minItems": 2,
         "maxItems": 2,
         "items": [
            {
               "type": "number"
            },
            {
               "type": "number"
            }
         ]
      },
      "bloch_vecs": {
         "title": "Bloch vectors",
         "description": "Bloch vectors along the local x and y directions in units of ``2 * pi / (simulation size along the respective dimension)``.",
         "type": "array",
         "minItems": 2,
         "maxItems": 2,
         "items": [
            {
               "type": "number"
            },
            {
               "type": "number"
            }
         ]
      }
   },
   "required": [
      "monitor",
      "Er",
      "Etheta",
      "Ephi",
      "Hr",
      "Htheta",
      "Hphi",
      "sim_size",
      "bloch_vecs"
   ],
   "additionalProperties": false,
   "definitions": {
      "ApodizationSpec": {
         "title": "ApodizationSpec",
         "description": "Stores specifications for the apodizaton of frequency-domain monitors.\n\nParameters\n----------\nstart : Optional[NonNegativeFloat] = None\n    [units = sec].  Defines the time at which the start apodization ends.\nend : Optional[NonNegativeFloat] = None\n    [units = sec].  Defines the time at which the end apodization begins.\nwidth : Optional[PositiveFloat] = None\n    [units = sec].  Characteristic decay length of the apodization function.\n\nExample\n-------\n>>> apod_spec = ApodizationSpec(start=1, end=2, width=0.5)",
         "type": "object",
         "properties": {
            "start": {
               "title": "Start Interval",
               "description": "Defines the time at which the start apodization ends.",
               "units": "sec",
               "minimum": 0,
               "type": "number"
            },
            "end": {
               "title": "End Interval",
               "description": "Defines the time at which the end apodization begins.",
               "units": "sec",
               "minimum": 0,
               "type": "number"
            },
            "width": {
               "title": "Apodization Width",
               "description": "Characteristic decay length of the apodization function.",
               "units": "sec",
               "exclusiveMinimum": 0,
               "type": "number"
            },
            "type": {
               "title": "Type",
               "default": "ApodizationSpec",
               "enum": [
                  "ApodizationSpec"
               ],
               "type": "string"
            }
         },
         "additionalProperties": false
      },
      "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, ...], Array]\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": {
               "title": "Type",
               "default": "DiffractionMonitor",
               "enum": [
                  "DiffractionMonitor"
               ],
               "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
                  }
               ]
            },
            "name": {
               "title": "Name",
               "description": "Unique name for monitor.",
               "minLength": 1,
               "type": "string"
            },
            "freqs": {
               "title": "Frequencies",
               "description": "Array or list of frequencies stored by the field monitor.",
               "units": "Hz",
               "anyOf": [
                  {
                     "type": "array",
                     "items": {
                        "type": "number"
                     }
                  },
                  {
                     "title": "Array Like",
                     "description": "Accepts sequence (tuple, list, numpy array) and converts to tuple.",
                     "type": "tuple",
                     "properties": {},
                     "required": []
                  }
               ]
            },
            "apodization": {
               "title": "Apodization Specification",
               "description": "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.",
               "default": {
                  "start": null,
                  "end": null,
                  "width": null,
                  "type": "ApodizationSpec"
               },
               "allOf": [
                  {
                     "$ref": "#/definitions/ApodizationSpec"
                  }
               ]
            },
            "normal_dir": {
               "title": "Normal vector orientation",
               "description": "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.",
               "default": "+",
               "enum": [
                  "+",
                  "-"
               ],
               "type": "string"
            }
         },
         "required": [
            "size",
            "name",
            "freqs"
         ],
         "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.\npermittivity : ConstrainedFloatValue = 1.0\n    [units = None (relative permittivity)].  Relative permittivity.\nconductivity : ConstrainedFloatValue = 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": {
               "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"
                  }
               ]
            },
            "type": {
               "title": "Type",
               "default": "Medium",
               "enum": [
                  "Medium"
               ],
               "type": "string"
            },
            "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,
               "minimum": 0.0,
               "units": "S/um",
               "type": "number"
            }
         },
         "additionalProperties": false
      },
      "AnisotropicMedium": {
         "title": "AnisotropicMedium",
         "description": "Diagonally anisotripic 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.\nxx : Medium\n    Medium describing the xx-component of the diagonal permittivity tensor.\nyy : Medium\n    Medium describing the yy-component of the diagonal permittivity tensor.\nzz : Medium\n    Medium describing the zz-component of the diagonal permittivity tensor.\n\nNote\n----\nOnly diagonal anisotropy and non-dispersive components are 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": {
               "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"
                  }
               ]
            },
            "type": {
               "title": "Type",
               "default": "AnisotropicMedium",
               "enum": [
                  "AnisotropicMedium"
               ],
               "type": "string"
            },
            "xx": {
               "title": "XX Component",
               "description": "Medium describing the xx-component of the diagonal permittivity tensor.",
               "allOf": [
                  {
                     "$ref": "#/definitions/Medium"
                  }
               ]
            },
            "yy": {
               "title": "YY Component",
               "description": "Medium describing the yy-component of the diagonal permittivity tensor.",
               "allOf": [
                  {
                     "$ref": "#/definitions/Medium"
                  }
               ]
            },
            "zz": {
               "title": "ZZ Component",
               "description": "Medium describing the zz-component of the diagonal permittivity tensor.",
               "allOf": [
                  {
                     "$ref": "#/definitions/Medium"
                  }
               ]
            }
         },
         "required": [
            "xx",
            "yy",
            "zz"
         ],
         "additionalProperties": false
      },
      "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.\n\nNote\n----\nTo avoid confusion from duplicate PECs, should import ``tidy3d.PEC`` instance directly.",
         "type": "object",
         "properties": {
            "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"
                  }
               ]
            },
            "type": {
               "title": "Type",
               "default": "PECMedium",
               "enum": [
                  "PECMedium"
               ],
               "type": "string"
            }
         },
         "additionalProperties": false
      },
      "ComplexNumber": {
         "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"
         ]
      },
      "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.\neps_inf : float = 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": {
               "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"
                  }
               ]
            },
            "type": {
               "title": "Type",
               "default": "PoleResidue",
               "enum": [
                  "PoleResidue"
               ],
               "type": "string"
            },
            "eps_inf": {
               "title": "Epsilon at Infinity",
               "description": "Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).",
               "default": 1.0,
               "units": "None (relative permittivity)",
               "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"
                           }
                        ]
                     }
                  ]
               }
            }
         },
         "additionalProperties": false
      },
      "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.\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)",
         "type": "object",
         "properties": {
            "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"
                  }
               ]
            },
            "type": {
               "title": "Type",
               "default": "Sellmeier",
               "enum": [
                  "Sellmeier"
               ],
               "type": "string"
            },
            "coeffs": {
               "title": "Coefficients",
               "description": "List of Sellmeier (:math:`B_i, C_i`) coefficients.",
               "units": [
                  null,
                  "um^2"
               ],
               "type": "array",
               "items": {
                  "type": "array",
                  "minItems": 2,
                  "maxItems": 2,
                  "items": [
                     {
                        "type": "number"
                     },
                     {
                        "type": "number",
                        "exclusiveMinimum": 0
                     }
                  ]
               }
            }
         },
         "required": [
            "coeffs"
         ],
         "additionalProperties": false
      },
      "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.\neps_inf : float = 1.0\n    [units = None (relative permittivity)].  Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[float, float, float], ...]\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": {
               "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"
                  }
               ]
            },
            "type": {
               "title": "Type",
               "default": "Lorentz",
               "enum": [
                  "Lorentz"
               ],
               "type": "string"
            },
            "eps_inf": {
               "title": "Epsilon at Infinity",
               "description": "Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).",
               "default": 1.0,
               "units": "None (relative permittivity)",
               "type": "number"
            },
            "coeffs": {
               "title": "Epsilon at Infinity",
               "description": "List of (:math:`\\Delta\\epsilon_i, f_i, \\delta_i`) values for model.",
               "units": [
                  "None (relative permittivity)",
                  "Hz",
                  "Hz"
               ],
               "type": "array",
               "items": {
                  "type": "array",
                  "minItems": 3,
                  "maxItems": 3,
                  "items": [
                     {
                        "type": "number"
                     },
                     {
                        "type": "number"
                     },
                     {
                        "type": "number"
                     }
                  ]
               }
            }
         },
         "required": [
            "coeffs"
         ],
         "additionalProperties": false
      },
      "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.\neps_inf : float = 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)",
         "type": "object",
         "properties": {
            "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"
                  }
               ]
            },
            "type": {
               "title": "Type",
               "default": "Debye",
               "enum": [
                  "Debye"
               ],
               "type": "string"
            },
            "eps_inf": {
               "title": "Epsilon at Infinity",
               "description": "Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).",
               "default": 1.0,
               "units": "None (relative permittivity)",
               "type": "number"
            },
            "coeffs": {
               "title": "Coefficients",
               "description": "List of (:math:`\\Delta\\epsilon_i, \\tau_i`) values for model.",
               "units": [
                  "None (relative permittivity)",
                  "sec"
               ],
               "type": "array",
               "items": {
                  "type": "array",
                  "minItems": 2,
                  "maxItems": 2,
                  "items": [
                     {
                        "type": "number"
                     },
                     {
                        "type": "number",
                        "exclusiveMinimum": 0
                     }
                  ]
               }
            }
         },
         "required": [
            "coeffs"
         ],
         "additionalProperties": false
      },
      "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.\neps_inf : float = 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)",
         "type": "object",
         "properties": {
            "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"
                  }
               ]
            },
            "type": {
               "title": "Type",
               "default": "Drude",
               "enum": [
                  "Drude"
               ],
               "type": "string"
            },
            "eps_inf": {
               "title": "Epsilon at Infinity",
               "description": "Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).",
               "default": 1.0,
               "units": "None (relative permittivity)",
               "type": "number"
            },
            "coeffs": {
               "title": "Coefficients",
               "description": "List of (:math:`f_i, \\delta_i`) values for model.",
               "units": [
                  "Hz",
                  "Hz"
               ],
               "type": "array",
               "items": {
                  "type": "array",
                  "minItems": 2,
                  "maxItems": 2,
                  "items": [
                     {
                        "type": "number"
                     },
                     {
                        "type": "number",
                        "exclusiveMinimum": 0
                     }
                  ]
               }
            }
         },
         "required": [
            "coeffs"
         ],
         "additionalProperties": false
      }
   }
}

attribute Ephi: tidy3d.components.data.data_array.DiffractionDataArray [Required]#

Spatial distribution of phi-component of the electric field.

Constraints
  • title = DataArray

  • type = xr.DataArray

  • properties = {‘_dims’: {‘title’: ‘_dims’, ‘type’: ‘Tuple[str, …]’}}

  • required = [‘_dims’]

attribute Er: tidy3d.components.data.data_array.DiffractionDataArray [Required]#

Spatial distribution of r-component of the electric field.

Constraints
  • title = DataArray

  • type = xr.DataArray

  • properties = {‘_dims’: {‘title’: ‘_dims’, ‘type’: ‘Tuple[str, …]’}}

  • required = [‘_dims’]

attribute Etheta: tidy3d.components.data.data_array.DiffractionDataArray [Required]#

Spatial distribution of the theta-component of the electric field.

Constraints
  • title = DataArray

  • type = xr.DataArray

  • properties = {‘_dims’: {‘title’: ‘_dims’, ‘type’: ‘Tuple[str, …]’}}

  • required = [‘_dims’]

attribute Hphi: tidy3d.components.data.data_array.DiffractionDataArray [Required]#

Spatial distribution of phi-component of the magnetic field.

Constraints
  • title = DataArray

  • type = xr.DataArray

  • properties = {‘_dims’: {‘title’: ‘_dims’, ‘type’: ‘Tuple[str, …]’}}

  • required = [‘_dims’]

attribute Hr: tidy3d.components.data.data_array.DiffractionDataArray [Required]#

Spatial distribution of r-component of the magnetic field.

Constraints
  • title = DataArray

  • type = xr.DataArray

  • properties = {‘_dims’: {‘title’: ‘_dims’, ‘type’: ‘Tuple[str, …]’}}

  • required = [‘_dims’]

attribute Htheta: tidy3d.components.data.data_array.DiffractionDataArray [Required]#

Spatial distribution of theta-component of the magnetic field.

Constraints
  • title = DataArray

  • type = xr.DataArray

  • properties = {‘_dims’: {‘title’: ‘_dims’, ‘type’: ‘Tuple[str, …]’}}

  • required = [‘_dims’]

attribute bloch_vecs: Tuple[float, float] [Required]#

Bloch vectors along the local x and y directions in units of 2 * pi / (simulation size along the respective dimension).

attribute monitor: tidy3d.components.monitor.DiffractionMonitor [Required]#
attribute sim_size: Tuple[float, float] [Required]#

Size of the near field in the local x and y directions.

static compute_angles(reciprocal_vectors: Tuple[numpy.ndarray, numpy.ndarray]) Tuple[numpy.ndarray, numpy.ndarray]#

Compute the polar and azimuth angles associated with the given reciprocal vectors.

static reciprocal_coords(orders: numpy.ndarray, size: float, bloch_vec: float, f: float, medium: Union[tidy3d.components.medium.Medium, tidy3d.components.medium.AnisotropicMedium, tidy3d.components.medium.PECMedium, tidy3d.components.medium.PoleResidue, tidy3d.components.medium.Sellmeier, tidy3d.components.medium.Lorentz, tidy3d.components.medium.Debye, tidy3d.components.medium.Drude]) numpy.ndarray#

Get the normalized “u” reciprocal coords for a vector of orders, size, and bloch vec.

static shifted_orders(orders: Tuple[int, ...], bloch_vec: float) numpy.ndarray#

Diffraction orders shifted by the Bloch vector.

property amps: xarray.core.dataarray.DataArray#

Complex power amplitude in each order for ‘s’ and ‘p’ polarizations, normalized so that the power carried by the wave of that order and polarization equals abs(amps)^2.

property angles: Tuple[xarray.core.dataarray.DataArray]#

The (theta, phi) angles corresponding to each allowed pair of diffraction orders storeds as data arrays. Disallowed angles are set to np.nan.

property coords_spherical: Dict[str, numpy.ndarray]#

Coordinates grid for the fields in the spherical system.

property fields_cartesian: xarray.core.dataset.Dataset#

Get all field components in Cartesian coordinates relative to the monitor’s local origin for all allowed diffraction orders and frequencies specified in the DiffractionMonitor.

Returns

xarray dataset containing (Ex, Ey, Ez, Hx, Hy, Hz) in Cartesian coordinates.

Return type

xarray.Dataset

property fields_spherical: xarray.core.dataset.Dataset#

Get all field components in spherical coordinates relative to the monitor’s local origin for all allowed diffraction orders and frequencies specified in the DiffractionMonitor.

Returns

xarray dataset containing (Er, Etheta, Ephi, Hr, Htheta, Hphi) in spherical coordinates.

Return type

xarray.Dataset

property orders_x: numpy.ndarray#

Allowed orders along x.

property orders_y: numpy.ndarray#

Allowed orders along y.

property power: xarray.core.dataarray.DataArray#

Total power in each order, summed over both polarizations.

property reciprocal_vectors: Tuple[numpy.ndarray, numpy.ndarray]#

Get the normalized “ux” and “uy” reciprocal vectors.

property ux: numpy.ndarray#

Normalized wave vector along x relative to local_origin and oriented with respect to monitor.normal_dir, normalized by the wave number in the projection medium.

property uy: numpy.ndarray#

Normalized wave vector along y relative to local_origin and oriented with respect to monitor.normal_dir, normalized by the wave number in the projection medium.