Python library for the design of femtosecond laser-written integrated photonic circuits.
femto is an open-source package for the design of integrated optical circuits.
The library consists of a growing list of parts and modules, which can be composed to construct complex optical components and large circuits.
The optical components can be plotted and exported to a .pgm file for the fabrication of the circuit.
The package can be installed using pip (use Python 3.11)
python3 -m venv .venvs/femto
source .venvs/minimal/bin/activate
pip install git+ssh://git@github.com/ricalbr/femto2.gitHere a brief example on how to use the library.
First, import all the required modules
from femto.curves import sin
from femto.device import Device
from femto.pgmcompiler import PGMCompiler
from femto.waveguide import WaveguideSet waveguide parameters
PARAM_WG = dict(scan=4,
speed=7.5,
depth=0.050,
radius=25)Create a list of waveguides as
wgs = []
# SWG
wg = Waveguide(**PARAM_WG)
wg.start([-2, 4.5, 0.050])
wg.linear([27, 4.5, 0.050], mode='ABS')
wg.end()
wgs.append(wg)
# MZI
for i in range(6):
wg = Waveguide(**PARAM_WG)
wg.start([-2, 5+i*0.080, 0.500])
wg.linear([10, 0, 0], mode='INC')
wg.mzi(dy=(-1)**i * 0.037, dz=0, fx=sin)
wg.linear([27, 5+i*0.080, 0.500], mode='ABS')
wg.end()
wgs.append(wg)Now that the waveguides are defined, we set the fabrication parameters
PARAM_GC = dict(filename='MZIs.pgm',
laser='PHAROS',
samplesize=(25, 10),
rotation_angle=0.0)Create a Device object that allows to store the waveguides and plot them
# CIRCUIT
circuit = Device(**PARAM_GC)
# Add waveguides to circuit
circuit.extend(wgs)
# Make a plot of the circuit
circuit.plot2d()Export the G-Code with the following commands
# Export G-Code file
with PGMCompiler(**PARAM_GC) as G:
G.tic()
with G.repeat(6):
for i, wg in enumerate(wgs):
G.comment(f' +--- Mode: {i + 1} ---+')
G.write(wg.points)
G.toc()
G.go_origin()Other example files can be found here.
The complete documentation can be found here.
To request features or report bugs open an issue here
You can finally rest, femto-writer...
