Get from Ico-github-logo

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

  • PlaceCouplerArray.m
  • AddOptions(structure, var...
    ADDOPTIONS is a general function that reads the varargin standard matlab format of
  • AddRefsToLib(gdslib, refs...
    ADDREFSOLIB inserts GDS reference cells into a gds library object
  • Bound(x, xMin, xMax)
  • BraggFromParameters(len, ...
    BRAGGFROMPARAMETERS Create a bragg grating information structure
  • BraggFromPeriods(w, perio...
    BRAGGFROMPARAMETERS Create a bragg grating information structure
  • BraggFromProfile(spatialV...
    BRAGGFROMPROFILE Create a bragg structure
  • CastDefineMap(mapName, ma...
    CASTDEFINEMAP Define the maps for the layers and datatypes for use in CastLayerMap.
  • CastLayerMap(filename, ma...
    CASTLAYERMAP Read a .gds and export its layers to another layermap in a new .gds.
  • CastPreProcessing(st, map...
    CASTPOSTPROCESSING Layer copying and/or boolean operations for specific layer maps.
  • CastStructureLayer(st, ma...
    CASTSTRUCTURELAYER Cast the layers from a structure to other layers.
  • CheckForDirectory(cellname)
    CHECKFORDIRECTORY Ensure that the Cells directory and following hierarchy exists.
  • CheckForLargePolygons(el,...
    CHECKFORLARGEPOLYGONS cuts polygons larger that 8191 vertices
  • CheckParallelAndAlign(info)
    CHECKPARALLELANDALIGN If the cursors are parallel returns the different lengths needed to
  • CheckParallelAndNormal(info)
    CHECKPARALLELANDNORMAL Return an info structure with the positions sorted according
  • CloneInfo(info, number, f...
    CLONEINFO Duplicates, moves and rotates cursor information
  • ConstrainAngle(varargin)
    CONSTRAINANGLE Force an angle in degrees to be between -180 and 180 in value.
  • ConvertToTime(sec)
    CONVERTTOTIME Convert a duration in seconds and sends it back divided in hours,
  • CorrectStransFields(strans)
    CORRECTSTRANSFIELD Adds the required fields to an strans struct if they do not
  • CouplerGratingSW(type, wi...
    COUPLERGRATINGSW Create a subwabvelength coupler grating structure
  • CreateFolderRefsFloorplan...
    CREATEFOLDERREFSFLOORPLAN Create the floorplan info for all .gds in the current folder.
  • CreateRefsFloorplan(filen...
    CREATEREFSFLOORPLAN Create a .mat file associated to the reference .gds file
  • CursorInfo(pos, ori, neff...
    CURSORINFO Create a cursor information structure.
  • Equal(varargin)
    EQUAL Verify independently for each array if all their elements have the same value
  • ExportMap()
    EXPORTMAP converts the master GDS into a specific fab GDS
  • FiberArray(fiberSpacing, ...
    FIBERARRAY Create a fiber array information structure
  • FinalizeCell(cad, cellnam...
    FINALIZECELL Receive the mandatory elements to create a GDS and write it.
  • FindCircle(x, y)
  • GetCellInfo(cad)
    GETCELLINFO Read all the .mat files associated with the children cells and GDS
  • GetRefsFloorplan(refs)
    GETREFSFLOORPLAN Look into the .mat files associated to the library .gds files to
  • GetStructureSize(st, refs...
    GETSTRUCTURESIZE Find the rectangular area occupied by a gds_structure.
  • InitializeCell()
    INITIALIZECELL This function initializes the tools and objects needed to make a gds cell
  • InitializeGDSclasses()
  • InvertInfo(info)
    INVERTINFO Invert the orientation of all the cursors and reset the lengths
  • MMI(w, len, tapl, ff, lay...
    MMI Create a MMI information structure
  • Main()
    MAIN creates all the cells, merges them and export the final GDS
  • MakeRect(xy, rectsize, va...
    MAKERECT Create a 5-points closed polygon from a position xy and a
  • MergeCells()
    MERGECELLS puts all the cells together in a single GDS file
  • MergeElements(els)
    MERGEELEMENTS creates on compound element with many gds_element
  • MergeGDS(cad, log)
    MERGEGDS runs through the Cells folder and puts all the .gds files together in a
  • MergeInfo(varargin)
    MERGEINFO Merge any number of cursor information structures together into one.
  • Microring(gap, layer, dty...
    MICRORING Create a microring information structure
  • NonNegative(varargin)
    NONNEGATIVE Ensure that no element of any arrays sent as input arguments have a
  • NumberOfColumns(cols, var...
    NUMBEROFCOLUMNS makes sure that each array sent in as arguments has the number of
  • NumberOfRows(rows, varargin)
    NUMBEROFROWS makes sure that each array sent in as arguments has the number of
  • PlaceARef(structure, info...
    PLACEAREF places an array of reference
  • PlaceArc(structure, info,...
    PLACEARC places arc polygons in a gds structure
  • PlaceCDC(structure, info,...
    PlaceCDC places a co-directional coupler
  • PlaceCompactUTurn(structu...
    PLACECOMPACTUTURN takes a group of waveguides around in a precise and compact u-turn
  • PlaceMMI(structure, info,...
    PLACEMMI place a multi-mode interferometer
  • PlaceMicroring(structure,...
    PLACEMICRORING Place a microring in a information structure
  • PlaceRect(structure, info...
    PLACERECT places rectangular polygons in a gds structure
  • PlaceRef(struct, info, re...
    PLACEREF places a reference
  • PlaceSBend(structure, inf...
    PlaceSBend places s-bend polygons in a gds structure
  • PlaceStructure(struct, in...
    PlaceStructure places polygons from a structure array
  • PlaceTaper(structure, inf...
    PLACETAPER places taper polygons in a gds structure
  • PlaceYBranch(struct, info...
    PLACEYBRANCH places a y-branch reference
  • PlotPolygons(obj, type)
  • ProjectDefinition(log)
    PROJECT DEFINITION Contains the information for the current project
  • PutCell(topcell, cad, cel...
    PUTCELL Create a cell positioning information in the master .gds
  • ReadLayerMap(fab, log)
    READLAYERMAP Load the layer map for a specific fabrication facility/process
  • ReadOptions(structure, va...
    READOPTIONS is a general function that reads the varargin standard matlab format of
  • RelativeDistanceInfo(info...
    RELATIVEDISTANCEINFO returns relative vectorial distance between two cursors
  • RotTransXY(xy, pos, ori)
    ROTTRANSXY rotates a set of 2D coordinates then translates them
  • SetupLog(varargin)
    SETUPLOG Define a log object that is helpful in writing execution comments
  • SplitInfo(info, indices)
    SPLITINFO Separates certain indices from a cursor information structure.
  • StransInfo(info, pos, str...
    STRANSINFO Reflects and rotates cursor information.
  • StransXY(xy, pos, strans)
    STRANSXY Transform a set of 2D coordinates then translate them
  • Taper(varargin)
    TAPER Create a taper information structure
  • Waveguide(w, layerInfo, r...
    WAVEGUIDE Create a waveguide information structure
  • WidthInfo(info, waveguide)
    WIDTHINFO Returns the total width of the waveguides.
  • adjmatrix(S)
  • curvedwgloss(struct, info...
    Creates spiral WG
  • funSolve(fun, xmin, xmax,...
    This function returns the first zero of the fun entered in it
  • gds_file_exists(fname)
    % checks if a file exists in the current directory
  • gds_initialize(fname, uun...
    function [gf] = gds_initialize(fname, uunit, dbunit, lname, reflibs, fonts);
  • gds_read_struct(gf, uunit...
    % read all elements contained in a structure and return
  • gdscat(inpfil, outfil, in...
    function gdscat(inpfil, outfil, inptop, outtop, libnam, uunit, dbunit))
  • gdsii_arc(arc, layer, dty...
  • gdsii_bitmap(bmap, pixel,...
  • gdsii_cdfeature(layer, mi...
    function [cd] = gdsii_cdfeature(layer, mincd, uunit);
  • gdsii_checky(tname, N, mi...
  • gdsii_datamatrix(str, hei...
    function [dms] = gdsii_datamatrix(str, height, sname, layer);
  • gdsii_grating(name, pos, ...
  • gdsii_multref(name, struc...
    function [astruc] = gdsii_multref(name, struct, xy, strans)
  • gdsii_pattern(sname, xy, ...
  • gdsii_ptext(str, pos, hei...
  • gdsii_replicate(name, xy,...
  • gdsii_sierpinski(tname, m...
  • gdsii_units(uunit, dbunit)
    function gdsii_units(uunit, dbunit);
  • gdsii_version
    function [tb_ver, sw_ver] = gdsii_version;
  • gdspeek(gdsfil, bel)
    function gdspeek(gdsfil, bel)
  • isGDSStructure(structure)
    ISGDSSRUCTURE Verify that a struct possesses certain fields.
  • isWaveguide(structure)
    ISWAVEGUIDE Verify that a struct possesses certain fields.
  • layerinfo(glib)
  • read_gds_library(gdsname,...
    function [glib] = read_gds_library(gdsname, verbose, hdronly);
  • spiralrect(struct, infoin...
    Creates spiral WG
  • topstruct(cas, bcell)
  • wglosscar(struct, infoin,...
    Creates Waveguide arrays for loss caracterization
  • gds_element.m
    function gelm = gds_element(etype, varargin);
  • gds_library.m
    function glib = gds_library(lname, varargin);
  • gds_structure.m
    function gstruc = gds_structure(sname, varargin);
  • Contents.m
    Classes and Methods for GDS II
  • makemex.m
  • Contents.m
    Octave & MATLAB Toolbox for GDS II libraries
  • Contents.m
    Functions that Return gds_element Objects
  • makemex.m
  • omakemex.m
    % script to make .mex files on Octave/Windows
  • Contents.m
    Functions that Return gds_structure Objects
  • MakeLogo.m
    This little code will split an image into R G B channels and binarize them into
  • makemex.m
    Compiling the mex files
  • Cell_A_StraightWG.m
  • Cell_B_Microrings.m
  • Cell_C_CompactIBGs.m
  • Cell_D_RidgeIBGs.m
  • Cell_E_CustomIBGs.m
    Custom profile Integrated Bragg Gratings
  • Cell_F_MZI.m
  • Cell_G_MMI.m
  • Cell_H_Aref_internalRef.m
  • Cell_RoutingWG.m
  • View all files
5.0 | 4 ratings Rate this file 24 Downloads (last 30 days) File Size: 2.4 MB File ID: #46827 Version: 1.2
image thumbnail




02 Jun 2014 (Updated )

A library of functions to facilitate the design of Photonics Integrated Circuits GDS layouts

| Watch this File

File Information

Matlab GDS Photonics Toolbox
This is a Matlab library of functions to facilitate the design of Photonics Integrated Circuits GDS layouts that I have developped with Alexandre D. Simard during my PhD.
This is oriented towards intuitive and adaptable creation of GDS layout files for fabrication in different facilities across the world. The toolbox creates a GDS based on a general layer map, but can be set up to export to any other layer map once the design is done.

Nicolas Ayotte and Alexandre D. Simard have used this library to efficiently create multiple layouts for different fabrication facilities across the world with successful results.

- Relative orientation group waveguide routing including turns, tapers, s-bends and the possibility to customize inter-waveguide distance at any point.
- Access to the travelled distance (physical or optical) of any waveguide offering a quick way to measure your devices.
- Possibility of referencing premade structures (fiber couplers, directional couplers, detectors, etc.)
- Possibility of referencing custom structures created on the fly.
- Premade functions for microrings, Bragg gratings, multi-mode interferometer, contra-directional couplers, output array of fiber couplers, etc.
- Tutorial project with many cells showcasing the features.
- A PDF presentation presenting the library's purpose and principles.
- Intuitive relative cell placement in the master floorplan for easy teamwork.
- Relative and scalable routing solution.
- Includes functions to export to other layer maps, including boolean operations on the layers.
- Easy scripting language (i.e.: Matlab).

It is strongly encouraged to get the free software KLayout to look at your GDS files:

Suggested first steps
- Look through the PDF presentation
- (Optional) Run the command "mex -setup" to install a C compiler in matlab.
- Run the makemex.m function in the main folder to compile all the C functions needed for the library.
- Open the tutorial project folder: Project - New Project
- Go through the Cells script, run them, look at the resulting .gds files.
- Look at the Cell_RoutingWG.m script that places the cell in the floorplan.
- Read at the ProjectDefinition.m file.
- Run the Main.m to merge the gds cells and export to the ouput layer map.
- Duplicate the Project folder and make your own!

Copyright © 2014 Nicolas Ayotte and Alexandre D. Simard. MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.


Required Products MATLAB
MATLAB release MATLAB 8.1 (R2013a)
Other requirements C compiler.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (7)
03 Nov 2016 Mohammad Sotoodeh

08 Dec 2014 Alexandre D. Simard

The gds generated by this library should not contain self-intersecting polygons. However, opening the gds file with Klayout and saving it on a different name could allow the user to
1) define the maximum number of vertices per polygon
2) remove existing collinear coordinates
3) change the database unit

Comment only
30 Nov 2014 Simcha

Simcha (view profile)

Your work is very valuable and I am sure will find use in many labs besides optics.
We are a quantum information processing lab and have a need to design superconducting circuits using laser lithography.
I am now trying to learn how to use your library and adapt it to our purposes.
It is very important for us to be able to perform boolean operations between layers, as for RF circuits there needs to be a ground layer with a fixed gap to signal lines (waveguides).

For people having problems with makemex - remove .net framework before installing the C++ SDK.

28 Nov 2014 Alexandre D. Simard

Apodized Bragg gratings:

Typical "amplitude" apodized Bragg gratings, as well as "phase" and "superposition" apodized Bragg grating (i.e. "A. D. Simard, N. Belhadj, Y. Painchaud and S. Larochelle, “Apodized Silicon-on-Insulator Bragg Gratings,” Photon. Technol. Lett., vol. 24, no. 12, pp. 1033 -1035, June 2012.") can be easily generated using the function "BraggFromProfile" and by adjusting the flag "apodizationType" to "amplitude", "phase" or "superposition".

Comment only
23 Oct 2014 Nicolas Ayotte

PlaceSBend has been updated and now features a flag that automatically finds the shortest length required for the structure.

Comment only
06 Jun 2014 Alexandre D. Simard

From the user standpoint, this library reduces significantly the time required to produce a complex and multi-layer layout (both for active and passive photonic circuit). This code allows producing a flexible layout than can be easily adjusted and modified to match improved simulation results.

06 Jun 2014 Alexandre D. Simard

18 Aug 2015 1.1

Version 2.0 - Improved stability, new tutorials, boolean operations, new options in PlaceRect, PlaceArc and PlaceSBend. Added a PlaceARef, compact u-turn, a multi-mode interferometer, a Mach-Zehnder interferometer, and a CDC.

26 May 2016 1.2

CheckForLargePolygons added to the library to cut polygons larger than 8191 vertices resulting from boolean operations

Contact us