Skip to content
Merged
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
51 changes: 46 additions & 5 deletions _faqs/how-can-i-define-doping-profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ date: 2025-08-26 10:06:59
enabled: true
category: "Charge"
---
Doping is defined as a box with a specific doping profile and is added to a [`SemiconductorMedium`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.SemiconductorMedium.html){: .color-primary-hover} object.
Positive doping corresponds to the `N_d` (number of donors) parameter of the [`SemiconductorMedium`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.SemiconductorMedium.html){: .color-primary-hover}, while negative doping corresponds to the `N_a` (number of acceptors).
Doping is defined as a box with a specific doping profile and is added to a [`SemiconductorMedium`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.SemiconductorMedium.html){: .color-primary-hover}{: .color-primary-hover} object.
Positive doping corresponds to the `N_d` (number of donors) parameter of the [`SemiconductorMedium`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.SemiconductorMedium.html){: .color-primary-hover}{: .color-primary-hover}, while negative doping corresponds to the `N_a` (number of acceptors).

The doping profile can be:

- Uniform, implemented using the [`ConstantDoping`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.ConstantDoping.html){: .color-primary-hover} object:
- **Uniform**, implemented using the [`ConstantDoping`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.ConstantDoping.html){: .color-primary-hover}{: .color-primary-hover} object:

<div markdown class="code-snippet">
{% highlight python %}
Expand All @@ -34,7 +34,7 @@ constant_box2 = td.ConstantDoping.from_bounds(
{% endhighlight %}
{% include copy-button.html %}</div>

- Gaussian, implemented using the [`GaussianDoping`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.GaussianDoping.html){: .color-primary-hover} object:
- **Gaussian**, implemented using the [`GaussianDoping`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.GaussianDoping.html){: .color-primary-hover}{: .color-primary-hover} object:

<div markdown class="code-snippet">
{% highlight python %}
Expand Down Expand Up @@ -65,6 +65,47 @@ gaussian_box2 = td.GaussianDoping.from_bounds(
{% endhighlight %}
{% include copy-button.html %}</div>

- **Arbitrary (user-defined)**, implemented by directly providing a [`SpatialDataArray`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.SpatialDataArray.html){: .color-primary-hover}{: .color-primary-hover} to the `N_d` or `N_a` arguments of the [`SemiconductorMedium`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.SemiconductorMedium.html){: .color-primary-hover}{: .color-primary-hover}.
This approach allows defining essentially any spatial doping profile (for example, Pearson-like implantation profiles derived from fab parameters).

<div markdown class="code-snippet">
{% highlight python %}
import tidy3d as td
import numpy as np

# Define geometry
geometry = td.Cylinder(radius=1, length=1)

# Pearson-like doping profile
def pearson_doping(z, P, R, T, S, offset=0):
z = z - offset
return P * (1 + ((z - R) / T)**2)**(S / 2 + 0.75) + offset

# Create coordinates
NUM_PTS = 300
rmin, rmax = geometry.bounds
x = np.linspace(rmin[0], rmax[0], NUM_PTS)
y = np.linspace(rmin[1], rmax[1], NUM_PTS)
z = np.linspace(rmin[2], rmax[2], NUM_PTS)
X, Y, Z = np.meshgrid(x, y, z)

# Mask geometry
mask = geometry.inside(X, Y, Z)

# Doping profile along z
doping_profile = pearson_doping(
z, P=7.77e18, R=0.10384, T=0.07878, S=1.71, offset=z.min()
)

# Create SpatialDataArray
doping_values = td.SpatialDataArray(
mask * np.tile(doping_profile, (len(x), len(y), 1)),
coords={"x": x, "y": y, "z": z}
)
{% endhighlight %}
{% include copy-button.html %}</div>

The unit for the free carrier concentration is 1/$\text{cm}^3$.

It is important to note that doping boxes are additive; i.e., if two donor doping boxes overlap, the total concentration will be the sum of these two overlapping doping boxes.
It is important to note that doping boxes are additive; i.e., if two donor doping regions overlap, the total concentration will be the sum of the overlapping contributions.

49 changes: 46 additions & 3 deletions docs/faq/how-can-i-define-doping-profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Positive doping corresponds to the `N_d` (number of donors) parameter of the [`S

The doping profile can be:

- Uniform, implemented using the [`ConstantDoping`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.ConstantDoping.html) object:
- **Uniform**, implemented using the [`ConstantDoping`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.ConstantDoping.html) object:



Expand All @@ -37,7 +37,7 @@ constant_box2 = td.ConstantDoping.from_bounds(



- Gaussian, implemented using the [`GaussianDoping`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.GaussianDoping.html) object:
- **Gaussian**, implemented using the [`GaussianDoping`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.GaussianDoping.html) object:



Expand Down Expand Up @@ -70,6 +70,49 @@ gaussian_box2 = td.GaussianDoping.from_bounds(



- **Arbitrary (user-defined)**, implemented by directly providing a [`SpatialDataArray`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.SpatialDataArray.html) to the `N_d` or `N_a` arguments of the [`SemiconductorMedium`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.SemiconductorMedium.html).
This approach allows defining essentially any spatial doping profile (for example, Pearson-like implantation profiles derived from fab parameters).



```python
import tidy3d as td
import numpy as np

# Define geometry
geometry = td.Cylinder(radius=1, length=1)

# Pearson-like doping profile
def pearson_doping(z, P, R, T, S, offset=0):
z = z - offset
return P * (1 + ((z - R) / T)**2)**(S / 2 + 0.75) + offset

# Create coordinates
NUM_PTS = 300
rmin, rmax = geometry.bounds
x = np.linspace(rmin[0], rmax[0], NUM_PTS)
y = np.linspace(rmin[1], rmax[1], NUM_PTS)
z = np.linspace(rmin[2], rmax[2], NUM_PTS)
X, Y, Z = np.meshgrid(x, y, z)

# Mask geometry
mask = geometry.inside(X, Y, Z)

# Doping profile along z
doping_profile = pearson_doping(
z, P=7.77e18, R=0.10384, T=0.07878, S=1.71, offset=z.min()
)

# Create SpatialDataArray
doping_values = td.SpatialDataArray(
mask * np.tile(doping_profile, (len(x), len(y), 1)),
coords={"x": x, "y": y, "z": z}
)
```



The unit for the free carrier concentration is 1/$\text{cm}^3$.

It is important to note that doping boxes are additive; i.e., if two donor doping boxes overlap, the total concentration will be the sum of these two overlapping doping boxes.
It is important to note that doping boxes are additive; i.e., if two donor doping regions overlap, the total concentration will be the sum of the overlapping contributions.