stanfordnqp / spins-b

Photonic optimization library
GNU General Public License v3.0
290 stars 114 forks source link

Phase objective in goos #44

Closed anthmanni closed 3 years ago

anthmanni commented 4 years ago

Hello,

I'm trying to transition my code from invdes to goos. Goos seems very powerful, and I understand why you are moving towards this being the main engine of spins.

How do I define a complex value as the objective for an overlap? I'm trying obj = goos.abs((1+0j) - sim["Overlap"])**2 and I get "ValueError: Error encountered when validating node goos.function.constant.16."

Also, how do I define the substrate material? Or is it always assumed to be SiO2? I want to make sure I'm not simulating a waveguide floating in air.

Thank you, Anthony

kaipengliuHIT commented 3 years ago

Have you solved this problem?

kaipengliuHIT commented 3 years ago

Hello,

I'm trying to transition my code from invdes to goos. Goos seems very powerful, and I understand why you are moving towards this being the main engine of spins.

How do I define a complex value as the objective for an overlap? I'm trying obj = goos.abs((1+0j) - sim["Overlap"])**2 and I get "ValueError: Error encountered when validating node goos.function.constant.16."

Also, how do I define the substrate material? Or is it always assumed to be SiO2? I want to make sure I'm not simulating a waveguide floating in air.

Thank you, Anthony

Have you solved this problem? I have the seem problem.

JesseLu commented 3 years ago

I think doing something like goos.Constant(1 + 1j) should work.