GithubHelp home page GithubHelp logo

Comments (3)

momchil-flex avatar momchil-flex commented on May 19, 2024 1

I see, thanks for doing that comparison, I agree that it looks like there's a bug in the field getting or plotting in legume. I'll let you know when I find some time to look into it if I discover what it is or manage to fix it.

from legume.

momchil-flex avatar momchil-flex commented on May 19, 2024

I think this may be a numerical artifact when using a mode expansion method (here plane waves). If you want to investigate further, maybe try plotting a 1D cross section, with higher spatial resolution, and zoomed in around the boundary. I wonder if what we're seeing here is related to the Gibbs phenomenon (you're basically doing with Fourier transforms here too). I'm not sure though, because you're using quite high gmax so I would have thought that it should not be so pronounced. Maybe there is a bug in the plotting - if so, I am not sure when I'll find time to investigate in more detail though.

By the way note that legume has a dedicated function to compute (multi-layer) slab modes: https://github.com/fancompute/legume/blob/master/legume/gme/slab_modes.py, which are the basis for the guided-mode expansion. Just in case it is useful for what you are doing (these should be the exact analytical solutions).

from legume.

rafael-fuente avatar rafael-fuente commented on May 19, 2024

The problem is not a numerical artifact. Due to plane wave expansion, there is always Gibbs phenomenon, but it doesn't cause the discontinuity of Ez. In fact, Ez shouldn't have Gibbs phenomena in the first place because it shouldn't have a discontinuity.

I solved exactly the same problem with MPB and it's outputting the correct fields, with Ez being continuous and Dz discontinuous, so I think it's a legume bug.
MPB and legume frequencies are the same, so the problem isn't there, it's only the fields.

Screenshot 2024-02-28 012107
Screenshot 2024-02-28 011908

from legume.

Related Issues (20)

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.