This "My first INTERCONNECT CML" section provides a step-by-step guide for how to create a custom compact model library using your own data and the Lumfoundry Template.
Here we assume you have completed:
After completing this section, please see:
For more information on Lumfoundry templates please, see Lumfoundry Template Directory.
In this example, we are going to create a compact model library for 'Foundry_X' that contains two elements directly from the Lumfoundry Template ('wg_strip_straight_c' and 'gc_strip_te_c') and one new element 'wg_straight_fixed' which is a straight waveguide with a fixed length of 1 mm.
Step 0 - Prepare the Foundry Directory
The foundry directory is the workspace that is used alongside CML Compiler to create a compact model library. Deploy 'lumfoundry_template' and rename the foundry as ’Foundry_X’ in a desired destination folder as shown below.
Remove all elements from the list except wg_strip_straight_c' and 'gc_strip_te_c'. This can be done by choosing ‘select all’ and unselecting ‘wg_strip_straight_c’ and ‘gc_strip_te_c’ elements from the list of elements. On clicking the ‘Delete’ button, the user has the option to delete all the selected elements from the library master file and the element’s source files/folders by enabling the option as shown below.
[[Note:]] We recommend always starting with a copy of the Lumfoundry Template .
Step 1 - Pick a Template
The Lumfoundry Template directory offers multiple source files and model data templates that can be edited to create model data for any supported photonic element.
The custom element that we are going to create in this example is a straight waveguide. Since the model is going to be parametrized by length and no other geometry dependent parameters, we'll choose the 'wg_strip_straight_c' element in Lumfoundry Template as our reference. A description of the data for this model can be found at Waveguide Straight (Fixed).
Note that in the list of available templates we can see that we have the choice between a straight, arc, and s-bend shaped waveguide. We could have used the guide Choosing a Template to select our template.
Step 2 - Update the Template
Step 2a – Adding an element
A chosen template can be used to create a new element that can be added to the library master file. This can be done by clicking on ‘Add’ button in the GUI as shown below. In ’Adding element’ pop-up window, Lumfoundry template is chosen as ”wg_strip_straight_c“ and the new element’s name is set to ”wg_straight_fixed”.
After adding the new element to the list, click on ‘Launch Explorer’ button ,go inside the "source/wg_straight_fixed" folder to see the following files inside:
- wg_straight_fixed.json
- wg_straight_fixed.svg
[[Note]]: The Photonic Models section contains an article for every photonic model available within CML Compiler. Each article begins with a brief description of what the photonic model is suited for, and some articles contain detailed descriptions of how the photonic model is used (for advanced users). |
Step 2b - Update the source data file
Open up 'wg_straight_fixed.json' using your favorite json editor (We recommend opening it up with any Lumerical product by simply dragging and dropping the file or “jsonload” command and save the file after the changes using “jsonsave” command).This file contains different sections which provide CML Compiler with required data to create and configure the compact model for this element.
First, we need to update the description in “general” section to match our plan. And additionally, we can update the notes to inform the end-user about the fixed length of the waveguide. Notes can be added by including another entry in the 'notes' cell array.
"general" :
{
"description" : "Foundry straight waveguide with 1mm length",
"prefix" : "WG",
"notes" :
{
"_data" :
[
{
"property" : "wavelength_range",
"value" : "C-band (1530 - 1565 nm)"
},
{
"property" : "temperature_range",
"value" : "Best accuracy between 273 and 373 K"
},
{
"property" : "waveguide_length ",
"value" :"Fixed length of 1mm"
}
],
"_type" : "cell"
}
},
Then, we can change the port names by altering the “name” fields for “opt_1” and “opt_2” entries in the “ports” section. Change them from "opt_1" and "opt_2" to "port_1" and "port_2":
"ports" :
{
"opt_1" :
{
"name" : "port_1",
"dir" : "Bidirectional",
"loc" : 0.5,
"pos" : "Left",
"order":1
},
"opt_2" :
{
"name" : "port_2",
"dir" : "Bidirectional",
"loc" : 0.5,
"pos" : "Right",
"order":2
}
},
Now, we should update some of the model's behavior. For our model, we want to fix the waveguide length, so we need to make the wg_length parameter invisible to the end user. This can be done by setting the 'visible_to_user' value of the “wg_length” parameter to falsein the “parameters” section, as shown below:
"parameters" :
{
"wg_length":
{
"name" : "wg_length",
"min" : 0,
"max" : 1.0,
"unit" : "um",
"default" : 1e-5,
"visible_to_user" : 0,
"annotate" : 0
},
…
}
So far, we've updated how the element will be displayed to the end-user. However, currently the element's data sets the default waveguide length to 10μm, which is not the 1mm length that we want. To make this change, we need to modify the “default” value of the “wg_length” parameter as below:
"parameters" :
{
"wg_length":
{
"name" : "wg_length",
"min" : 0,
"max" : 1.0,
"unit" : "um",
"default" : 1e-3,
"visible_to_user" : 0,
"annotate" : 0
},
…
}
This will ensure that the default waveguide length is 1mm in the final compact model. Please note that the value provided in the "default" field should be in SI unit and in this case is in meters.
There are many other variables within the source file which are used by the waveguide_simple photonic for different parts of the model's behaviorand includes QA settings required by QA scripts automatically generated by CMLC. For now, we will leave these untouched and just save the file. A full description of all the variables in this data file can be found at Waveguide Straight (Fixed).
Note: If you'd like to work with the Lumerical products ( e.g. INTERCONNECT) to make changes to the .json source files, the steps below show an example to modify the default wg_length using scripting: In the INTERCONNECT script prompt, run the following commands: clear; This will load the element's data file into the INTERCONNECT workspace. The reason we used the clear command before loading the data was to ensure that we don't save any extraneous data in the final file. To change the default waveguide length, and save our changes, we run the following: parameters.wg_length.default = 1e-3; |
Step 3 - (Optional) Add User-Created Elements
You can include models that are not generated by the CML Compiler in the packaged library. Copy all the .ice files for these user-created elements into the 'Foundry_X/source/user_created' folder. CML Compiler will check this folder and any subfolder inside it when running. All the user-created elements will be added to the compact model library.
Step 4 - Run CML Compiler
Select all the elements to build from the elements list and click ‘Build Tests + Prev Steps’ button in the GUI to build the compact model library and the associated INTERCONNECT QA testbench for the elements as shown below.
Once CML Compiler is done running, open a new session of INTERCONNECT using the ‘Launch INTC’ button and check the newly created and installed compact model library. It should contain three elements including the custom 'wg_straight_fixed' element we created in step 2a as shown below.
For information on running QA tests on the created library please see Running QA Tests.