Creating a new IPKISS design project¶
PyCharm has a built-in project manager. We use it to create IPKISS design projects.
When this is the first time opening PyCharm, you will be greeted with this window:
When you are in the main PyCharm window, select Create:
In the “Create Project window”, choose a new folder for your new design, then choose “existing interpreter”:
There are two situations now (also shown in the image above):
- If you have already set up an IPKISS Python interpreter before, you may find it in the list of interpreters. In that case, you can proceed to the section below on adding a PDK to the project.
- The ipkiss interpreter is not shown in the list of existing interpreters. In that case, click ‘…’ and follow the instructions below.
Clicking ‘…’ will open a new menu where you can select the Python interpreter:
Next, select the Python interpreter to use:
After choosing the interpreter, it will be visible in the list as shown below. You can select “Make available for all projects”, so the interpreter is stored for future design projects.
After the main PyCharm window opens, let’s add a PDK to the project.
You can also open an existing folder or project (
.idea folder is created which stores project settings. If you open the same folder at a later moment,
the project settings are remembered.
Adding a PDK to your project¶
To add a PDK to the project, we need to add the folder to this project and ensure Python can find it. We illustrate this for demolib, which is a PDK shipped with the software, but the principle for setting up a PDK is the same for each PDK supported by Luceda.
Go to. Then, in the side pane, choose Project: <Your project name>. Then select Project Structure section, then click on . Then select the PDK folder. For this tutorial we use demolib, which is located under the user home folder:
ipkiss32 is the ipkiss version, please replace with the version you’re using)
Next, we have to ensure Python recognizes the PDK. To do this, we need to configure the PYTHONPATH
(this is where Python searches for packages & modules). More specifically, the ipkiss folder inside the PDK has to be
marked as Source root. We import PDK (technology) and library devices like the way we import Python pacakges & modules,
from demolib import technology and
from demolib import all.
So make sure there is a
technology module and an
all.py file in the PDK directory that you have made as Source root.
We select the ipkiss folder, then click the Sources button, as shown below:
Most PDKs have examples stored in them, so let’s run a sample to verify that everything is set up properly:
demolib/samples/simulation/mzi_lattice/mzi_lattice.py. Next, right click somewhere in the file
itself and choose :
Once finished, you should see the simulation result of the MZI lattice (note that the transmission may vary between successive runs due to phase errors in the waveguide):
Most PDKs have samples stored in this folder:
Additional user libraries¶
You can also reuse libraries that were created earlier. To illustrate this, we will also add a custom design library that we’d like to reference in our current design project. In the sample project, there is a library called my_library that we’ll use for this purpose.
Similar to how we added the PDK, we can now add
<path_to_IPKISS_installation>\demo\built_libraries\my_library to the project.
To test everything, we can make a small file:
from demolib import all as demo from my_library import all as my_lib splitter = my_lib.SPLITTERWAYPOINT_1500() lay = splitter.Layout() lay.visualize()
You may refer to Library Organization in the documentation to find out more explanations on the library structure and its content.