


{"id":422451,"date":"2025-02-19T18:54:45","date_gmt":"2025-02-19T18:54:45","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/using-phase-as-a-figure-of-merit-for-inverse-design-in-lumerical-fdtd-lumopt-api\/"},"modified":"2025-02-19T18:54:45","modified_gmt":"2025-02-19T18:54:45","slug":"using-phase-as-a-figure-of-merit-for-inverse-design-in-lumerical-fdtd-lumopt-api","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/using-phase-as-a-figure-of-merit-for-inverse-design-in-lumerical-fdtd-lumopt-api\/","title":{"rendered":"Using Phase as a Figure of Merit for Inverse Design in Lumerical FDTD Lumopt API"},"content":{"rendered":"<p>&lt;p&gt;I have been working with the Lumerical FDTD and Lumopt API for my simulation setup, and I am currently using the ModeMatch function to set transmission as a figure of merit (FOM) for evaluating insertion loss. The code I&rsquo;m using looks like this:&lt;\/p&gt;<\/p>\n<pre>classlumopt.figures_of_merit.modematch.ModeMatch(monitor_name, mode_number, direction, multi_freq_src=False, target_T_fwd=&lt;function ModeMatch.&lt;lambda&gt;&gt;, norm_p=1)<\/pre>\n<p>&lt;p data-start=&#8221;628&#8243; data-end=&#8221;817&#8243;&gt;As per the documentation, the &lt;code data-start=&#8221;658&#8243; data-end=&#8221;672&#8243;&gt;target_T_fwd<\/code> parameter can be adjusted from 0 to 1 depending on the requirements, and the &lt;code data-start=&#8221;750&#8243; data-end=&#8221;761&#8243;&gt;direction<\/code> parameter can be set as either &#8220;forward&#8221; or &#8220;backward.&#8221;&lt;\/p&gt;&lt;p data-start=&#8221;819&#8243; data-end=&#8221;1053&#8243;&gt;However, I would like to know if it&#8217;s possible to set the &lt;strong data-start=&#8221;877&#8243; data-end=&#8221;886&#8221;&gt;phase<\/strong> as the FOM instead of the transmission in Lumopt. I understand that phase can be extracted from a time monitor using Fourier transforms, as shown in the script below:&lt;\/p&gt;<\/p>\n<pre>Ey = pinch(getdata(\"monitor\",\"Ey\"));&lt;br&gt;t = getdata(\"monitor\",\"t\");&lt;br&gt;f = linspace(c\/1600e-9,c\/1500e-9,100);&lt;br&gt;w = 2*pi*f;&lt;br&gt;Ew = czt(Ey,t,w)\/sourcenorm(f);&lt;br&gt;phi = unwrap(angle(Ew));&lt;br&gt;plot(c\/f*1e9,phi,\"Wavelength(nm)\",\"phase\");&lt;br&gt;&lt;br&gt;<\/pre>\n<p>&lt;p data-start=&#8221;1287&#8243; data-end=&#8221;1491&#8243;&gt;This script successfully calculates the phase values. My question is: Does the Lumopt API allow for phase to be used as the figure of merit (FOM) in place of transmission, and if so, how can this be done?&lt;\/p&gt;&lt;p data-start=&#8221;1493&#8243; data-end=&#8221;1589&#8243;&gt;I would greatly appreciate any insights or suggestions from the community regarding this matter.&lt;\/p&gt;<\/p>\n<pre>&nbsp;<\/pre>\n","protected":false},"template":"","class_list":["post-422451","topic","type-topic","status-publish","hentry","topic-tag-fom","topic-tag-inverse-design-2","topic-tag-phase-change"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_forum_id":["27833"],"_bbp_topic_id":["422451"],"_bbp_subscription":["74013","14496"],"_bbp_author_ip":["142.157.244.47"],"_bbp_last_reply_id":["422671"],"_bbp_last_active_id":["422671"],"_bbp_last_active_time":["2025-02-21 01:00:44"],"_bbp_reply_count":["1"],"_bbp_reply_count_hidden":["0"],"_bbp_voice_count":["2"],"_bbp_engagement":["74013","14496"],"_btv_view_count":["381"],"_bbp_topic_status":["unanswered"]},"test":"2d55cc8877bc73dbdaabbcc27c671fe2dcfca9d0"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/422451","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\/422451\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=422451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}