{
  "title": "Custom2DPathIntegral",
  "public_path": "flex_rf.tidy3d.Custom2DPathIntegral",
  "lookup_path": "tidy3d.rf.Custom2DPathIntegral",
  "slug": "flex_rf/tidy3d/Custom2DPathIntegral",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/custom2dpathintegral/",
  "object_kind": "class",
  "introduction": "Class for defining a custom path integral defined as a curve on an axis-aligned plane.",
  "notes": "Given a set of vertices $$\\vec{r}_i$$, this class approximates path integrals over\nvector fields of the form $$\\int{\\vec{F} \\cdot \\vec{dl}}$$\nas $$\\sum_i{\\vec{F}(\\vec{r}_i) \\cdot \\vec{dl}_i}$$,\nwhere the differential length $$\\vec{dl}$$ is approximated using central differences\n$$\\vec{dl}_i = \\frac{\\vec{r}_{i+1} - \\vec{r}_{i-1}}{2}$$.\nIf the path is not closed, forward and backward differences are used at the endpoints.",
  "examples": "```python\nimport numpy as np\nvertices = np.array([[0, 0], [1, 0], [1, 1], [0, 1]])\npath = Custom2DPathIntegral(\n    axis=2,\n    position=0.5,\n    vertices=vertices,\n)\n```",
  "references": "",
  "signature": "class Custom2DPathIntegral(Custom2DPathIntegralSpec)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/components/microwave/path_integrals/integrals/base.py",
    "url": "",
    "lineno": 131,
    "endlineno": 215
  },
  "bases": [
    "Custom2DPathIntegralSpec"
  ],
  "parameter_rows": [
    {
      "name": "attrs",
      "annotation": "dict",
      "default": "factory: dict",
      "description": "Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, `attrs` are mutable. For example, the following is allowed for setting an `attr` `obj.attrs['foo'] = bar`. Also note that Tidy3D will raise a `TypeError` if `attrs` contain objects that can not be serialized. One can check if `attrs` are serializable by calling `obj.model_dump_json()`.",
      "origin": "inherited"
    },
    {
      "name": "axis",
      "annotation": "Axis",
      "default": "",
      "description": "Specifies dimension of the planar axis (0,1,2) -> (x,y,z).",
      "origin": "inherited"
    },
    {
      "name": "position",
      "annotation": "float",
      "default": "",
      "description": "Position of the plane along the `axis`.",
      "origin": "inherited"
    },
    {
      "name": "vertices",
      "annotation": "ArrayFloat2D",
      "default": "",
      "description": "List of (d1, d2) defining the 2 dimensional positions of the path. The index of dimension should be in the ascending order, which means if the axis corresponds with `y`, the coordinates of the vertices should be (x, z). If you wish to indicate a closed contour, the final vertex should be made equal to the first vertex, i.e., `vertices[-1] == vertices[0]`",
      "origin": "inherited"
    }
  ],
  "members": [
    {
      "name": "compute_integral",
      "kind": "function",
      "signature": "compute_integral(field: FieldParameter, em_field: IntegrableMonitorDataType)",
      "description": "Computes the path integral defined by `vertices` given the input `em_field`."
    }
  ],
  "group": "flex_rf.tidy3d"
}
