siepic / opics Goto Github PK
View Code? Open in Web Editor NEWPhotonic circuit simulator
License: MIT License
Photonic circuit simulator
License: MIT License
I was trying to change the frequency range used in the microring example by changing the line in the Network initialization:
opics/examples/microring/microring.py
Line 11 in 414e517
When I did this I got an error:
daniel@acer-swift maybe_trash]$ python microring.py
____ ____ _______________
/ __ \/ __ \/ _/ ____/ ___/
/ / / / /_/ // // / \__ \
/ /_/ / ____// // /___ ___/ /
\____/_/ /___/\____//____/
OPICS version 0.3.3
20000
Traceback (most recent call last):
File "/home/daniel/documents/school/masc/research/maybe_trash/microring.py", line 35, in <module>
circuit.sim_result.plot_sparameters(
File "/home/daniel/.local/lib/python3.10/site-packages/opics/components.py", line 262, in plot_sparameters
plt.plot(x_data, np.square(np.abs(self.s[:, int(i), int(j)])))
File "/usr/lib/python3.10/site-packages/matplotlib/pyplot.py", line 2769, in plot
return gca().plot(
File "/usr/lib/python3.10/site-packages/matplotlib/axes/_axes.py", line 1632, in plot
lines = [*self._get_lines(*args, data=data, **kwargs)]
File "/usr/lib/python3.10/site-packages/matplotlib/axes/_base.py", line 312, in __call__
yield from self._plot_args(this, kwargs)
File "/usr/lib/python3.10/site-packages/matplotlib/axes/_base.py", line 498, in _plot_args
raise ValueError(f"x and y must have same first dimension, but "
ValueError: x and y must have same first dimension, but have shapes (2000,) and (20000,)
I was thinking this probably came from using the global frequency list instead of the supplied frequency list somewhere in the code. I traced my issue back in the Opics code to this line:
Line 54 in 414e517
One quick fix for this is to change the line to:
combination_f = components[0].f
This fixes the problem for me. However, I'm not sure if this is an actual issue or if there's a proper way to do this I missed.
The libraries should be imported as opics.libs instead of opics.libraries
Currently nets are defined as a list. They should be turned into a class and allow for the following methods:
plot_net(self.net): plots the net s-parameters (as in probing the circuit at a specific net)
get_components(self.net) returns the components connected to the net
How can we enable opics to use labels instead of laser instance?
How about adding some label such as opics_input
for the input?
now that gdsfactory is compatible with SIEPIC verification it would be great to get it also working with OPICS
I'm encountring an issue using TunableWG from the opics.libraries.ebeam
Here is how I'm using it >
wg2 = circuit.add_component(library.TunableWG, params={"length": 150e-6, "power": power_sweep})
And getting this error >
AttributeError: 'TunableWG' object has no attribute 'componentParameters'
Any suggestion for a solution?
Turn Waveguide class 'loss' argument as a frequency dependent loss values and not a singular value for every frequency.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.