Frequently Asked Questions¶
How to estimate the cost of an S matrix computation?¶
When using a Tidy3DModel
, the cost can be estimated with the Tidy3DModel.estimate_cost()
function.
An example can be found in the Tidy3D Model guide.
How to change the layers of a component?¶
The function Component.remap_layers()
can be used to efficiently remap the existing layers into new ones.
Can I use paths to create corrugated waveguides?¶
Yes, by parametrizing the width
(and optionally the offset
) of the path.
The parametrization uses an Expression
to define the value and the derivative of the value for the with (or offset) along the path.
Here’s an example:
w0 = 0.5
dw = 0.1
scale = 50 * np.pi
width = pf.Expression(
"u",
[
("w", f"{w0} + {dw} * sin({scale} * u)"),
("dw_du", f"{dw * scale} * cos({scale} * u)"),
],
)
# Ring with both sides corrugated from the width expression
both_sides = pf.Path((0, 0), width(0)[0])
both_sides.arc(-90, 270, radius=5, width=width)
offset = pf.Expression(
"u",
[
("q", f"{-0.5 * dw} * sin({scale} * u)"),
("dq_du", f"{-0.5 * dw * scale} * cos({scale} * u)"),
],
)
# Single side corrugation by adjusting the central offset to compensate
# half of the width corrugation
one_side = pf.Path((15, 0), width(0)[0], offset(0)[0])
one_side.arc(-90, 270, radius=5, width=width, offset=offset)