Please enable JavaScript to view this site.

Application Gallery

Navigation: » No topics above this level «

Y Branch Particle Swarm Optimization

Welcome to the new Application Gallery. Watch the 1min introductory video.
Scroll Prev Top Next More

cover_picture_y_branch_pso_zoom33Component optimization is a key step of any design process striving to develop high-performance photonic devices. This silicon on insulator Y-branch example demonstrates a general component shape parametrization method that is suitable for an arbitrary optimization routine. The algorithm in this example is Lumerical’s built in particle swarm optimization (PSO) that offers an easy setup via user interface. Furthermore, the proposed optimization process showcases how to combine varFDTD with fully 3D FDTD solver to significantly reduce optimization time while maintaining high accuracy.

Related: Y Branch

Files and Required Solvers




Run and results

Important model settings

Updating the model with your parameters

Taking the model further

Additional resources


Understand the simulation workflow and key results


Component optimization workflow can be successfully generalized into three major steps - model parametrization, optimization and verification. Optimization algorithm typically requires running your simulation many times to uncover trends and find the best parameters. Moreover, the number of required simulations grows with the number of optimized parameters. Therefore, it is often recommended to start with a simple model and iterate through the workflow multiple times while adding complexity to fine tune the performance.

Step 1: Model Parametrization

Parametrizing the component model is arguably the most time-consuming step that directly impacts the probability that the optimization algorithm finds the optimal solution. Hence, it is well worth the effort to diligently analyze which model properties have the largest impact on the figure of merit(FOM) and find an efficient way to control them via small number of scalar parameters.

In the Y-branch example, we can influence the component performance only through the splitter wall shape in y direction because the material and layer thickness are locked by the manufacturing process. The implemented model uses 13 width points spaced equally along x axis to define the splitter shape via spline function. This approach allows to fully control the shape with limited number of scalar values while providing a guarantee that there will be no step changes in the wall shape.

Step 2: Optimization

Lumerical’s built-in stochastic PSO offers a convenient way to implement an optimization algorithm through GUI. The main PSO requirement is the ability to provide the FOM and model parameters as a result or a property of an arbitrary object in the object tree. In this example we specifically define:

Figure of merit: A model analysis script is used to calculate insertion loss based on the net transmission in the output branches and is set as a model result.

Model parameters: Thirteen width parameters are specified as user properties of a structure group named “splitter”.

Running the optimization will return set of width parameters defining Y-branch shape for the best insertion loss.

Step 3: Verification

Since optimization simulations often aim to find a good tradeoff between accuracy and computation time, it is necessary to conduct convergence testing using the best parameters to verify the component’s performance.

In this example, we accomplish this by optimizing the component in varFDTD solver that offers considerably reduced simulation time with only small sacrifice in accuracy. The optimized design is then verified by exporting the Y-branch shape from varFDTD via GDS file and re-running the simulation in fully 3D FDTD solver.

Run and results

Instructions for running the model and discussion of key results

Step 1: Parametrize model

The first step of this example walks you through a provided parametrized Y-branch model. The main goal of this step is to reinforce the main concepts behind model parametrization and provide a benchmark value in form of an unoptimized figure of merit.  

1.        Open Y_branch_PSO.lms, right-click on “splitter” structure group and select “properties” from the menu

2.        Assign scalar values to the w1 - w13 parameters defining the splitter’s width as function of x coordinates. Use your best guess or leave the default unoptimized values.

3.        Run the simulation

4.        Note the insertion loss of the an unoptimized Y-branch by right-clicking on the “model” and selecting “Visualize” - > “insertion_loss”

5.        Switch to layout



After running the varFDTD simulation, we are able to record an unoptimized insertion loss of 1.26 dB.

Step 2: Run the optimization

1.        Select the “optimization” within the “Optimizations and sweeps” tab and click on the edit button

2.        Verify that the w1 - w13 parameters are set as optimization parameters and the calculated insertion loss is set as figure of merit. The optimization must be set to minimize the FOM.

3.        Run the optimization until insertion loss reaches value below 0.2 dB

4.        Load the optimized parameter values to your model by running Y_branch_apply_optimized_parameters.lsf.

 Note: If you do not wish to run the optimization, change the param_source  value on line 7 to 2. The model will apply parameter values from the reference paper.

5.        Run Y_branch_GDS_auto_export.lsf to export optimized Y junction structure into a GDSII file



After running the optimization routine, we achieved an optimized insertion loss of 0.11 dB within 30 generations, which is below the target value of 0.2dB and a considerable improvement from the unoptimized insertion loss of 1.26dB recorded in step 1. The following figures show the Y-branch profile development during the optimization and FOM as a function of generation number. It is worth to notice that the sub 0.2dB insertion loss is achieved within first ten generations and further optimization provides only marginal improvements. Combining with the speed of varFDTD solver, we were able to achieve sub 0.2dB insertion loss under 10 minutes of simulation time on an average office desktop computer.

y_branch_optim_development_zoom30 fom_development_zoom70


Y-branch shape comparison between the unoptimized reference shape(left) and optimized shape(right) with insertion loss 1.26 and 0.1 dB respectively:


Step 3: Verify results in FDTD Solutions

1.        Open Y_branch_PSO_3D_verification.fsp in FDTD Solutions

2.        Open and run script Y_branch_PSO_GDS_import.lsf to import the optimized Y-branch shape from the GDS file created in step 2.

3.        Run the FDTD simulation

