ElectroMagneticPython 2.2.1__py3-none-any.whl → 2.2.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. EMpy/RCWA.py +32 -12
  2. EMpy/__init__.py +10 -2
  3. EMpy/_version.py +24 -0
  4. EMpy/constants.py +0 -2
  5. EMpy/devices.py +8 -32
  6. EMpy/materials.py +1 -8
  7. EMpy/modesolvers/FD.py +34 -76
  8. EMpy/modesolvers/FMM.py +24 -23
  9. EMpy/modesolvers/__init__.py +1 -0
  10. EMpy/modesolvers/geometries.py +8 -9
  11. EMpy/transfer_matrix.py +10 -6
  12. EMpy/utils.py +12 -26
  13. electromagneticpython-2.2.4.dist-info/METADATA +99 -0
  14. electromagneticpython-2.2.4.dist-info/RECORD +45 -0
  15. {ElectroMagneticPython-2.2.1.dist-info → electromagneticpython-2.2.4.dist-info}/WHEEL +1 -1
  16. electromagneticpython-2.2.4.dist-info/top_level.txt +4 -0
  17. examples/ex_APRR.py +18 -0
  18. examples/ex_NRR.py +40 -0
  19. examples/ex_RCWA.py +95 -0
  20. examples/ex_RCWA_2.py +52 -0
  21. examples/ex_RCWA_3.py +58 -0
  22. examples/ex_SRR.py +23 -0
  23. examples/ex_laser_etch_monitor.py +241 -0
  24. examples/ex_modesolver.py +68 -0
  25. examples/ex_modesolver_2.py +58 -0
  26. examples/ex_modesolver_3.py +48 -0
  27. examples/ex_modesolver_4.py +43 -0
  28. examples/ex_modesolver_dch.py +296 -0
  29. examples/ex_modesolver_dch_anis.py +318 -0
  30. examples/ex_transfer_matrix.py +82 -0
  31. examples/ex_transfer_matrix_2.py +44 -0
  32. examples/ex_transfer_matrix_2.py.png +0 -0
  33. examples/ex_transfer_matrix_3.py +60 -0
  34. examples/lc_data.dat +27 -0
  35. examples/nk.py +1468 -0
  36. scripts/FDTD.py +741 -0
  37. tests/devices_test.py +31 -0
  38. tests/materials_test.py +1 -1
  39. tests/modesolvers_test.py +36 -0
  40. tests/transfer_matrix_test.py +134 -0
  41. tests/utils_test.py +9 -5
  42. EMpy/version.py +0 -1
  43. ElectroMagneticPython-2.2.1.dist-info/METADATA +0 -109
  44. ElectroMagneticPython-2.2.1.dist-info/RECORD +0 -22
  45. ElectroMagneticPython-2.2.1.dist-info/top_level.txt +0 -2
  46. {ElectroMagneticPython-2.2.1.dist-info → electromagneticpython-2.2.4.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,44 @@
1
+ # taken from http://hyperphysics.phy-astr.gsu.edu/hbase/phyopt/antiref.html#c1
2
+
3
+
4
+ from matplotlib import pyplot as plt
5
+ import numpy
6
+
7
+ import EMpy
8
+
9
+ # define multilayer
10
+ n = numpy.array([1.0, 1.38, 1.9044])
11
+ d = numpy.array([numpy.inf, 387.5e-9 / 1.38, numpy.inf])
12
+ iso_layers = EMpy.utils.Multilayer()
13
+ for i in range(n.size):
14
+ n0 = EMpy.materials.RefractiveIndex(n[i])
15
+ iso_layers.append(
16
+ EMpy.utils.Layer(EMpy.materials.IsotropicMaterial("mat", n0=n0), d[i])
17
+ )
18
+
19
+ # define incident wave plane
20
+ theta_inc = EMpy.utils.deg2rad(10.0)
21
+ wls = numpy.linspace(0.85e-6, 2.25e-6, 300)
22
+
23
+ # solve
24
+ tm = EMpy.transfer_matrix.IsotropicTransferMatrix(iso_layers, theta_inc)
25
+ solution_iso = tm.solve(wls)
26
+
27
+ # plot
28
+ plt.figure()
29
+ plt.plot(
30
+ wls,
31
+ 10 * numpy.log10(solution_iso.Rs),
32
+ "rx-",
33
+ wls,
34
+ 10 * numpy.log10(solution_iso.Rp),
35
+ "g.-",
36
+ )
37
+ plt.legend(("Rs", "Rp"))
38
+ plt.title("Single Layer Anti-Reflection Coating")
39
+ plt.xlabel("wavelength /m")
40
+ plt.ylabel("Power /dB")
41
+ plt.grid()
42
+ plt.xlim(wls.min(), wls.max())
43
+ # plt.savefig(__file__ + ".png")
44
+ plt.show()
Binary file
@@ -0,0 +1,60 @@
1
+ from matplotlib import pyplot as plt
2
+ import numpy
3
+
4
+ import EMpy
5
+
6
+ # define the multilayer
7
+ epsilon = [
8
+ 1.0**2 * EMpy.constants.eps0 * numpy.eye(3),
9
+ EMpy.constants.eps0 * numpy.diag([2.1, 2.0, 1.9]),
10
+ 2.3**2 * EMpy.constants.eps0 * numpy.eye(3),
11
+ 4.3**2 * EMpy.constants.eps0 * numpy.eye(3),
12
+ 3.0**2 * EMpy.constants.eps0 * numpy.eye(3),
13
+ ]
14
+
15
+ d = numpy.array([numpy.inf, 1e-6, 2.3e-6, 0.1e-6, numpy.inf])
16
+
17
+ aniso_layers = EMpy.utils.Multilayer()
18
+ for i in range(len(epsilon)):
19
+ eps = EMpy.materials.EpsilonTensor(epsilon[i] * numpy.eye(3))
20
+ mat = EMpy.materials.AnisotropicMaterial("layer_%d" % i, eps)
21
+ layer = EMpy.utils.Layer(mat, d[i])
22
+ aniso_layers.append(layer)
23
+
24
+ # define the planewave
25
+ theta_inc_x = EMpy.utils.deg2rad(0.0)
26
+ theta_inc_y = 0.0
27
+ wls = numpy.linspace(1.4e-6, 1.7e-6, 100)
28
+
29
+ # solve
30
+ tm = EMpy.transfer_matrix.AnisotropicTransferMatrix(
31
+ aniso_layers, theta_inc_x, theta_inc_y
32
+ )
33
+ solution_aniso = tm.solve(wls)
34
+
35
+ # plot
36
+ plt.figure()
37
+ plt.plot(
38
+ wls,
39
+ solution_aniso.R[0, 0, :],
40
+ wls,
41
+ solution_aniso.R[1, 0, :],
42
+ wls,
43
+ solution_aniso.R[0, 1, :],
44
+ wls,
45
+ solution_aniso.R[1, 1, :],
46
+ wls,
47
+ solution_aniso.T[0, 0, :],
48
+ wls,
49
+ solution_aniso.T[1, 0, :],
50
+ wls,
51
+ solution_aniso.T[0, 1, :],
52
+ wls,
53
+ solution_aniso.T[1, 1, :],
54
+ )
55
+ plt.legend(("Rss", "Rps", "Rsp", "Rpp", "Tss", "Tps", "Tsp", "Tpp"))
56
+ plt.title("Anisotropic Multilayer")
57
+ plt.xlabel("wavelength /m")
58
+ plt.ylabel("Power /dB")
59
+ plt.xlim(wls.min(), wls.max())
60
+ plt.show()
examples/lc_data.dat ADDED
@@ -0,0 +1,27 @@
1
+ 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 12.5 15 17.5 20
2
+ 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5
3
+ 86.5 86.445 86.218 85.357 82.228 78.514 74.974 71.644 68.527 65.595 62.821 60.188 57.682 55.298 53.028 50.867 48.81 46.851 44.985 43.207 41.512 34.144 28.316 23.694 20.016
4
+ 86.5 86.394 85.954 84.268 78.175 71.212 64.955 59.464 54.678 50.47 46.724 43.353 40.296 37.506 34.95 32.6 30.434 28.431 26.577 24.858 23.26 16.78 12.191 8.912 6.556
5
+ 86.5 86.347 85.71 83.245 74.43 64.807 56.652 49.878 44.257 39.524 35.469 31.941 28.838 26.086 23.63 21.43 19.452 17.669 16.059 14.603 13.284 8.308 5.214 3.277 2.058
6
+ 86.5 86.306 85.488 82.297 71.046 59.325 49.868 42.327 36.288 31.369 27.285 23.838 20.892 18.352 16.146 14.222 12.539 11.063 9.765 8.624 7.618 4.11 2.22 1.196 0.638
7
+ 86.5 86.268 85.287 81.433 68.052 54.704 44.35 36.343 30.112 25.183 21.212 17.96 15.263 13.005 11.101 9.489 8.119 6.952 5.956 5.104 4.376 2.031 0.942 0.433 0.195
8
+ 86.5 86.235 85.11 80.663 65.457 50.859 39.878 31.586 25.29 20.444 16.654 13.646 11.229 9.269 7.669 6.355 5.273 4.379 3.639 3.025 2.516 1.003 0.399 0.157 0.06
9
+ 86.5 86.207 84.956 79.991 63.258 47.706 36.281 27.819 21.53 16.812 13.229 10.474 8.333 6.654 5.328 4.276 3.437 2.766 2.228 1.796 1.448 0.496 0.169 0.057 0.018
10
+ 86.5 86.184 84.827 79.423 61.447 45.175 33.437 24.875 18.631 14.056 10.676 8.158 6.265 4.832 3.739 2.901 2.256 1.757 1.37 1.07 0.836 0.245 0.072 0.02 0.005
11
+ 86.5 86.165 84.723 78.964 60.014 43.211 31.254 22.637 16.452 12.012 8.814 6.5 4.815 3.582 2.674 2.003 1.504 1.132 0.853 0.644 0.487 0.122 0.03 0.007 0.002
12
+ 86.5 86.15 84.645 78.617 58.949 41.773 29.667 21.023 14.894 10.567 7.516 5.362 3.837 2.755 1.984 1.433 1.038 0.753 0.548 0.399 0.292 0.061 0.013 0.003 0.001
13
+ 86.5 86.141 84.593 78.385 58.244 40.829 28.632 19.976 13.89 9.644 6.694 4.65 3.234 2.253 1.572 1.098 0.769 0.539 0.379 0.266 0.188 0.033 0.006 0.001 0
14
+ 86.5 86.136 84.566 78.268 57.893 40.362 28.121 19.46 13.398 9.194 6.297 4.308 2.947 2.015 1.379 0.944 0.646 0.443 0.303 0.208 0.143 0.022 0.003 0 0
15
+ 86.5 86.136 84.566 78.268 57.893 40.362 28.121 19.46 13.398 9.194 6.297 4.308 2.947 2.015 1.379 0.944 0.646 0.443 0.303 0.208 0.143 0.022 0.003 0 0
16
+ 86.5 86.141 84.593 78.385 58.244 40.829 28.632 19.976 13.89 9.644 6.694 4.65 3.234 2.253 1.572 1.098 0.769 0.539 0.379 0.266 0.188 0.033 0.006 0.001 0
17
+ 86.5 86.15 84.645 78.617 58.949 41.773 29.667 21.023 14.894 10.567 7.516 5.362 3.837 2.755 1.984 1.433 1.038 0.753 0.548 0.399 0.292 0.061 0.013 0.003 0.001
18
+ 86.5 86.165 84.723 78.964 60.014 43.211 31.254 22.637 16.452 12.012 8.814 6.5 4.815 3.582 2.674 2.003 1.504 1.132 0.853 0.644 0.487 0.122 0.03 0.007 0.002
19
+ 86.5 86.184 84.827 79.423 61.447 45.175 33.437 24.875 18.631 14.056 10.676 8.158 6.265 4.832 3.739 2.901 2.256 1.757 1.37 1.07 0.836 0.245 0.072 0.02 0.005
20
+ 86.5 86.207 84.956 79.991 63.258 47.706 36.281 27.819 21.53 16.812 13.229 10.474 8.333 6.654 5.328 4.276 3.437 2.766 2.228 1.796 1.448 0.496 0.169 0.057 0.018
21
+ 86.5 86.235 85.11 80.663 65.457 50.859 39.878 31.586 25.29 20.444 16.654 13.646 11.229 9.269 7.669 6.355 5.273 4.379 3.639 3.025 2.516 1.003 0.399 0.157 0.06
22
+ 86.5 86.268 85.287 81.433 68.052 54.704 44.35 36.343 30.112 25.183 21.212 17.96 15.263 13.005 11.101 9.489 8.119 6.952 5.956 5.104 4.376 2.031 0.942 0.433 0.195
23
+ 86.5 86.306 85.488 82.297 71.046 59.325 49.868 42.327 36.288 31.369 27.285 23.838 20.892 18.352 16.146 14.222 12.539 11.063 9.765 8.624 7.618 4.11 2.22 1.196 0.638
24
+ 86.5 86.347 85.71 83.245 74.43 64.807 56.652 49.878 44.257 39.524 35.469 31.941 28.838 26.086 23.63 21.43 19.452 17.669 16.059 14.603 13.284 8.308 5.214 3.277 2.058
25
+ 86.5 86.394 85.954 84.268 78.175 71.212 64.955 59.464 54.678 50.47 46.724 43.353 40.296 37.506 34.95 32.6 30.434 28.431 26.577 24.858 23.26 16.78 12.191 8.912 6.556
26
+ 86.5 86.445 86.218 85.357 82.228 78.514 74.974 71.644 68.527 65.595 62.821 60.188 57.682 55.298 53.028 50.867 48.81 46.851 44.985 43.207 41.512 34.144 28.316 23.694 20.016
27
+ 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5 86.5