Photonics

Photonics

Topics related to Lumerical and more.

Help for qINTERCONNECT

    • venuskd
      Subscriber
      I am trying to simulate the Hong-Ou-Mandel effect, and for that, I need qINTERCONNECT. I used the following code in Python:
       
      import sys
      sys.path.append(r"C:\Program Files\Lumerical\v241\api\python")
       
      import qinterconnect
      from qinterconnect.solver import QSolver
      from matplotlib import pyplot as plt
      import numpy as np
       
       
      But I get this error :  ModuleNotFoundError: No module named 'qinterconnect.solver'
       

      I have attached a screenshot from the Program Files Lumerical folder, which shows that it seems Python API module for qINTERCONNECT is installed. However, it does not appear to contain any solver, such as QSolver, so I am unsure if this error is related to that.

               

      Additionally, I have attached a screenshot from the Ansys Lumerical Launcher, which shows that I have access to qINTERCONNECT. However, when I try to open this solver, I only see a command window instead of a specific interface GUI, like with the other solvers. I have attached this screenshot as well.

      I would appreciate it if you could let me know how I can resolve this issue.

       

      In the meantime, I tried using INTERCONNECT to simulate the Hong-Ou-Mandel effect, but it seems unable to solve it and returns values in the classic view. Although I used an attenuator with -80 dB, I still could not observe the Hong-Ou-Mandel effect in the output.

      I have attached my setup screenshot in interconnect, I used optical oscilloscopes in both outputs and also tried optical power meters in both outputs. I see the same result from both outputs and I could not observe the HOM effect.
       
    • Dev
      Ansys Employee

       

       

      Hello venuskd, 

      Thanks for using Ansys learning forum. 

      Can you please confim you have q-interconnect license. Its a seperate licese from interconnect. I want to make sure its not a licensing issue. 

      Looking forward for your response. 

      Best regards

       

       

       

       

    • venuskd
      Subscriber

      Hello Devika,

      Thank you for your consideration. Would you be able to guide me on how I might verify if I have a license for this specific module?

      Bests,
      Venus

       

    • venuskd
      Subscriber

      Hello Devika,

       

      As far as I know, we have a QINTERCONNECT license as well. However, I’m not sure what steps I should take to resolve this issue. Could you confirm if QINTERCONNECT should have an interface similar to INTERCONNECT? When I try to access QINTERCONNECT, I see the 'command prompt' window shown below:

      So I am not sure, should I type anything to access this qinterconnetc interface? , and also what it should be look like? 

      I am looking forward to hearing from you.

      Bests,
      Venus

    • Lito
      Ansys Employee

      Hi Venus, 

      From our qINTERCONNECT User Guide – Ansys Optics (KB):

      The qINTERCONNECT solver is a Python module that can be called from within the INTERCONNECT scripting environment or from Python environment

      Please find the following articles in Ansys Optics KB for qINTERCONNECT. 

    • venuskd
      Subscriber

      Hi Lito,

      According to the "qINTERCONNECT User Guide-Ansys Optics" , it mentions that you should "verify that the version of Python being used is the packaged version." However, I’m unsure what this means in practice. I am connecting to Lumerical via the Python API using the following code:

      import sys
      sys.path.append("C:\\Program Files\\Lumerical\\v242\\api\\python\\")


      And then I use below code :


      from qinterconnect.solver import QSolver

      To connect to QSolver, but I see this error below:

      ModuleNotFoundError: No module named 'qinterconnect.solver'

      I'm unsure how to resolve this issue.

       

      I’ve already reinstalled the latest versions of Lumerical and QINTERCONNECT, but the issue persists.

       

      In the meantime, I would appreciate it if you could share any webinars or YouTube links that might help me understand the steps to run examples, such as those in this "Link."

       

      Bests,
      Venus

    • Lito
      Ansys Employee

      Make sure that the Lumerical install & API path is in set in your environment. 

      <<Create or modify environment variables in Windows – Ansys Optics>>

    • venuskd
      Subscriber

      I have added the api/pyhton to the user variables as below:

      C:\Program Files\Lumerical\v242\api\python

       

      Should I add any thing else?

       

      With this modification, still I see the same error!

      Bests,
      Venus

    • Lito
      Ansys Employee

      Did you download and install the qINTERCONNECT package from the Ansys Customer Portal? 

      qINTERCONNECT installation guide – Ansys Optics 

    • venuskd
      Subscriber

      I did this as well: I added it to user variables,

       

      C:\Program Files\Lumerical\v242

       


      But with this belowe code :

      import sys
      sys.path.append("C:\\Program Files\\Lumerical\\v242\\api\\python\\") 

      from qinterconnect.solver import QSolver

       

      I again face this :  ModuleNotFoundError: No module named 'qinterconnect.solver'

       

       

    • venuskd
      Subscriber

      Yes I have download and install the qINTERCONNECT package from the Ansys Customer Portal, and that is why I installed new version of Lumerical, previously I had v241, it was not compatible so I installed v242 to solve this problem. 

    • Lito
      Ansys Employee

      Did you download and install the qINTERCONNECT installer/package from the Ansys customer portal downloads page?  <<qINTERCONNECT installation guide – Ansys Optics >>

      The Lumerical install and API path are: 

      C:\Program Files\Lumerical\v242\bin
      C:\Program Files\Lumerical\v242\api\python
    • venuskd
      Subscriber

       

       

      Yes, as I mentioend I downloaded the qINTERCONNECT installer/package from the Ansys customer portal downloads page.

       

      And yes, the Lumerical and API path are, which I added them to use variables as well. 

       

      C:\Program Files\Lumerical\v242\bin
      C:\Program Files\Lumerical\v242\api\python

       

      I have used so far, for FDTD simulation with no issue.

       
    • Lito
      Ansys Employee

      Try to follow the steps in the getting started guide >Getting started with qINTERCONNECT – Ansys Optics

      1. Download the example from >Non-Linear Sign (NLS) Gate – Ansys Optics. 
      2. Open INTERCONNECT CAD/GUI
      3. Open and run the script, NLS_ideal.py. 
      4. Send a screenshot of the error message if any. 

      If you are running directly from a Windows command prompt/Python Editor, follow the steps here. 

       

       

      • venuskd
        Subscriber

        The first and last links do not open!

         

        I see this:

        You're not authorized to access this page

        - Access to this page may require support registration

        - Access to this page may require a specific license (e.g. CML Compiler docs require a CML Compiler license)

         

    • venuskd
      Subscriber

      If you mean :

      C:\Program Files\Lumerical\v242\bin

      C:\Program Files\Lumerical\v242


      With bin and without bin,I tried both , the error is still there!

    • Lito
      Ansys Employee

      Running qINTERCONNECT from INTERCONNECT platform

      1. Download NLS_ideal.py and NLS_ideal.icp from Non-Linear Sign (NLS) Gate – Ansys Optics 
      2. Start the Optics Launcher 
      3. Click New Project from the INTERCONNECT Photonic Integrated Circuit Solver line.Picture9.png
      4. Open the Script File Editor 
      5. Click Open script then browse to NLS_ideal.py, or simply drag and drop the python file in the editor.  
      6. Click Run script.

      Picture8.png

           7. A command prompt window shows the calculation of a qubit gate with probability rate of 25% using only classical gates.

    • Lito
      Ansys Employee

      Make sure that the Python Integration Status is using our bundled Python. 


    • venuskd
      Subscriber

      I did all steps,

      Although, I did not face python integration configuration.

       

      And this is the result:

      --------------------------------------------------------------------------------------------------------------------

      So it seems I have access via Interconnect, but directly from python it does not work.

      I am using Spyder to run my codes, as I mentioend earlier I did FDTD simulartions via python API, and it worked with no issue! but I do not know why for qInterconnect I see this: ModuleNotFoundError: No module named 'qinterconnect.solver'

       

       

       

    • Lito
      Ansys Employee

      The qINTERCONNECT modules are installed into the Lumerical installation. You will have to use the Python that is bundled with Lumerical. Also the Lumerical Python API install path should be in the PYTHONPATH not in the PATH. See below: 

      PATH=C:\Program Files\Lumerical\v242\bin;C:\Program Files\Lumerical\v242\Python
      PYTHONPATH=C:\Program Files\Lumerical\v242\api\python

      e.g. Run the qINTERCONNECT script using our bundled Python, 

      "C:\Program Files\Lumerical\v242\Python\python.exe"  NLS_ideal.py

      I will check with the team which modules needs to be installed or used when you are running your own Python installation. 

      • venuskd
        Subscriber

        I opened the NLS_ideal.py script using the 'Open Script' option and ran the code directly. It worked without any issues, so I am unsure what needs to be changed. Could you please clarify what the problem might be with this approach?

         

        My main issue is this: how I can run the code in Spyder I mean (via external Python environment) not only from Interconncet bundled script ?

         

        Additionally, I have another question. May I ask how I can view the circuit in a graphical interface? I noticed in the provided Link that a circuit is generated. However, after running all three codes in INTERCONNECT, I do not see a similar circuit. Could you please guide me on how to achieve this?

    • Lito
      Ansys Employee

      From the KB >>Getting started with qINTERCONNECT – Ansys Optics, When running outside of the CAD/IDE, you will have to use the Python that we bundle. 

      Let me check with the team if qinterconnect can be run using your own installation of Python. 

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