Simphony: A Simulator for Photonic circuits
Project description
Simphony: A Simulator for Photonic circuits
Simphony, a simulator for photonic circuits, is a fundamental package for designing and simulating photonic integrated circuits with Python.
Key Features:
- Free and open-source software provided under the MIT License
- Completely scriptable using Python 3.
- Cross-platform: runs on Windows, MacOS, and Linux.
- Subnetwork growth routines
- A simple, extensible framework for defining photonic component compact models.
- A SPICE-like method for defining photonic circuits.
- Complex simulation capabilities.
- Included model libraries from SiEPIC and SiPANN.
Developed by CamachoLab at Brigham Young University.
Installation
Simphony can be installed via pip using Python 3:
python3 -m pip install simphony
Please note that Python 2 is not supported. With the official deprecation of Python 2 (January 1, 2020), no future compatability is planned.
Documentation
The documentation is hosted online.
Changelogs can be found in docs/changelog/. There is a changelog file for each released version of the software.
Example
Simphony includes a built-in compact model library with some common components but can easily be extended to include custom libraries.
Scripting circuits is simple and short. There are four main parts to running a simulation in Simphony:
- Define which component models will be used in the circuit.
- Add instances of components into a circuit.
- Define connection points.
- Run a simulation.
The following script models the MZI circuit shown above:
from simphony.libraries import siepic
from simphony.netlist import Subcircuit
from simphony.simulation import SweepSimulation
import matplotlib.pyplot as plt
# Declare the models used in the circuit
gc = siepic.ebeam_gc_te1550() # grating coupler
y = siepic.ebeam_y_1550() # y-branch
wg150 = siepic.ebeam_wg_integral_1550(length=150e-6) # 150 micron waveguide
wg50 = siepic.ebeam_wg_integral_1550(length=50e-6) # 50 micron waveguide
# Create the circuit, add all individual instances
circuit = Subcircuit('MZI')
e = circuit.add([
(gc, 'input'),
(gc, 'output'),
(y, 'splitter'),
(y, 'recombiner'),
(wg150, 'wg_long'),
(wg50, 'wg_short'),
])
# You can set pin names individually:
circuit.elements['input'].pins['n2'] = 'input'
circuit.elements['output'].pins['n2'] = 'output'
# Or you can rename all the pins simultaneously:
circuit.elements['splitter'].pins = ('in1', 'out1', 'out2')
circuit.elements['recombiner'].pins = ('out1', 'in2', 'in1')
# Circuits can be connected using the elements' string names:
circuit.connect_many([
('input', 'n1', 'splitter', 'in1'),
('splitter', 'out1', 'wg_long', 'n1'),
('splitter', 'out2', 'wg_short', 'n1'),
('recombiner', 'in1', 'wg_long', 'n2'),
('recombiner', 'in2', 'wg_short', 'n2'),
('output', 'n1', 'recombiner', 'out1'),
])
# Run a simulation on the netlist.
simulation = SweepSimulation(circuit, 1500e-9, 1600e-9)
result = simulation.simulate()
f, s = result.data('input', 'output')
plt.plot(f, s)
plt.title("MZI")
plt.tight_layout()
plt.show()
More examples can be found in the online documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.