Please enable JavaScript to view this site.

Knowledge Base

Navigation: DEVICE > Data Transfer and Interoperability > Interoperability

Python API

We've made some changes. Use 'Ctrl-F5' to clear your browser cache.
Scroll Prev Top Next More

This example demonstrates the feasibility of integrating Lumerical tools with Python. This interoperability is made possible using Application Programming Interface (API). Users will learn how to write a simple Python script and use some automation API functions to drive Lumerical simulations and data processing. There are two parts in this example:

1. driving Lumerical simulations wihtin Python,

2. producing figures in Python, e.g., PNG format.

 

Solvers

FDTD

(It also supports other solvers in MODE Solutions, DEVICE and INTERCONNECT)

Associated files

pyapi_example.py

See also

Setting up Python API

Python API functions

Interoperability between Lumerical Products

Matlab API

Parameter Sweep

Requirements

Lumerical products R2019a or newer

 

 

 

Note:

The example files were created using Lumerical 2019a, Python 3.7 (and numpy), matplotlib 0.99.1.1, scipy 1.1.0 (interpolate), collections 1.0.1 (OrderedDict) and CentOS 6.8 (Final)

 

Note: working directory

It should be possible to store the files in any locations as desired. However, it is recommended to put the Lumerical and Python files in the same folder in order for the above script files to work properly. It is also important to check the Lumerical working directory has the correct path to run the .lsf script file, see here for instructions to change the Lumerical working directory.

 

A lumapi.py file  is the key to enable Lumerical-Python API connection. Once the lumapi module is imported to Python, the integration should be ready.  See this page for instructions for setting up Python API.

Session management

Advanced session management

Lumerical Script Commands as Python Session Methods

Driving Lumerical Tools within Python

Copyright Lumerical Inc. | Privacy | Site Map