stanfordnqp/spins-b

Polarization Conversion and Non-Squared Design Area

Closed this issue · 5 comments

Hi, I have two short questions,

1-) I am trying a simple polarization conversion from Mode 0 to Mode 1 out of the example wdm2.py (also tried vice-versa) and SPINS directly puts 6 iterations, extracting a design.gds, which has not design at all (although it terminal says Spins finished, no bending in the final output).

Why would that happen? Isn't that possible to do such a thing out of SPINS?

2-) I am changing the design area of foreground.gds and trying to make the design area different than a square. When I start the simulation, it comes nearly to the end and gives an error something like "the x dimension (101) does not match z dimension (102)"

It never happens when I make the area square, so I am suspicious that the design area has to be square at all times. Would you agree with me? If not, is there a way I may workaround this problem?

Thank you so much in advance

  1. For silicon at telecom, mode 0 is the fundamental TE mode and mode 1 is the fundamental TM mode (in 3D). Without breaking vertical symmetry (e.g. with partial etch), it's physically impossible to design something that converts from TE to TM. If you want to convert the fundamental TE to first order TE, then you need to mode 2.

  2. It doesn't have to be square (we regularly design with rectangles). Can you post full your stack trace?

Thanks for the answer @ludi1001 ,

  1. I will have one more question related to this one, is it not possible to achieve TE TM polarization effects in 2D?

  2. With a more confidence after your comment, I managed to achieve a non-square area simulation by starting over for the design of gds' and the simulation code. I, most probably, made a mistake somewhere in GDS or the code.

Thank you again for the answer!

In addition to my last reply, there is an update on 2nd part of the post.

Screen Shot 2020-07-06 at 7 41 27 PM

The simulation goes for the last iteration, it produces all the .pkl up to there. But there is the last one, which is probably causing the error in the image above.

File "/Users/username/.pyenv/versions/3.7.3/lib/python3.7/site-packages/matplotlib/contour.py", line 1521, in _check_xyz
raise TypeError(f"Length of x ({nx}) must match number of "
TypeError: Length of x (202) must match number of columns in z (102)

What might be the cause of that? I am only getting this when I simulate non-square design areas.

Hi again @ludi1001 ,

As an additional note to the ones above, the GDS output file is not what I am expecting, but it gets fixed when I rotate it -90 degrees on -z axis and 180 degrees on x axis, it turns fine just as the epsilon distribution. I've got fixed all the problems along with this one, by investigating the following:

I realized there is a line causing the problem (which seems to fit my theory of non-square design area problem). The line passes in "parametrization.py" under "def generate_polygons(self, dx: float):"

cs = plt.contour(x_extended, y_extended, phi_extended - 0.5, [0])

The contour function normally takes a matrix with the counts of columns of x and rows of y axes, but here (phi_extended - 0.5) is just the transpose of the expected matrix sizing. I basically took the transpose as (phi_extended - 0.5).T and run the GDS with non-square design area. It works! Then I simulated the output GDS file without rotating at any direction, it works!

Would you check the related file and tell me whether that be a solution?

Thank you.

Hi, is this still an issue?