Git Product home page Git Product logo

Comments (2)

ianwilliamson avatar ianwilliamson commented on May 4, 2024 1

The Model class has a density method:

def density(self, design_variable: np.ndarray) -> np.ndarray:
"""The combined (design + background) density distribution of the model."""

It returns an image array that one could pass to Matplotlib's imshow() or pcolor() functions. The simulator outputs are scattering parameters and fields:

def simulate(
self,
design_variable: np.ndarray,
excite_port_idxs: Sequence[int] = (0,),
wavelengths_nm: Optional[np.ndarray] = None,
max_parallelizm: Optional[int] = None,
) -> Tuple[np.ndarray, np.ndarray]:
"""Simulate the device described by the model on a design variable.
Args:
design_variable: `np.ndarray` specifying the topology of the design.
excite_port_idxs: A sorted sequence of ints specifying the ports to
excite. These values are indexed starting from 0 for port 1. The default
behavior is to excite only port 1.
wavelengths_nm: an (optional) ndarray describing the free-space
wavelengths for which we will perform simulations. The ndarray must be
rank-1. If None, the resulting simulation will be as if the user had
passed `self.output_wavelengths`--a rank-1 array.
max_parallelizm: Maximum number of parallel threads executing simulations.
Parallelizm is applied across excitation ports and wavelengths. If None,
we set the number of workers to number of excitation ports times the
number of wavelengths.
Returns:
s_params: A complex-valued `np.ndarray` of shape `wavelengths_nm.shape +
(number of excited ports, number of ports,)` corresponding to several
columns of a complex scattering matrix.
fields: A complex-valued `np.ndarray` of shape `wavelengths_nm.shape +
len(excite_port_idxs) + ez.shape`, containing the steady-state Ez field
per frequency.
"""

These arrays can also be plotted through Matplotlib.

Hope this helps.

from ceviche-challenges.

jan-david-fischbach avatar jan-david-fischbach commented on May 4, 2024

Thanks,
I had seen those but thought I might have missed something else.
Thanks for the quick and thorough response!

from ceviche-challenges.

Related Issues (2)

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.