fancompute / legume

🌱 Guided-mode expansion of photonic crystal slabs
https://legume.readthedocs.io/
MIT License
104 stars 27 forks source link

Issue with the Photonic Crystal Slab exemple #33

Closed paulgoulain closed 4 years ago

paulgoulain commented 4 years ago

Hi, I've been using Legume for a few days and toying with the exemples a bit. But I'm facing an issue with the GuidedModeExp class.

In the band of a photonic crystal slab exemple, when I change the line : path = lattice.bz_path(['G', 'M', 'K', 'G'], [15, 10, 15])

to : path = lattice.bz_path(['G', 'K', 'M', 'G'], [15, 10, 15])

I obtain the following error :

File` "c:\python\python37\lib\site-packages\legume\gme\gme.py", line 909, in compute_rad
count+self.modes_numg[kind][im1]][:, np.newaxis])

ValueError: operands could not be broadcast together with shapes (121,0) (120,1)

Is it normal that I can't change the path in the k-space ?

Paul

momchilmm commented 4 years ago

Hi!

It appears that the issue is simply that you need to re-initialize gme before you run it with a different set of k-points. One of the drawbacks of using Notebooks vs. self-contained python scripts is that errors like these might pop-up when re-evaluating cells without restarting completely. But I'll also think about a more stable way to implement this in future versions!

Thanks a lot for reporting this, this is still a work in progress that requires a lot of testing, so do let us know about any sharp edges you encounter!