Skip to content

Commit 4a21d3f

Browse files
committed
Add tidy3d-extras install option
1 parent 12db6ef commit 4a21d3f

File tree

17 files changed

+1134
-26
lines changed

17 files changed

+1134
-26
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
### Added
1212
- New `MediumMonitor` that returns both permittivity and permeability profiles.
1313
- Task names are now optional when using `run(sim)` or `Job`. When running multiple jobs (via `run_async` or `Batch`), you can also provide simulations as a list without specifying task names. The previous dictionary-based format with explicit task names is still supported.
14+
- Added support for `tidy3d-extras`, an optional plugin that enables more accurate local mode solving via subpixel averaging.
1415

1516
### Changed
1617

docs/extras/index.rst

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
Extras Plugin |:gift:|
2+
======================
3+
.. currentmodule:: tidy3d-extras
4+
5+
``tidy3d-extras`` is an optional plugin for Tidy3D providing additional, more advanced local functionality. This additional functionality includes a more accurate local mode solver with subpixel averaging.
6+
7+
8+
Installation
9+
------------
10+
11+
Simply go to `tidy3d.simulation.cloud <https://tidy3d.simulation.cloud/>`__ and sign up for an account.
12+
From there, just load our `web GUI <https://tidy3d.simulation.cloud/folders>`__ (no installation required) or continue with the next steps for the Python interface.
13+
14+
``tidy3d-extras`` is a python module that can be easily installed via ``pip``.
15+
The version must match the version of Tidy3D, so the preferred command
16+
for installation is::
17+
18+
pip install "tidy3d[extras]"
19+
20+
This command will install ``tidy3d-extras`` and its dependencies in the current environment.
21+
22+
.. important::
23+
24+
``tidy3d-extras`` is **not compatible with Conda environments**.
25+
Please use a standard Python virtual environment (e.g., ``venv`` or ``virtualenv``) for installation.
26+
27+
A Tidy3D API key is required to authenticate ``tidy3d-extras`` users.
28+
If you don't have one already configured, you can `get a free API key <https://tidy3d.simulation.cloud/account?tab=apikey>`__ and configure it with the following command::
29+
30+
tidy3d configure
31+
32+
On **Windows**, it is easier to use ``pipx`` to find the path to the configuration tool::
33+
34+
pip install pipx
35+
pipx run tidy3d configure
36+
37+
More information about the installation and configuration of Tidy3D can be found `here <https://docs.flexcompute.com/projects/tidy3d/en/latest/install.html>`__.
38+
39+
You can verify that the ``tidy3d-extras`` installation worked by running the following command to print the installed version::
40+
41+
python -c 'import tidy3d_extras as tde; print(tde.__version__)'
42+
43+
44+
Usage
45+
-----
46+
47+
Currently, ``tidy3d-extras`` provides the following features:
48+
49+
- Local subpixel-averaged permittivity. This is what one would obtain
50+
with a ``PermittivityMonitor`` in an FDTD ``Simulation``.
51+
- More accurate local mode solver with subpixel averaging.
52+
53+
By default, these features are automatically enabled if the ``tidy3d-extras``
54+
package is installed. Thus to obtain subpixel-averaged permittivity, you can
55+
use functions like ``Simulation.epsilon``. And the more accurate mode solver
56+
with subpixel averaging is used whenever the mode solver is run locally.
57+
58+
Sometimes, you may want to change this behavior, for example to speed up
59+
permittivity computation. In this case, you can temporarily disable these
60+
features by setting the config variable::
61+
62+
tidy3d.config.use_local_subpixel = False
63+
64+
This can also be set to ``True`` to ensure that subpixel averaging is used.
65+
You can check whether local subpixel averaging is turned on::
66+
67+
tidy3d.packaging.tidy3d_extras["use_local_subpixel"]
68+
69+
Licenses
70+
--------
71+
72+
.. toctree::
73+
:maxdepth: 2
74+
75+
license
76+
third_party_licenses

docs/extras/license.rst

Lines changed: 121 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)