


{"id":238303,"date":"2022-10-21T01:16:08","date_gmt":"2022-10-21T01:16:08","guid":{"rendered":"\/forum\/forums\/topic\/inverse-design-package-with-lumapi-and-lumopt\/"},"modified":"2022-10-21T01:16:08","modified_gmt":"2022-10-21T01:16:08","slug":"inverse-design-package-with-lumapi-and-lumopt","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/inverse-design-package-with-lumapi-and-lumopt\/","title":{"rendered":"Inverse design package with Lumapi and LumOpt"},"content":{"rendered":"<div>Hi all,<\/div>\n<div>&nbsp;<\/div>\n<div>Our research group wants to use the inverse design function of Lumerical and we started with the example &#8211; 2D Ysplitter problem in the Lumerical example gallery. We are referring to this tutorial:&nbsp; the <a href=\"https:\/\/lumopt.readthedocs.io\/en\/latest\/tutorial.html\" target=\"_blank\" rel=\"noopener\" data-saferedirecturl=\"https:\/\/www.google.com\/url?q=https:\/\/lumopt.readthedocs.io\/en\/latest\/tutorial.html&amp;source=gmail&amp;ust=1666384559020000&amp;usg=AOvVaw3STiaTZimOYfeqYCHKtfzZ\">https:\/\/lumopt.readthedocs.io\/en\/latest\/tutorial.html<\/a><\/div>\n<div>&nbsp;<\/div>\n<div>We keep encountering issues when running the splitter_opt_2D.py file. Here is what I did to install LumOpt and run the file.<\/div>\n<div>&nbsp;<\/div>\n<div>I typed all of these commands in a VSCode terminal on a&nbsp;windows10&nbsp;desktop and I am using python3 and the latest&nbsp;version of Lumerical.<\/div>\n<div>&nbsp;<\/div>\n<div>1. First, I entered the directory where lumapi locates with the command:<\/div>\n<div>cd &#8220;C:\\Program Files\\Lumerical|v222\\api\\python&#8221;<\/div>\n<div>&nbsp;<\/div>\n<div>2. then I cloned the github repo mentioned in the tutorial by:<\/div>\n<div><span style=\"font-family: arial, sans-serif\">git clone&nbsp;<a href=\"https:\/\/github.com\/chriskeraly\/LumOpt.git\" target=\"_blank\" rel=\"noopener\" data-saferedirecturl=\"https:\/\/www.google.com\/url?q=https:\/\/github.com\/chriskeraly\/LumOpt.git&amp;source=gmail&amp;ust=1666384559020000&amp;usg=AOvVaw05f1cNHeojLo5crdP-Cc75\">https:\/\/github.com\/chriskeraly\/LumOpt.git<\/a><\/span><\/div>\n<div><span style=\"font-family: arial, sans-serif\">After this operation, I could see I have LumOpt under &#8220;<\/span>C:\\Program Files\\Lumerical|v222\\api\\python&#8221;<\/div>\n<div>&nbsp;<\/div>\n<div><span style=\"color: #24292f;font-family: arial, sans-serif\">3.Then I enter the LumOpt folder with:<\/span><\/div>\n<div>cd &#8220;C:\\Program Files\\Lumerical\\v222\\api\\python\\LumOpt&#8221;<\/div>\n<div>and run the setup file with:<\/div>\n<div>python setup.py develop &#8211;install-dir &#8216;C:\\Program Files\\Lumerical\\v222\\api\\python\\LumOpt&#8217;<\/div>\n<div>From the output information, I can see all of the package requirements are satisfied.<\/div>\n<div>&nbsp;<\/div>\n<div>4.To make sure the splitter_opt_2D.py can import the packages from lumopt successfully, I add two lines in the splitter_opt_2D.py, which are:<\/div>\n<div>sys.path.append(&#8220;C:\\\\Program Files\\\\Lumerical\\\\v222\\\\api\\\\python\\\\&#8221;)<\/div>\n<div>\n<div>sys.path.append(&#8220;C:\\\\Program Files\\\\Lumerical\\\\v222\\\\api\\\\python\\\\LumOpt\\\\&#8221;)<\/div>\n<\/div>\n<div>and I tried to run splitter_opt_2D.py with the command:<\/div>\n<div>python &#8216;C:\\Program Files\\Lumerical\\v222\\api\\python\\LumOpt\\examples\\Ysplitter\\splitter_opt_2D.py&#8217;<\/div>\n<div>&nbsp;<\/div>\n<div>5. I can see the Lumerical window opens but after some quick initialization, an error was reported:<\/div>\n<div>AttributeError: &#8216;SnapShots&#8217; object has no attribute &#8216;_tmpdir&#8217;<\/div>\n<div>and the Lumerical window quited quickly.<\/div>\n<div>&nbsp;<\/div>\n<div>Any help will be highly appreciated!<\/div>\n","protected":false},"template":"","class_list":["post-238303","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["265193","30281"],"_bbp_author_ip":["23.56.168.214"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["757"],"_bbp_likes_count":["1"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["238303"],"_bbp_forum_id":["27833"],"_bbp_engagement":["30281","265193"],"_bbp_voice_count":["2"],"_bbp_reply_count":["2"],"_bbp_last_reply_id":["238536"],"_bbp_last_active_id":["238536"],"_bbp_last_active_time":["2022-10-24 16:23:17"]},"test":"wenyizhaandrew-cmu-edu"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/238303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/238303\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=238303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}