ElectroMagneticPython 2.1.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.
EMpy/__init__.py ADDED
@@ -0,0 +1,39 @@
1
+ """EMpy: Electromagnetic Python.
2
+
3
+ The package contains some useful routines to study electromagnetic problems with Python.
4
+
5
+ 1. An implementation of the L{Transfer Matrix<EMpy.transfer_matrix>} algorithm, both isotropic and anisotropic.
6
+ 2. An implementation of the L{Rigorous Coupled Wave Analysis<EMpy.RCWA>}, both isotropic and anisotropic.
7
+ 3. A collection of L{Modesolvers<EMpy.modesolvers>} to find modes of optical waveguides.
8
+ 4. A library of L{materials<EMpy.materials>}.
9
+
10
+ It is based on U{numpy<http://numpy.scipy.org>} and U{scipy<http://www.scipy.org>}.
11
+
12
+ """
13
+ __all__ = [
14
+ "constants",
15
+ "devices",
16
+ "materials",
17
+ "modesolvers",
18
+ "RCWA",
19
+ "scattering",
20
+ "transfer_matrix",
21
+ "utils",
22
+ ]
23
+ __author__ = "Lorenzo Bolla"
24
+
25
+ from numpy.testing import Tester # type: ignore
26
+
27
+ from . import constants
28
+ from . import devices
29
+ from . import materials
30
+ from . import modesolvers
31
+ from . import RCWA
32
+ from . import scattering
33
+ from . import transfer_matrix
34
+ from . import utils
35
+ from .version import version
36
+
37
+ __version__ = version
38
+
39
+ test = Tester().test
EMpy/constants.py ADDED
@@ -0,0 +1,25 @@
1
+ # pylint: disable=C0301
2
+
3
+ """Useful constants.
4
+
5
+ Constants used in mathematics and electromagnetism.
6
+
7
+ @var c: U{Speed of light<http://en.wikipedia.org/wiki/Speed_of_light>} [m/s].
8
+ @var mu0: U{Magnetic Permeability<http://en.wikipedia.org/wiki/Permeability_(electromagnetism)>} [N/A^2].
9
+ @var eps0: U{Electric Permettivity<http://en.wikipedia.org/wiki/Permittivity>} [F/m].
10
+ @var h: U{Plank's constant<http://en.wikipedia.org/wiki/Plank%27s_constant>} [W s^2].
11
+ @var k: U{Boltzmann's constant<http://en.wikipedia.org/wiki/Boltzmann_constant>} [J/K].
12
+
13
+ """
14
+
15
+ __author__ = "Lorenzo Bolla"
16
+
17
+ from numpy import pi
18
+
19
+ c = 299792458.0
20
+ mu0 = 4 * pi * 1e-7
21
+ eps0 = 1.0 / (c**2 * mu0)
22
+
23
+ h = 6.62606896e-34
24
+ h_bar = h / (2 * pi)
25
+ k = 1.3806504e-23