Create a photonic crystal using a GDS array

Creating a photonic crystal using a GDS array

Make use of GDS array instantiation

import nazca as nd

with nd.Cell('hole') as hole:
    hole_shape = nd.geometries.circle(radius=0.05, N=8)
    nd.Polygon(points=hole_shape).put(0)

hole.put(array=[20, [0.25, 0], 30, [0, 0.30]])
hole.put(5, -5, array=[40, [0.20, 0.10], 50, [0.10, 0.30]])

nd.export_gds()

In this example we show how to create a photonic crystal. We use Nazca geometries library to define a hole shape, which we then put in the layout using GDS array.

The first array is composed of 20 x 30 hole-shapes spaced by 250 nm in x-direction and 300 nm in y-direction. In the second array of 40 x 50 hole-shape we introduce additional translation of 100 nm x 100 nm. The format of the array is as: [col#, [dx1, dy1], row#, [dx2, dy2]]. Note: to rotate the array you have to play with the two displacement vectors [dx1, dy1] and [dx2, dy2]. If you rotate the original shape, then the original shape is rotated within the lattice.

We can vary the diameter of the holes and the holes finesse by, for example, creating a function with the two variables.

import nazca as nd

def hole(diameter=0.1, points=8):
    hole_shape = nd.geometries.circle(radius=0.5*diameter, N=points)
    with nd.Cell('hole') as cell:
        nd.Polygon(points=hole_shape).put(0)
    return cell

hole().put(array=[20, [0.25, 0], 30, [0, 0.30]])
hole(diameter=0.2, points=36).put(5, -5, array=[40, [0.20, 0.10], 50, [0.10, 0.30]])

nd.export_gds()

Finally, we can specify a layer number in which our structures should be placed.

import nazca as nd

nd.add_layer(layer=1)
nd.add_layer(layer=2)

def hole(diameter=0.1, points=8, layer=None):
    hole_shape = nd.geometries.circle(radius=0.5*diameter, N=points)
    with nd.Cell('hole') as cell:
        nd.Polygon(points=hole_shape, layer=layer).put(0)
    return cell

hole().put(array=[20, [0.25, 0], 30, [0, 0.30]])

hole(diameter=0.2, points=36, layer=1).\
    put(5, -5, array=[40, [0.20, 0.10], 50, [0.10, 0.30]])

hole(diameter=0.1, points=4, layer=2).\
    put(5, -5, array=[40, [0.20, 0.10], 50, [0.10, 0.30]])

nd.export_gds()

We used demofab_klayout_colors.lyp to view the masks in KLayout.

Related Tutorials

Nazca LayoutNazca Foundry
16 November 2018

Add text to your layout

In this example we show how to add text to your layout.
Nazca LayoutNazca FoundryPhotonic BBs
19 January 2018

Create a building block using Polygons

In this example we show how to create a building block from Polygons.
Nazca LayoutNazca FoundryPhotonic BBs
14 January 2018

How to create a building block from GDS

In this example we show how to make a building block from a GDS file.