-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from sequoiap/scripted-component-models
Simphony rebuild to enable scripting component models
- Loading branch information
Showing
94 changed files
with
18,340 additions
and
1,639 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
import simphony | ||
import matplotlib.pyplot as plt | ||
# import simphony | ||
# import matplotlib.pyplot as plt | ||
|
||
model = simphony.netlist.ObjectModelNetlist.load('demo/output.json') | ||
sim = simphony.simulation.Simulation(model) | ||
# model = simphony.netlist.ObjectModelNetlist.load('demo/output.json') | ||
# sim = simphony.simulation.Simulation(model) | ||
|
||
x, y = sim.getMagnitudeByFrequencyTHz(2, 3) | ||
plt.plot(x, y) | ||
plt.show() | ||
# x, y = sim.getMagnitudeByFrequencyTHz(2, 3) | ||
# plt.plot(x, y) | ||
# plt.show() | ||
|
||
multi = simphony.simulation.MultiInputSimulation(model) | ||
multi.multi_input_simulation(inputs=[2]) | ||
# multi = simphony.simulation.MultiInputSimulation(model) | ||
# multi.multi_input_simulation(inputs=[2]) | ||
|
||
import simphony.core as core | ||
|
||
ring_resonator = core.Component("ring_resonator_radius_5", [1500,1550,1600], [0,0,0], True) | ||
waveguide = core.Component("waveguide_length_10", [1500,1550,1600], [0,0,0], False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
## [0.2.0] - 2019-08-7 | ||
|
||
Due to a complete code overhaul, this version is incompatible with previous | ||
versions of Simphony. Typically, when a release is incompatible, the MAJOR | ||
version number is bumped. However, since this software is still in the first | ||
stages of development, bumping the MINOR version symbolizes major changes | ||
until the version 1 is officially released. | ||
|
||
### Added | ||
- Since we only need two of the 'connect' algorithms from scikit-rf, they were | ||
brought over into this library to reduce the number of dependencies. | ||
- Added test cases using the pytest framework | ||
- Models are now cached during simulation to avoid repeating calculations | ||
- Logging is now the method of choice for getting info messages from the program | ||
- Simulation runtime is now logged at the INFO level | ||
- Documentation! Built using Sphinx. | ||
|
||
### Changed | ||
- Simphony is now segmented into three modules: core, simulation, and DeviceLibrary | ||
- New component implementation methods (simphony.core.base.ComponentModel) | ||
- Rebuilt device library to match new component implementations | ||
- Device library no long reads data files for s-parameters, as they've been | ||
converted and are now stored as .npz files. | ||
- [#6](https://github.com/sequoiap/simphony/pull/6): ENHANCEMENT: Framework | ||
rebuild, allows for easier implementation of custom component models and | ||
libraries. | ||
|
||
### Removed | ||
- Dependencies on scikit-rf, jsons, and matplotlib have been removed. | ||
- Netlist export functionality no longer exists since netlists can be | ||
scripted in Python. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#################### | ||
Program Architecture | ||
#################### | ||
|
||
********************************** | ||
Components (and Simulation Models) | ||
********************************** | ||
|
||
Simphony attempts to be as agnostic as possible in the implementation of | ||
optical components. This allows for greater flexibility and extensibility. | ||
It is for this reason that Simphony separates the idea of a "component" and | ||
a "simulation model," sometimes simply called a "model." | ||
|
||
Components | ||
========== | ||
|
||
A "Component" represents some discrete component that exists in a layout. | ||
If we consider it from the layout driven design methodology's perspective, | ||
a component is an object such as a y-branch or a bidirectional coupler that | ||
has already been designed and simulated on its own. It has a definite shape | ||
and predefined characteristics that allow it to be simply dropped into | ||
a layout and operate in a predictable fashion. | ||
|
||
Simphony treats components as though they were physical objects stored in a | ||
library. In other words, it is expected that they will not change shape, that | ||
they have a pre-specified port numbering system, etc. | ||
|
||
Simulation Models | ||
================= | ||
|
||
Simphony does, however, | ||
separate the concept of a component and a simulation model. A single component | ||
may have several simulation models associated with it; this allows a single | ||
component to be simulated with different models; perhaps different fabs create | ||
the same component in different ways, leading to different results. Perhaps | ||
there exists a model with data points interpolated from test devices and another | ||
model based on a neural net. To Simphony, it doesn't matter. | ||
|
||
Simulation Models ought to have a nested class called Metadata. It should, at | ||
a minimum, contain the following fields: | ||
- simulation_models | ||
- ports | ||
|
||
It has the following format: | ||
|
||
class Metadata: | ||
simulation_models = [ | ||
('containing_module', 'simulation_class_name', 'human_readable_name'), | ||
... | ||
] | ||
ports = [INT] | ||
|
||
******** | ||
Elements | ||
******** | ||
|
||
Now that we understand what Components and Models are, "elements" are Simphony's | ||
default implementation of some commonly used components. These models are taken | ||
from SiEPIC's `EBeam PDK <https://github.com/lukasc-ubc/SiEPIC_EBeam_PDK>`_. | ||
|
||
New elements can be created and loaded programatically into Simphony. These settings, | ||
however, are not persistent, and should be loaded each time Simphony is imported. | ||
Since element names are required to be unique, you might consider creating a library | ||
of elements with a prefix to the component name (e.g. in 'ebeam_bdc_te1550', 'ebeam' | ||
prefixes what the component actually is). | ||
|
||
Design Pattern | ||
============== | ||
|
||
Each element is contained within its own Python module (i.e. in a folder). The | ||
folder bears the component's name. Within the folder is an empty '__init__.py' | ||
file, a 'models.py' file where simulation models are defined, and a 'component.py' | ||
file that describes the physical features of the component. | ||
|
||
******** | ||
Netlists | ||
******** | ||
|
||
********** | ||
Simulators | ||
********** | ||
|
||
Single Port Simulator | ||
===================== | ||
|
||
Multi Port Simulator | ||
==================== | ||
|
||
Monte Carlo Simulator | ||
===================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
simphony | ||
======== | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
simphony |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,31 @@ | ||
.. H1 | ||
### | ||
API | ||
### | ||
|
||
.. H2 | ||
******* | ||
Netlist | ||
******* | ||
|
||
.. H3 | ||
ObjectModelNetlist | ||
================== | ||
|
||
.. autoclass:: simphony.netlist.ObjectModelNetlist | ||
.. automodule:: simphony | ||
:members: | ||
:inherited-members: | ||
:show-inheritance: | ||
|
||
.. automodule:: simphony.core | ||
:members: | ||
:inherited-members: | ||
:show-inheritance: | ||
|
||
.. automodule:: simphony.simulation | ||
:members: | ||
:inherited-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
simphony.DeviceLibrary.ann package | ||
================================== | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: simphony.DeviceLibrary.ann | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
simphony.DeviceLibrary.ebeam package | ||
==================================== | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: simphony.DeviceLibrary.ebeam | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
simphony.DeviceLibrary package | ||
============================== | ||
|
||
Subpackages | ||
----------- | ||
|
||
.. toctree:: | ||
|
||
simphony.DeviceLibrary.ann | ||
simphony.DeviceLibrary.ebeam | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: simphony.DeviceLibrary | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
simphony.core package | ||
===================== | ||
|
||
Submodules | ||
---------- | ||
|
||
simphony.core.base module | ||
------------------------- | ||
|
||
.. automodule:: simphony.core.base | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
simphony.core.connect module | ||
---------------------------- | ||
|
||
.. automodule:: simphony.core.connect | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
simphony.core.netlist module | ||
---------------------------- | ||
|
||
.. automodule:: simphony.core.netlist | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: simphony.core | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
Oops, something went wrong.