Skip to content

Commit 7bc7a1f

Browse files
authored
updating doping FAQ with custom doping (#53)
1 parent 594232f commit 7bc7a1f

File tree

2 files changed

+92
-8
lines changed

2 files changed

+92
-8
lines changed

_faqs/how-can-i-define-doping-profile.md

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ date: 2025-08-26 10:06:59
44
enabled: true
55
category: "Charge"
66
---
7-
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.
8-
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).
7+
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.
8+
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).
99

1010
The doping profile can be:
1111

12-
- Uniform, implemented using the [`ConstantDoping`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.ConstantDoping.html){: .color-primary-hover} object:
12+
- **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:
1313

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

37-
- Gaussian, implemented using the [`GaussianDoping`](https://docs.flexcompute.com/projects/tidy3d/en/latest/api/_autosummary/tidy3d.GaussianDoping.html){: .color-primary-hover} object:
37+
- **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:
3838

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

68+
- **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}.
69+
This approach allows defining essentially any spatial doping profile (for example, Pearson-like implantation profiles derived from fab parameters).
70+
71+
<div markdown class="code-snippet">
72+
{% highlight python %}
73+
import tidy3d as td
74+
import numpy as np
75+
76+
# Define geometry
77+
geometry = td.Cylinder(radius=1, length=1)
78+
79+
# Pearson-like doping profile
80+
def pearson_doping(z, P, R, T, S, offset=0):
81+
z = z - offset
82+
return P * (1 + ((z - R) / T)**2)**(S / 2 + 0.75) + offset
83+
84+
# Create coordinates
85+
NUM_PTS = 300
86+
rmin, rmax = geometry.bounds
87+
x = np.linspace(rmin[0], rmax[0], NUM_PTS)
88+
y = np.linspace(rmin[1], rmax[1], NUM_PTS)
89+
z = np.linspace(rmin[2], rmax[2], NUM_PTS)
90+
X, Y, Z = np.meshgrid(x, y, z)
91+
92+
# Mask geometry
93+
mask = geometry.inside(X, Y, Z)
94+
95+
# Doping profile along z
96+
doping_profile = pearson_doping(
97+
z, P=7.77e18, R=0.10384, T=0.07878, S=1.71, offset=z.min()
98+
)
99+
100+
# Create SpatialDataArray
101+
doping_values = td.SpatialDataArray(
102+
mask * np.tile(doping_profile, (len(x), len(y), 1)),
103+
coords={"x": x, "y": y, "z": z}
104+
)
105+
{% endhighlight %}
106+
{% include copy-button.html %}</div>
107+
68108
The unit for the free carrier concentration is 1/$\text{cm}^3$.
69109

70-
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.
110+
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.
111+

docs/faq/how-can-i-define-doping-profile.md

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Positive doping corresponds to the `N_d` (number of donors) parameter of the [`S
1010

1111
The doping profile can be:
1212

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

1515

1616

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

3838

3939

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

4242

4343

@@ -70,6 +70,49 @@ gaussian_box2 = td.GaussianDoping.from_bounds(
7070

7171

7272

73+
- **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).
74+
This approach allows defining essentially any spatial doping profile (for example, Pearson-like implantation profiles derived from fab parameters).
75+
76+
77+
78+
```python
79+
import tidy3d as td
80+
import numpy as np
81+
82+
# Define geometry
83+
geometry = td.Cylinder(radius=1, length=1)
84+
85+
# Pearson-like doping profile
86+
def pearson_doping(z, P, R, T, S, offset=0):
87+
z = z - offset
88+
return P * (1 + ((z - R) / T)**2)**(S / 2 + 0.75) + offset
89+
90+
# Create coordinates
91+
NUM_PTS = 300
92+
rmin, rmax = geometry.bounds
93+
x = np.linspace(rmin[0], rmax[0], NUM_PTS)
94+
y = np.linspace(rmin[1], rmax[1], NUM_PTS)
95+
z = np.linspace(rmin[2], rmax[2], NUM_PTS)
96+
X, Y, Z = np.meshgrid(x, y, z)
97+
98+
# Mask geometry
99+
mask = geometry.inside(X, Y, Z)
100+
101+
# Doping profile along z
102+
doping_profile = pearson_doping(
103+
z, P=7.77e18, R=0.10384, T=0.07878, S=1.71, offset=z.min()
104+
)
105+
106+
# Create SpatialDataArray
107+
doping_values = td.SpatialDataArray(
108+
mask * np.tile(doping_profile, (len(x), len(y), 1)),
109+
coords={"x": x, "y": y, "z": z}
110+
)
111+
```
112+
113+
114+
73115
The unit for the free carrier concentration is 1/$\text{cm}^3$.
74116

75-
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.
117+
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.
118+

0 commit comments

Comments
 (0)