Photonics

Photonics

Topics related to Lumerical and more.

The two modes overlap the integral

    • zhang23
      Subscriber

      I manually saved one of the results of FDE as an.ldf fileThen import this.ldf file into another.ldf file with script, and run it, and finally use overlap to do the overlap integral of the two modes.But it shows such errors“no d-card called: global_mode2 was found”,Please help me find out why this is happening?

    • anna.wirth-singh
      Ansys Employee

      Hello, 

      Are you calculating the overlap via the script command? In this case, one possible cause for that error message is simply using the incorrect name to reference the desired mode. To call the mode that is selected in your screenshot, use "global_mode1" rather than "d-card 2".

      If this is not the cause of your error, please reply back to let me know and I will look into it further. 


      Best,

      Anna

       

      • zhang23
        Subscriber

        I am very sorry for my slow reply and thank you very much for your guidance. Let me explain my simulation steps:

        1.A quantum well structure is established and mode analysis is performed with FDE, which is manually performed.

        2.Use the script to import the result into the.ldf file.

        3.Next, manually create a waveguide in FDE and calculate its modes.

        4.Next, use a script to import the previously created .ldf file.

        As you can see, three d-cards appear on the right.

        5.Finally, manually calculate the overlap integral of the two modes.

        But as you can see, it's not possible to calculate the overlap integral of the two modes here. I want to know why. When using a script to calculate the overlap integral of the two modes, the message 'in overlap, no d-card called: global_mode2 was found' appears.

        Best,

        Zhang

      • zhang23
        Subscriber

        Hello, are you still there?

    • zhang23
      Subscriber

       

       

    • anna.wirth-singh
      Ansys Employee

      Hello, I apologize for missing your earlier comment. Thank you for bringing this to my attention and for providing the details of your calculation. I see your issue and am able to reproduce your issue, so I will look into it further and get back to you. 

      In the meantime, I can offer some alternative solutions. You can try to use the process shown in this article FDE: Importing your own field profile to the deck (d-card) – Ansys Optics to export and import individual fields as .fld (not .ldf). You can also try zbf format as shown here: ZBF Import\Export – Ansys Optics.

      Your ultimate goal is to calculate the overlap, correct? Another possibility is to manually calculate the overlap from script variables (thereby avoiding the use of d-cards). Please see this article for an explanation of the overlap calculation: overlap - Script command – Ansys Optics. If you can obtain the fields (Ex, Ey, Ez, Hx, Hy, Hz) from your monitor (here called 'Exm', 'Hxm', etc) and from your saved data (here called 'Exs', 'Hxs', etc), then you can manually calculate the overlap with this script. Please give it a try and let me know if it works for you.

      Pm=pinch(Exm*conj(Hym)-Eym*conj(Hxm)); #

      Pmi=integrate(Pm,1:2,x,y);



      Ps=pinch(Exs*conj(Hys)-Eys*conj(Hxs)); #

      Psi=integrate(Ps,1:2,x,y);




      nx=length(x);

      ny=length(y);

      Pms=zeros(nx,ny);

      Psm=Pms;




      Pms(1:nx,1:ny) = pinch(Exm(:,:))*conj(pinch(Hys(:,:)))-pinch(Eym(:,:))*conj(pinch(Hxs(:,:))); #

      Psm(1:nx,1:ny) = pinch(Exs(:,:))*conj(pinch(Hym(:,:)))-pinch(Eys(:,:))*conj(pinch(Hxm(:,:))); #



      Pmsi=integrate(Pms,1:2,x,y);

      Psmi=integrate(Psm,1:2,x,y);

      out=abs(real(Pmsi*Psmi/Pmi)/(real(Psi))); # Calculated overlap
      • zhang23
        Subscriber

        Thank you very much for your response! I have tried all three methods. Unfortunately, the first two methods still result in the same issue as before, where clicking "Calculate Overlap" yields no response. However, with the third method, after adjusting the code, I obtained a result of 0.32, which seems relatively low. I'm not sure if this is due to the misalignment of the two waveguides, but I believe the misalignment should not affect this result. If you have resolved the issue I mentioned earlier, I would greatly appreciate your guidance. Thank you once again!

    • anna.wirth-singh
      Ansys Employee

      Hello,

      Thank you for your reply. I have looked into the issue further, and I think you need to manually add the desired d-cards to the DECK (right click in the Mode list and "add selected modes to the global deck") prior to using savedcard in order to save all the mode data. In the screenshot below, I added modes 1 and 2 to the deck as shown. If I then save and re-load the data using savedcard() and loaddata(), I do see all modes populate the list, but only global_mode1 and global_mode2 are available for overlap calculations. Please try manually adding the desired modes to the deck and then saving to use the savedcard method. 

      For the script I sent, one possible explanation for the error could be that the data sampling or span in x and y is different for the two modes. The list of coordinates x and y should be the same for all the fields involved in the calculation. Another possibility is the orientation of the fields - this script was written for a waveguide propagating along the z axis. If your structure is oriented differently, the calculation would need to be rotated. Please let me know if these can explain your results. 

      Finally, I want to let you know that an update to the overlap overlap - Script command – Ansys Optics function is in progress (planned for release in 2025 R1) so that the function accepts datasets in addition to d-cards. This will provide additional functionality and will make it much easier to create, save, and load fields to perform overlap calculations. This update will likely be useful for you, but in the meantime I would suggest trying to troubleshoot the script to manually calculate the overlap. 

      • zhang23
        Subscriber

        Thank you very much for your guidance^-^. All of my issues have been fully resolved! I wish you success in your work and happiness in your life. I look forward to the release of the next version.

    • anna.wirth-singh
      Ansys Employee

      Thank you very much for letting me know the issues are resolved and for your kind words. Best wishes for your work as well!

Viewing 5 reply threads
  • You must be logged in to reply to this topic.