Skip to content

Commit

Permalink
use full permittivity grabbing for shifting boundary adjoint in Geome…
Browse files Browse the repository at this point in the history
…tryGroup
  • Loading branch information
tylerflex committed Aug 30, 2024
1 parent 7eac195 commit b74f1a3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved passivity enforcement near high-Q poles in `FastDispersionFitter`. Failed passivity enforcement could lead to simulation divergences.
- More helpful error and suggestion if users try to differentiate w.r.t. unsupported `FluxMonitor` output.
- Removed positive warnings in Simulation validators for Bloch boundary conditions.
- `GeometryGroup` does automatic permittivity calculation for shifting boundary gradients.
- Improve accuracy in `Box` shifting boundary gradients.
- Improve accuracy in `FieldData` operations involving H fields (like `.flux`).
- Better error and warning handling in autograd pipeline.

## [2.7.2] - 2024-08-07

Expand Down
2 changes: 1 addition & 1 deletion tests/test_components/test_autograd.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def plot_sim(sim: td.Simulation, plot_eps: bool = True) -> None:
args = [("polyslab", "mode")]


args = [("size_element", "mode")]
# args = [("size_element", "mode")]


def get_functions(structure_key: str, monitor_key: str) -> typing.Callable:
Expand Down
2 changes: 1 addition & 1 deletion tidy3d/components/geometry/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3214,7 +3214,7 @@ def compute_derivatives(self, derivative_info: DerivativeInfo) -> AutogradFieldM
_, index, *geo_path = field_path
geo = self.geometries[index]
geo_info = derivative_info.updated_copy(
paths=[geo_path], bounds=geo.bounds, eps_approx=True
paths=[geo_path], bounds=geo.bounds, eps_approx=False
)
vjp_dict_geo = geo.compute_derivatives(geo_info)
grad_vjp_values = list(vjp_dict_geo.values())
Expand Down
2 changes: 0 additions & 2 deletions tidy3d/web/api/autograd/autograd.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,6 @@ def setup_adj(
# immediately filter out any data_vjps with all 0's in the data
data_fields_vjp = {key: get_static(value) for key, value in data_fields_vjp.items()}

# import pdb; pdb.set_trace()

# insert the raw VJP data into the .data of the original SimulationData
sim_data_vjp = sim_data_orig.insert_traced_fields(field_mapping=data_fields_vjp)

Expand Down

0 comments on commit b74f1a3

Please sign in to comment.