Skip to content

Conversation

quant
Copy link

@quant quant commented Apr 6, 2023

The fix normalizes reciprocal lattice vectors in _k_matrix_1D just like it is done in _k_matrix_2D.

Without normalization the 1D grating gives different results for different units of length, as the test shows

@edmundsj
Copy link
Owner

Can you add to your description what this fixes? It's been a minute and I don't recall it being necessary to normalize the reciprocal lattice vectors.

@quant
Copy link
Author

quant commented May 22, 2023

I made the description. I am sorry, I should have begun with it.
For the test - it may better be placed into a separate user tests test file.

@edmundsj
Copy link
Owner

Not at all, thank you for contributing! I believe you're correct, I'll hunt down the primary source for this ASAP to confirm. How did you notice this error?

@quant
Copy link
Author

quant commented May 24, 2023

I found the issue exactly as the test shows: R and T in 1D setup were unexpectedly dependent on the unit of length used (nm vs um). After some debugging I located the inconsistency, fixed and tested it and now I (almost) trust the 1D path.

Still there is an insignificant issue with zero incident angle, and another minor issue with P_matrix() when er is a scalar, but I am not ready yet to file an issue and suggest a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants