flaport / sax

S + Autograd + XLA :: S-parameter based frequency domain circuit simulations and optimizations using JAX.
https://flaport.github.io/sax
Apache License 2.0
70 stars 17 forks source link

FEAT: get_required_circuit_models function #18

Closed daquintero closed 1 year ago

daquintero commented 1 year ago

Hi Floris,

Hope you are well! Thanks again for the great software.

This function is something that would be very handy as I'm integrating sax into my project. I think might be useful for other people when prototyping their models using sax circuits too.

Example usage:

from gdsfactory.components import mzi2x2_2x2
import sax
mzi2x2_netlist = mzi2x2_2x2().get_netlist(exclude_port_types="electrical")
sax.get_required_circuit_models(mzi2x2_netlist)

Returns:

['bend_euler', 'mmi2x2', 'straight']

What do you think?

flaport commented 1 year ago

Thanks @daquintero , this is indeed a useful function!

I added your function to circuit.ipynb to keep the nbdev notebooks and library in sync. For the rest I kept everything the same :)

flaport commented 1 year ago

Will be available in version 0.8.8.

daquintero commented 1 year ago

Cheers Floris!