flexcompute / tidy3d

Fast electromagnetic solver (FDTD) at scale.
https://docs.flexcompute.com/projects/tidy3d/en/latest/
GNU Lesser General Public License v2.1
176 stars 40 forks source link

Particle swarm optimization #1107

Closed momchil-flex closed 11 months ago

momchil-flex commented 1 year ago

It would be great to add one or a few examples of particle swarm optimization to our notebooks. There is a lot of interest in that because I think it can be pretty good to find big improvement in designs that rely on a small number of parameters that are still too many to handle in a full parameter scan. I think we can even pick one of our existing PIC examples, ideally a single simulation should be small-ish, and we should optimize 3-5 global parameters so that the total number of simulations that have to be done is manageable for an example.

Any other thoughts @tomflexcompute @tylerflex?

momchil-flex commented 1 year ago

Forgot to mention this can use a third-party optimizer. This seems pretty well established.

tomflexcompute commented 1 year ago

Yeah I can work on it in the next few weeks if Emerson is busy with something else.

A few customers have asked about PSO and pyswarms have been my recommendations for them as well. Should be relatively straightforward to incorporate it with Tidy3D I think. One question is can we simply use public packages like this in our published materials? I guess we have been using things like pandas and scipy but in general is it ok to directly use these for commercial purposes?

tomflexcompute commented 1 year ago

It's under MIT license which permits commercial use so it should be good to go?

momchil-flex commented 1 year ago

Yes, anything that's not GPL is generally fine.

e-g-melo commented 1 year ago

Nice! I've suggested including these global optimization features and Monte Carlo simulations as new study types in GUI in the future. This notebook will help a lot as a starting point.

On Mon, Aug 28, 2023 at 11:30 PM momchil-flex @.***> wrote:

Yes, anything that's not GPL is generally fine.

— Reply to this email directly, view it on GitHub https://github.com/flexcompute/tidy3d/issues/1107#issuecomment-1696677163, or unsubscribe https://github.com/notifications/unsubscribe-auth/A55TUUSJGCZDQQLDQL25K6LXXVH5VANCNFSM6AAAAAA4CG7RXM . You are receiving this because you were assigned.Message ID: @.***>

tylerflex commented 1 year ago

Sounds good to me and I am in favor of using external optimization packages (eg pyswarms) whenever possible. Just remember to add it here: https://github.com/flexcompute-readthedocs/tidy3d-docs/blob/develop/docs/requirements.txt

tomflexcompute commented 11 months ago

The PBS notebook has been merged and the bullseye extractor is about to be merged too. We can close this issue now.