Skip to content

Conversation

tylerflex
Copy link
Collaborator

This adds a new section to the visible light metalens where we use local field projection and adjoint to fine tune the power directed to the focal spot.

We get a 17% improvement over 15 iterations.

NOTES:

  • uses yaugenst-flex/polyslab-grads frontend branch, which has not been merged. without the code from this branch, the results will be terrible because the gradients are inaccurate.
  • uses local gradient calculation to make use of the changes in this branch. Ideally we would switch to remote gradient.
  • The gradient processing takes >5 minutes each iteration.. so I limited the code to only run one iteration. I left the cell output to correspond to the full 15 iterations that I ran locally, along with a small note.

Not sure when is the best time to merge this, maybe after Yannick's PR is merged and it is fast enough to justify running this?

@tylerflex tylerflex force-pushed the tyler/autograd_/metalens_angle branch 3 times, most recently from 443eefb to 7eaf2a3 Compare June 11, 2025 19:32
@tylerflex tylerflex force-pushed the tyler/autograd_/metalens_angle branch from 7eaf2a3 to dc2c4bd Compare September 26, 2025 14:30
@tylerflex
Copy link
Collaborator Author

@tomflexcompute this should be ready to go, I fixed the linter error and made sure it ran properly on the latest develop branch.

Copy link
Contributor

github-actions bot commented Sep 26, 2025

Spell Check Report

Metalens.ipynb:

Cell 40, Line 9: 'meta-cell'
  > In this case, we use the local field projection to compute the intensity enhancement at the focal point as a function of each of the meta-cell angles.
Cell 41, Line 31: 'meta-cell'
  > """Return a simulation as a function of the meta-cell angles."""
Cell 46, Line 1: 'PuBuGn'
  > plt.imshow(grad.reshape((N, N)), cmap="PuBuGn")

Checked 1 notebook(s). Found spelling errors in 1 file(s).
Generated by GitHub Action run: https://github.com/flexcompute/tidy3d-notebooks/actions/runs/18100448301

Copy link
Contributor

@tomflexcompute tomflexcompute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tylerflex good to go after you correct the typos AI suggested.

@tylerflex tylerflex force-pushed the tyler/autograd_/metalens_angle branch from dc2c4bd to 91754b1 Compare September 29, 2025 14:28
@tylerflex
Copy link
Collaborator Author

Thanks @tomflexcompute , fixed all relevant typos. Apparently I have a really hard type spelling the word "function", seems like every notebook I spell that wrong.

I will merge

@tylerflex tylerflex merged commit 38699a3 into develop Sep 29, 2025
1 check passed
@tylerflex tylerflex deleted the tyler/autograd_/metalens_angle branch September 29, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants