Giter Club home page Giter Club logo

opics's People

Contributors

jaspreetj avatar lukasc-ubc avatar mustafacc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opics's Issues

Can't change frequency list in Microring example

  • OPICS version: 0.3.3
  • Python version: Python 3.10.5
  • Operating System: Arch Linux

Description

I was trying to change the frequency range used in the microring example by changing the line in the Network initialization:

freq = np.linspace(C * 1e6 / 1.5, C * 1e6 / 1.6, 2000)

I changed "2000" to "20000" hoping to get 20000 points in the output plot instead of 2000 for more resolution.

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,)

What I Did

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:

combination_f = F

This line seems to set the frequency list of the combined component to the global frequency list rather than using the frequency list of the supplied components. I believe this line should reuse the frequency list from the components that are being combined.

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.

Enhancement: Turn net into a class

  • OPICS version: 0.1.5
  • Python version: 3.7.7
  • Operating System: Win 64

Description

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

'TunableWG' object has no attribute 'componentParameters'

  • OPICS version: 0.3.3
  • Python version: 3.7
  • Operating System: WS11

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.