Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions _faqs/how-do-i-use-anisotropic-medium.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: How Do I Use Anisotropic Medium?
date: 2025-09-24 11:50:54
enabled: true
category: "Inverse Design"
---
Currently, classes of [AnisotropicMedium](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.AnisotropicMedium.html){: .color-primary-hover} are not supported with the `autograd` plugin.
However, it is possible to work with diagonally anisotropic materials by defining a [CustomMedium](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.CustomMedium.html#tidy3d.CustomMedium){: .color-primary-hover} that uses a diagonally anisotropic [PermittivityDataset](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.PermittivityDataset.html){: .color-primary-hover}.

The following example shows how to create an anisotropic LN medium with the extraordinary axis aligned along the z-axis:


<div markdown class="code-snippet">
{% highlight python %}
# Define the coordinates for the medium
X = [-1e12, 1e12]
f = [td.C_0]
coords = dict(x=X, y=X, z=X, f=f)

# Define the datasets
n_e = 2.17
n_o = 2.23

eps_xx = td.ScalarFieldDataArray(np.ones((2, 2, 2, 1)) * n_e**2, coords=coords)
eps_yy = eps_xx
eps_zz = td.ScalarFieldDataArray(np.ones((2, 2, 2, 1)) * n_o**2, coords=coords)

# Define anisotropic permittivity dataset
permittivity = td.PermittivityDataset(
eps_xx=eps_xx,
eps_yy=eps_yy,
eps_zz=eps_zz
)

# Define anisotropic custom medium
medium = td.CustomMedium(eps_dataset=permittivity)
{% endhighlight %}
{% include copy-button.html %}</div>
41 changes: 41 additions & 0 deletions docs/faq/how-do-i-use-anisotropic-medium.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# How Do I Use Anisotropic Medium?

| Date | Category |
|------------|-------------|
| 2025-09-24 11:50:54 | Inverse Design |


Currently, classes of [AnisotropicMedium](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.AnisotropicMedium.html) are not supported with the `autograd` plugin.
However, it is possible to work with diagonally anisotropic materials by defining a [CustomMedium](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.CustomMedium.html#tidy3d.CustomMedium) that uses a diagonally anisotropic [PermittivityDataset](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.PermittivityDataset.html).

The following example shows how to create an anisotropic LN medium with the extraordinary axis aligned along the z-axis:




```python
# Define the coordinates for the medium
X = [-1e12, 1e12]
f = [td.C_0]
coords = dict(x=X, y=X, z=X, f=f)

# Define the datasets
n_e = 2.17
n_o = 2.23

eps_xx = td.ScalarFieldDataArray(np.ones((2, 2, 2, 1)) * n_e**2, coords=coords)
eps_yy = eps_xx
eps_zz = td.ScalarFieldDataArray(np.ones((2, 2, 2, 1)) * n_o**2, coords=coords)

# Define anisotropic permittivity dataset
permittivity = td.PermittivityDataset(
eps_xx=eps_xx,
eps_yy=eps_yy,
eps_zz=eps_zz
)

# Define anisotropic custom medium
medium = td.CustomMedium(eps_dataset=permittivity)
```


1 change: 1 addition & 0 deletions docs/inverse-design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ Inverse Design
faq/how-do-i-include-fabrication-constraints-in-adjoint-topology-optimization.md
faq/how-do-i-include-fabrication-constraints-in-adjoint-level-set-optimization.md
faq/how-do-i-export-the-final-inverse-design-structure-to-gds.md
faq/how-do-i-use-anisotropic-medium.md
3 changes: 2 additions & 1 deletion faq_categories.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@
"_faqs/how-do-i-include-fabrication-constraints-in-adjoint-shape-optimization.md",
"_faqs/how-do-i-include-fabrication-constraints-in-adjoint-topology-optimization.md",
"_faqs/how-do-i-include-fabrication-constraints-in-adjoint-level-set-optimization.md",
"_faqs/how-do-i-export-the-final-inverse-design-structure-to-gds.md"
"_faqs/how-do-i-export-the-final-inverse-design-structure-to-gds.md",
"_faqs/how-do-i-use-anisotropic-medium.md"
]
},
{
Expand Down