TAGGED: api, inverse-design, lumopt, python
-
-
December 23, 2022 at 12:41 am
schinta3
SubscriberHello,
I am trying to work through several of the LumOpt examples.I am running through a Jupyter Notebook (through anaconda) as recommended here (https://lumopt.readthedocs.io/en/latest/install.html). I am using the current v222 api as opposed to the clone from github which uses a previous version.
-I can successfully import lumapi within the notebook, and run the gui through "fdtd = lumapi.FDTD()".
Two issues come up with plotter.pyÂ
1)Â
C:\Program Files\Lumerical\v222\api\python\lumopt\utilities\plotter.py:61:
UserWarning: Matplotlib is currently using module://matplotlib_inline.backend_inline, which is a non-GUI backend, so cannot show the figure. self.fig.show()
I dont think(?) this is a huge issue as the optimzation runs. %matplotlib inline is usually the recommended backend.
Is there a way to fix this?
------------------------------------------------------------------------------------------------------------------------------------------------
2)File C:\Program Files\Lumerical\v222\api\python\lumopt\utilities\plotter.py:29, in SnapShots.finish(self) 28 def finish(self): ---> 29 self._frame_sink().close() AttributeError: 'SnapShots' object has no attribute '_frame_sink'
The WDMsplitter.py script runs fine from the Lumerical GUI, but this error is always thrown through a notebook.
How should I address this to do interactive python development? -
December 23, 2022 at 6:42 pm
Guilin Sun
Ansys EmployeeThe sepcialist in this subject is in holiday. I try my best to help you.
From my limited experience, using the Lumerical built-in Python is the best. I strongly suggest that you uninstal your version of Python, and Lumerical. clean everything, and then reinstall the Lumerical software.
Please try.
Â
Â
Â
-
December 23, 2022 at 10:08 pm
schinta3
SubscriberHi, no problem, thank you for your help.
Using the built-in python works fine, however the issue remains with interfacing with a notebook.
The reason I am using a notebook is because there doesn't seem to be a useful python debugger within the lumerical script editor.Â
Thank you, I can wait until the specailist gets back. Have a good holiday season
-
December 28, 2022 at 9:05 pm
schinta3
SubscriberI have fixed the error I mentioned before by switching to a non-Anaconda environment. However, is there a way to use LumOpt with a source that is not a mode source and an appropriate fom monitor/functon?
Â
-
December 28, 2022 at 10:00 pm
Guilin Sun
Ansys EmployeeThank you for letting me know. It is possible, but you need to develop your own model. I would suggest you to get more information from the original develpoer. please search "LumOpt ".
Â
-
January 3, 2023 at 8:50 pm
schinta3
SubscriberHi,
One more question. The model I have developed is similar to a photonic crystal slab. One of the parameters I would like to optimize over is the lattice constant. Since this involves periodic boundary conditions, the size of the fdtd simulaton region itself would be dynamically rescaled per simulation if the lattice constant changes. Is this possible within lumopt?
From https://lumopt.readthedocs.io/en/latest/tutorial.html#lumerical-setup-script it seems the setup script considers the 'optimizable geometry' objects to be in a static simulation area...
-
January 3, 2023 at 9:16 pm
Guilin Sun
Ansys EmployeeWe do not have similar example however we encourage customers to explore the possibility, with some efforts.
-
- The topic ‘LumOpt Issue’ is closed to new replies.
-
6625
-
1906
-
1469
-
1311
-
1022
© 2026 Copyright ANSYS, Inc. All rights reserved.