Skip to main content

Simphony: A Simulator for Photonic circuits

Project description

Simphony: A Simulator for Photonic circuits

Development version PyPI Version PyPI - Python Version Build Status pre-commit Documentation Status License Latest Commit

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:

  1. Define which component models will be used in the circuit.
  2. Add instances of components into a circuit.
  3. Define connection points.
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simphony-0.4.0.tar.gz (4.5 MB view hashes)

Uploaded Source

Built Distribution

simphony-0.4.0-py3-none-any.whl (4.9 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page