2.2. Design variations and hierarchical layout

The next step is to use the MZI PCell defined in the previous section to create a sweep of MZIs with different length of the right arm. Also for this case we will use CircuitCell, so that we can easily simulate each MZI that is part of our design to check their behaviour.

Mach-Zehnder interferometer

When submitting designs to a foundry, more often than not you are allowed limited space to fit your designs. To make sure that the design is not bigger than the allowed area, it is useful to use a frame. The IPKISS PDK for SiEPIC contains a PCell called FloorPlan, which can be used exactly for this purpose. The height and width of this PCell can be adjusted according to your requirements. In this tutorial, we are going to use the floorplan to make sure the three MZIs don’t exceed our design area.

Let’s now have a look at how we can define design variations using IPKISS. Open the file “design_variations.py” in your PyCharm project, so that you can follow along the explanation.

2.2.1. Parameters for the MZI sweep

First of all, we define the parameters that we will use for the MZI sweep. We want to design three different MZIs. The right arm of each MZI will pass through a different coordinate in order to control its length. We provide this coordinate to the MZI PCell using the control_points property.

The following parameters are defined at the beginning of the file:

  • control_points: A list of coordinates [(x1, y1), (x2, y2), (x3, y3)] that will be used to instantiate the MZI PCells of the three MZIs we want to design.
  • bend_radius: The waveguide bend radius we will use for our designs.
  • x0 and y0: The x- and y-coordinates where we will place the bottom right fiber coupler of the first MZI. They are defined to be a bit distant from the origin because the bottom left corner of the floorplan will be placed at the origin.
  • spacing_x: The horizontal spacing between the fiber grating couplers of the three MZIs.

After defining these parameters, we create an empty child_cells dictionary and an empty place_specs lists. We will add to them all the child cells and the placement specifications that we need to provide to CircuitCell to create our final design.

Listing 2.14 luceda-academy/training/topical_training/siepic_mzi_dc_sweep/design_variations.py
# Parameters for the MZI sweep
control_points = [(70.0, 230.0), (100.0, 230.0), (150.0, 230.0)]
bend_radius = 5.0
x0 = 40.0
y0 = 20.0
spacing_x = 180.0

child_cells = dict()
place_specs = []

2.2.2. Floorplan

Before designing the MZIs, it is good to have clear what are the boundaries for our design. We instantiate the floorplan from the IPKISS PDK for SiEPIC, we add it to the child cells and we place the bottom left corner at the origin.

Listing 2.15 luceda-academy/training/topical_training/siepic_mzi_dc_sweep/design_variations.py
# Create the floorplan
floorplan = pdk.FloorPlan(name="FLOORPLAN", size=(605.0, 410.0))

# Add the floorplan to the child cells and place it at (0.0, 0.0)
child_cells["floorplan"] = floorplan
place_specs.append(i3.Place("floorplan", (0.0, 0.0)))

2.2.3. MZI sweep

To create the MZI sweep, we use a practical for-loop over the list of control points. Each time, we instantiate an MZI with the correct control point, we add this instance to the dictionary of child cells and we place it at coordinates (x0, y0). For the first MZI, these are the coordinates we defined in the initial parameters. For each following MZI, the value of x0 is increased by the value in spacing_x.

For our own reference, after each MZI is instantiated, we calculate the delay length between the two arms of the MZI and print it.

Very important! Each time we instantiate an MZI, we have to assign a unique name. Otherwise, the tree instantiated MZIs will be an exact copy of each other and changing the design of one of them will result in a change in all of them. To make sure the names are all different, we use the for-loop counter ind to call them MZI0, MZI1, MZI2.

Listing 2.16 luceda-academy/training/topical_training/siepic_mzi_dc_sweep/design_variations.py
# Create the MZI sweep
for ind, cp in enumerate(control_points):
    mzi = MZI(

    # Calculate the actual delay length and print the results
    right_arm_length = mzi.get_connector_instances()[1].reference.trace_length()
    left_arm_length = mzi.get_connector_instances()[0].reference.trace_length()
    delay_length = right_arm_length - left_arm_length

        "Delay length = {} um".format(delay_length),
        "Control point = {}".format(cp)

    mzi_cell_name = "mzi{}".format(ind)
    child_cells[mzi_cell_name] = mzi
    place_specs.append(i3.Place(mzi_cell_name, (x0, y0)))

    x0 += spacing_x

2.2.4. Final design

We are now ready to create the final design using CircuitCell. All the heavy work is done, we only need to instantiate a circuit cell which contains the child cells and the placement specifications that we carefully defined before.

Listing 2.17 luceda-academy/training/topical_training/siepic_mzi_dc_sweep/design_variations.py
# Create the final design with circuit cell
cell = CircuitCell(

2.2.5. Layout and circuit simulation

We can now instantiate the layout and save it to gds:

Listing 2.18 luceda-academy/training/topical_training/siepic_mzi_dc_sweep/design_variations.py
# Layout
cell_lv = cell.Layout()

Mach-Zehnder interferometer

Next, we can extract the S-matrix and plot the results of the circuit simulation to visualize the behaviour of our MZIs:

Listing 2.19 luceda-academy/training/topical_training/siepic_mzi_dc_sweep/design_variations.py
# Circuit model
cell_cm = cell.CircuitModel()
wavelengths = np.linspace(1.52, 1.58, 4001)
S_total = cell_cm.get_smatrix(wavelengths=wavelengths)

# Plotting
fig, axs = plt.subplots(3, sharex=True)

for ind, cp in enumerate(control_points):
    tr_out1 = 20 * np.log10(np.abs(S_total['mzi{}_out1:0'.format(ind), 'mzi{}_in:0'.format(ind)]))
    tr_out2 = 20 * np.log10(np.abs(S_total['mzi{}_out2:0'.format(ind), 'mzi{}_in:0'.format(ind)]))

    axs[ind].plot(wavelengths, tr_out1, '-', linewidth=2.2, label="TE - MZI{}:out1".format(ind))
    axs[ind].plot(wavelengths, tr_out2, '-', linewidth=2.2, label="TE - MZI{}:out2".format(ind))

    axs[ind].set_ylabel('Transmission [dB]', fontsize=16)
    axs[ind].set_title('MZI{}'.format(ind), fontsize=16)
    axs[ind].legend(fontsize=14, loc=4)

axs[2].set_xlabel('Wavelength [um]', fontsize=16)

Mach-Zehnder interferometer

2.2.6. Test your knowledge

Do these results satisfy your expectations? If not, change the control points to change the length of the right arm and check again the simulation.