4.        Get the final insertion loss from model results



The final FDTD simulation returns 0.19dB insertion loss, which satisfies our goal of finding a Y-branch shape with sub 0.2dB insertion loss. The difference between 2.5D varFDTD and fully 3D FDTD solver is expected due to the simplifications introduced by varFDTD, namely by collapsing the index profile in z direction. The results are close to each other and the final 3D simulation provides welcome confidence boost for our optimization results. We recommend visiting Lumerical’s varFDTD100 course to better understand when varFDTD solver should be used and how to conduct convergence testing to achive better accuracy. The link is provided in “additional resources” section.

Important model settings

Description of important objects and settings used in this model

Defining component shape with spline function

One of the challenges when optimizing a component shape is the virtually unlimited number of distinct shape combinations when we imagine each mesh cell as a binary variable(Si material present yes/no). To overcome this problem, we need to find a way to define the shape via relatively small number of variables. Moreover, it is desired that shape is smoothly varying and avoids step changes. One of the more obvious solutions to this problem is to define a limited combination of points on xy plane and interpolate them via polynomial function.


The Y-branch splitter is using Lumerical’s built in spline function to accomplish this. The input into this function is the thirteen width points (w1-w13) defining the y span of the splitter and the cubic spline then interpolates all the remaining points across the entire x span, effectively defining the shape of the splitter’s wall.

Passing the parameters to optimization routine

Once the model parameters are defined, they need to be exposed as an object property. This allows an external algorithm such as optimization or sweep to modify the parameters and effectively change the simulation setup. Model and structure group objects are particularly useful for this purpose. They allow users to define user properties that serve as input variables in a custom setup script that controls the simulation.

In this case, we defined w1 - w13 as user property of a structure group named “splitter”. These variables are then used in the structure group’s setup script that passes them into the spline function, defining the shape of the polygon object acting as the body of the Y-branch. These properties can be then controlled by PSO or any other external algorithm.


Insertion loss as figure of merit:

The ultimate objective of a passive Y-branch is to split the input with minimal losses. This property can be well defined by insertion loss. In practical terms, we also want to capture this property in broadband terms of 1550nm +/-50nm. Furthermore, PIC designers would be typically interested only in how much light is transmitted into the fundamental mode. To accommodate these requirements, we calculate the insertion loss as:

$$IL = -10 log_{10}( mean(T_{net}))$$

where Tnet is the net transmission into the fundamental mode of the output waveguides. Since Tnet is captured at multiple frequency points, we calculate the mean transmission to obtain average insertion loss across the specified band. This calculation is completed in the model analysis script and passed to the results. This allows the optimization routine to use the calculated value as a figure of merit.



The model and simulation fields are symmetric in y direction. This fact allows us to use symmetric boundary condition and reduce simulation time by 50 percent. One implication of this approach is that we use only one output port instead of two. As a result, the transmission returned by port #2 must be multiplied by 2 when calculating the insertion loss to account for the “missing” port #3.

Updating the model with your parameters

Instructions for updating the model based on your device parameters

Choose material of your choice to replace the default silicon.

Add a top layer material to bury the silicon Y-branch structure. The default simulation places the silicon on insulator(SiO2) with air as the top layer(n=1). You can add a top layer of SiO2 by modifying the substrate z span and overriding the mesh order.  In this scenario, make sure to change both *.lms and *.fsp files. You might also need to increase the number of generations in the optimization settings if you do not obtain satisfactory results with the default value.

Add a new parameter to the optimization routine. As an example, length of the splitter object can be added as an additional optimization parameter. In this case, it is important to pay attention to the dependencies in your simulation. If the splitter length is modified, the position of the input and output waveguides must be changed accordingly. Similarly, large changes in the waveguide positions might require adjusting the simulation regions span during your optimization run. All these dependencies should be addressed in your custom structure group or model setup script.

Create a new optimization project. The general steps described in this example can be extended to variety of components as long as you are able to parametrize your model and calculate a single figure of merit. Note that if you only have a small number of parameters to optimize, parameter sweeps may be more efficient than optimization. For example, if you wish to find best waveguide width to find maximum effective index, sweeping range of values will be likely faster than stochastic optimization.

Taking the model further

Information and tips for users that want to further customize the model

Set up additional local or cloud resources. Running optimization can be very demanding on computational resources. Fortunately, it is also highly suitable for distributed computing. You can simply add multiple computers via the in-product resource manager or leverage cloud computing capabilities. Find a link to our cloud computing webinar video in additional resources.

Use Matlab and Python API to implement external optimization algorithms. The built-in PSO is user friendly, but if you wish to take your optimization further by adding constraints, using multiple FOM’s or prefer different algorithm, you can do so from Matlab or Python via Lumerical’s API. Thanks to having the model parameters and FOM defined as an object properties and results respectively, the implementation via API is as easy as using a single command to setup the parameters and receive back a calculated variable.

Extract S-parameters from the optimized Y-branch for further system level simulations in Interconnect. This process is described in detail in the related Y-branch example.

Additional resources

Additional documentation, examples and training material

Related publication: Zhang et al., A compact and low loss Y-junction for submicron silicon waveguide (2013 Optical Society of America)

Spline function

Particle Swarm Optimization

GDS Export and Import

Python API optimization webcast

Cloud computing webinar

Related Lumerical university courses:

Course_FDTD100 Course_varFDTD100_2 Course_SCRIPTING_v1


Copyright Lumerical Inc. | Privacy | Site Map