treams
Advanced tools
+4
-3
@@ -15,4 +15,5 @@ ===== | ||
| 1. `D. Beutel, I. Fernandez-Corbaton, and C. Rockstuhl, Unified Lattice Sums Accommodating Multiple Sublattices for Solutions of the Helmholtz Equation in Two and Three Dimensions, Phys. Rev. A 107, 013508 (2023). <https://doi.org/10.1103/PhysRevA.107.013508>`_ | ||
| 2. `D. Beutel, P. Scott, M. Wegener, C. Rockstuhl, and I. Fernandez-Corbaton, Enhancing the Optical Rotation of Chiral Molecules Using Helicity Preserving All-Dielectric Metasurfaces, Appl. Phys. Lett. 118, 221108 (2021). <https://doi.org/10.1063/5.0050411>`_ | ||
| 3. `D. Beutel, A. Groner, C. Rockstuhl, C. Rockstuhl, and I. Fernandez-Corbaton, Efficient Simulation of Biperiodic, Layered Structures Based on the T-Matrix Method, J. Opt. Soc. Am. B, JOSAB 38, 1782 (2021). <https://doi.org/10.1364/JOSAB.419645>`_ | ||
| 1. `D. Beutel, I. Fernandez-Corbaton, and C. Rockstuhl, treams -- A T-matrix scattering code for nanophotonic computations, arXiv (preprint), 2309.03182 (2023). <https://doi.org/10.48550/arXiv.2309.03182>`_ | ||
| 2. `D. Beutel, I. Fernandez-Corbaton, and C. Rockstuhl, Unified Lattice Sums Accommodating Multiple Sublattices for Solutions of the Helmholtz Equation in Two and Three Dimensions, Phys. Rev. A 107, 013508 (2023). <https://doi.org/10.1103/PhysRevA.107.013508>`_ | ||
| 3. `D. Beutel, P. Scott, M. Wegener, C. Rockstuhl, and I. Fernandez-Corbaton, Enhancing the Optical Rotation of Chiral Molecules Using Helicity Preserving All-Dielectric Metasurfaces, Appl. Phys. Lett. 118, 221108 (2021). <https://doi.org/10.1063/5.0050411>`_ | ||
| 4. `D. Beutel, A. Groner, C. Rockstuhl, C. Rockstuhl, and I. Fernandez-Corbaton, Efficient Simulation of Biperiodic, Layered Structures Based on the T-Matrix Method, J. Opt. Soc. Am. B, JOSAB 38, 1782 (2021). <https://doi.org/10.1364/JOSAB.419645>`_ |
@@ -12,3 +12,3 @@ .. highlight:: console | ||
| pip install git+https://github.com/tfp-photonics/treams.git | ||
| pip install treams | ||
@@ -15,0 +15,0 @@ |
+12
-3
| Metadata-Version: 2.1 | ||
| Name: treams | ||
| Version: 0.4.0 | ||
| Version: 0.4.1 | ||
| Summary: "T-matrix scattering code for nanophotonic computations" | ||
@@ -31,7 +31,15 @@ Home-page: https://github.com/tfp-photonics/treams | ||
| Description-Content-Type: text/markdown | ||
| License-File: LICENSE | ||
| Requires-Dist: numpy | ||
| Requires-Dist: scipy>=1.6 | ||
| Provides-Extra: coverage | ||
| Requires-Dist: Cython; extra == "coverage" | ||
| Requires-Dist: pytest-cov; extra == "coverage" | ||
| Provides-Extra: docs | ||
| Requires-Dist: matplotlib; extra == "docs" | ||
| Requires-Dist: sphinx; extra == "docs" | ||
| Provides-Extra: io | ||
| Requires-Dist: h5py; extra == "io" | ||
| Provides-Extra: test | ||
| License-File: LICENSE | ||
| Requires-Dist: pytest; extra == "test" | ||
@@ -74,3 +82,3 @@  | ||
| [D. Beutel, A. Groner, C. Rockstuhl, C. Rockstuhl, and I. Fernandez-Corbaton, Efficient Simulation of Biperiodic, Layered Structures Based on the T-Matrix Method, J. Opt. Soc. Am. B, JOSAB 38, 1782 (2021).](https://doi.org/10.1364/JOSAB.419645) | ||
| [D. Beutel, I. Fernandez-Corbaton, and C. Rockstuhl, treams - A T-matrix scattering code for nanophotonic computations, arXiv (preprint), 2309.03182 (2023).](https://doi.org/10.48550/arXiv.2309.03182) | ||
@@ -80,2 +88,3 @@ Other relevant publications are | ||
| * [D. Beutel, P. Scott, M. Wegener, C. Rockstuhl, and I. Fernandez-Corbaton, Enhancing the Optical Rotation of Chiral Molecules Using Helicity Preserving All-Dielectric Metasurfaces, Appl. Phys. Lett. 118, 221108 (2021).](https://doi.org/10.1063/5.0050411) | ||
| * [D. Beutel, A. Groner, C. Rockstuhl, C. Rockstuhl, and I. Fernandez-Corbaton, Efficient Simulation of Biperiodic, Layered Structures Based on the T-Matrix Method, J. Opt. Soc. Am. B, JOSAB 38, 1782 (2021).](https://doi.org/10.1364/JOSAB.419645) | ||
@@ -82,0 +91,0 @@ |
+2
-1
@@ -37,3 +37,3 @@  | ||
| [D. Beutel, A. Groner, C. Rockstuhl, C. Rockstuhl, and I. Fernandez-Corbaton, Efficient Simulation of Biperiodic, Layered Structures Based on the T-Matrix Method, J. Opt. Soc. Am. B, JOSAB 38, 1782 (2021).](https://doi.org/10.1364/JOSAB.419645) | ||
| [D. Beutel, I. Fernandez-Corbaton, and C. Rockstuhl, treams - A T-matrix scattering code for nanophotonic computations, arXiv (preprint), 2309.03182 (2023).](https://doi.org/10.48550/arXiv.2309.03182) | ||
@@ -43,2 +43,3 @@ Other relevant publications are | ||
| * [D. Beutel, P. Scott, M. Wegener, C. Rockstuhl, and I. Fernandez-Corbaton, Enhancing the Optical Rotation of Chiral Molecules Using Helicity Preserving All-Dielectric Metasurfaces, Appl. Phys. Lett. 118, 221108 (2021).](https://doi.org/10.1063/5.0050411) | ||
| * [D. Beutel, A. Groner, C. Rockstuhl, C. Rockstuhl, and I. Fernandez-Corbaton, Efficient Simulation of Biperiodic, Layered Structures Based on the T-Matrix Method, J. Opt. Soc. Am. B, JOSAB 38, 1782 (2021).](https://doi.org/10.1364/JOSAB.419645) | ||
@@ -45,0 +46,0 @@ |
| Metadata-Version: 2.1 | ||
| Name: treams | ||
| Version: 0.4.0 | ||
| Version: 0.4.1 | ||
| Summary: "T-matrix scattering code for nanophotonic computations" | ||
@@ -31,7 +31,15 @@ Home-page: https://github.com/tfp-photonics/treams | ||
| Description-Content-Type: text/markdown | ||
| License-File: LICENSE | ||
| Requires-Dist: numpy | ||
| Requires-Dist: scipy>=1.6 | ||
| Provides-Extra: coverage | ||
| Requires-Dist: Cython; extra == "coverage" | ||
| Requires-Dist: pytest-cov; extra == "coverage" | ||
| Provides-Extra: docs | ||
| Requires-Dist: matplotlib; extra == "docs" | ||
| Requires-Dist: sphinx; extra == "docs" | ||
| Provides-Extra: io | ||
| Requires-Dist: h5py; extra == "io" | ||
| Provides-Extra: test | ||
| License-File: LICENSE | ||
| Requires-Dist: pytest; extra == "test" | ||
@@ -74,3 +82,3 @@  | ||
| [D. Beutel, A. Groner, C. Rockstuhl, C. Rockstuhl, and I. Fernandez-Corbaton, Efficient Simulation of Biperiodic, Layered Structures Based on the T-Matrix Method, J. Opt. Soc. Am. B, JOSAB 38, 1782 (2021).](https://doi.org/10.1364/JOSAB.419645) | ||
| [D. Beutel, I. Fernandez-Corbaton, and C. Rockstuhl, treams - A T-matrix scattering code for nanophotonic computations, arXiv (preprint), 2309.03182 (2023).](https://doi.org/10.48550/arXiv.2309.03182) | ||
@@ -80,2 +88,3 @@ Other relevant publications are | ||
| * [D. Beutel, P. Scott, M. Wegener, C. Rockstuhl, and I. Fernandez-Corbaton, Enhancing the Optical Rotation of Chiral Molecules Using Helicity Preserving All-Dielectric Metasurfaces, Appl. Phys. Lett. 118, 221108 (2021).](https://doi.org/10.1063/5.0050411) | ||
| * [D. Beutel, A. Groner, C. Rockstuhl, C. Rockstuhl, and I. Fernandez-Corbaton, Efficient Simulation of Biperiodic, Layered Structures Based on the T-Matrix Method, J. Opt. Soc. Am. B, JOSAB 38, 1782 (2021).](https://doi.org/10.1364/JOSAB.419645) | ||
@@ -82,0 +91,0 @@ |
@@ -29,2 +29,3 @@ """TREAMS: T-Matrix scattering code for nanophotonic computations. | ||
| SMatrix | ||
| SMatrices | ||
| TMatrix | ||
@@ -50,2 +51,3 @@ TMatrixC | ||
| changepoltype | ||
| chirality_density | ||
| dfield | ||
@@ -57,2 +59,3 @@ efield | ||
| permute | ||
| plane_wave | ||
| rotate | ||
@@ -59,0 +62,0 @@ translate |
+38
-11
@@ -176,3 +176,3 @@ import copy | ||
| @classmethod | ||
| def interface(cls, basis, k0, materials): | ||
| def interface(cls, basis, k0, materials, poltype=None): | ||
| """Planar interface between two media. | ||
@@ -184,2 +184,3 @@ | ||
| materials (Sequence[Material]): Material definitions. | ||
| poltype (str, optional): Polarization type (:ref:`params:Polarizations`). | ||
@@ -189,2 +190,3 @@ Returns: | ||
| """ | ||
| poltype = config.POLTYPE if poltype is None else poltype | ||
| materials = tuple(map(Material, materials)) | ||
@@ -217,6 +219,14 @@ ks = np.array([m.ks(k0) for m in materials]) | ||
| qs[:, :, ii, i] = vals[:, :, pol2, pol] | ||
| return cls(qs, k0=k0, basis=basis, material=materials[::-1], poltype="helicity") | ||
| res = cls(qs, k0=k0, basis=basis, material=materials[::-1], poltype="helicity") | ||
| if poltype == "helicity": | ||
| return res | ||
| res = res.changepoltype(poltype) | ||
| res[0, 0][~np.eye(len(res), dtype=bool)] = 0 | ||
| res[0, 1][~np.eye(len(res), dtype=bool)] = 0 | ||
| res[1, 0][~np.eye(len(res), dtype=bool)] = 0 | ||
| res[1, 1][~np.eye(len(res), dtype=bool)] = 0 | ||
| return res | ||
| @classmethod | ||
| def slab(cls, thickness, basis, k0, materials): | ||
| def slab(cls, thickness, basis, k0, materials, poltype=None): | ||
| """Slab of material. | ||
@@ -235,2 +245,3 @@ | ||
| positive z. | ||
| poltype (str, optional): Polarization type (:ref:`params:Polarizations`). | ||
@@ -244,9 +255,10 @@ Returns: | ||
| thickness = [thickness] | ||
| res = cls.interface(basis, k0, materials[:2]) | ||
| poltype = config.POLTYPE if poltype is None else poltype | ||
| res = cls.interface(basis, k0, materials[:2], poltype) | ||
| for d, ma, mb in zip(thickness, materials[1:-1], materials[2:]): | ||
| if np.ndim(d) == 0: | ||
| d = [0, 0, d] | ||
| x = cls.propagation(d, basis, k0, ma) | ||
| x = cls.propagation(d, basis, k0, ma, poltype) | ||
| res = res.add(x) | ||
| res = res.add(cls.interface(basis, k0, (ma, mb))) | ||
| res = res.add(cls.interface(basis, k0, (ma, mb), poltype)) | ||
| return res | ||
@@ -274,3 +286,3 @@ | ||
| @classmethod | ||
| def propagation(cls, r, basis, k0, material=Material()): | ||
| def propagation(cls, r, basis, k0, material=Material(), poltype=None): | ||
| """S-matrix for the propagation along a distance. | ||
@@ -285,2 +297,3 @@ | ||
| material (Material, optional): Material definition. | ||
| poltype (str, optional): Polarization type (:ref:`params:Polarizations`). | ||
@@ -290,9 +303,23 @@ Returns: | ||
| """ | ||
| sup = translate(r, basis=basis, k0=k0, material=material, modetype="up") | ||
| poltype = config.POLTYPE if poltype is None else poltype | ||
| sup = translate( | ||
| r, basis=basis, k0=k0, material=material, modetype="up", poltype=poltype | ||
| ) | ||
| sdown = translate( | ||
| np.negative(r), basis=basis, k0=k0, material=material, modetype="down" | ||
| np.negative(r), | ||
| basis=basis, | ||
| k0=k0, | ||
| material=material, | ||
| modetype="down", | ||
| poltype=poltype, | ||
| ) | ||
| zero = np.zeros_like(sup) | ||
| material = Material(material) | ||
| return cls([[sup, zero], [zero, sdown]], basis=basis, k0=k0, material=material) | ||
| return cls( | ||
| [[sup, zero], [zero, sdown]], | ||
| basis=basis, | ||
| k0=k0, | ||
| material=material, | ||
| poltype=poltype, | ||
| ) | ||
@@ -361,3 +388,3 @@ @classmethod | ||
| for _ in range(n): | ||
| res = res.add(self) | ||
| res = res.add(res) | ||
| return res | ||
@@ -364,0 +391,0 @@ |
@@ -793,11 +793,19 @@ import warnings | ||
| raise ValueError(f"invalid 'modetype': {modetype}") | ||
| kzs = Material(material).kzs(k0, *kpar, [0, 1]) | ||
| kvecs = np.array(basis.kvecs(k0, material, modetype)) | ||
| poltype = config.POLTYPE if poltype is None else poltype | ||
| if poltype == "parity": | ||
| kvec = kvecs[:, basis.index((kpar[0], kpar[1], 0))] | ||
| pol = [ | ||
| -sc.vpw_M(*kpar, kzs[0], 0, 0, 0) @ pol, | ||
| sc.vpw_N(*kpar, kzs[1], 0, 0, 0) @ pol, | ||
| -sc.vpw_M(*kvec, 0, 0, 0) @ pol, | ||
| sc.vpw_N(*kvec, 0, 0, 0) @ pol, | ||
| ] | ||
| elif poltype == "helicity": | ||
| pol = sc.vpw_A(*kpar, kzs[::-1], 0, 0, 0, [1, 0]) @ pol | ||
| kvec = kvecs[ | ||
| :, | ||
| [ | ||
| basis.index((kpar[0], kpar[1], 1)), | ||
| basis.index((kpar[0], kpar[1], 0)), | ||
| ], | ||
| ] | ||
| pol = sc.vpw_A(*kvec, 0, 0, 0, [1, 0]) @ pol | ||
| else: | ||
@@ -861,3 +869,3 @@ raise ValueError(f"invalid 'poltype': {poltype}") | ||
| poltype (str, optional): Polarization type (see | ||
| :ref:`polarization:Polarizations`). | ||
| :ref:`params:Polarizations`). | ||
| """ | ||
@@ -864,0 +872,0 @@ if len(kvec) == 2: |
@@ -43,3 +43,3 @@ import numpy as np | ||
| la.lsumsw1d(l, k, kpar, a, r, 0), | ||
| np.sum(la.dsumsw1d(l, k, kpar, a, r, np.arange(1_100_000))), | ||
| np.sum(la.dsumsw1d(l, k, kpar, a, r, np.arange(1_300_000))), | ||
| rel_tol=0.05, | ||
@@ -72,3 +72,3 @@ abs_tol=EPSSQ, | ||
| la.lsumcw1d(l, k, kpar, a, r, 0), | ||
| np.sum(la.dsumcw1d(l, k, kpar, a, r, np.arange(1_600_000))), | ||
| np.sum(la.dsumcw1d(l, k, kpar, a, r, np.arange(2_000_000))), | ||
| rel_tol=0.05, | ||
@@ -458,3 +458,3 @@ abs_tol=EPSSQ, | ||
| la.lsumsw1d_shift(*lm, k, kpar, a, r, 0), | ||
| la.dsumsw1d_shift(*lm, k, kpar, a, r, np.arange(2_200_000)).sum(), | ||
| la.dsumsw1d_shift(*lm, k, kpar, a, r, np.arange(700_000)).sum(), | ||
| rel_tol=1e-1, | ||
@@ -466,3 +466,3 @@ abs_tol=EPS, | ||
| la.lsumsw1d_shift(*lm, k, kpar, a, r, 0), | ||
| la.dsumsw1d_shift(*lm, k, kpar, a, r, np.arange(800_000)).sum(), | ||
| la.dsumsw1d_shift(*lm, k, kpar, a, r, np.arange(1_100_000)).sum(), | ||
| rel_tol=1e-1, | ||
@@ -469,0 +469,0 @@ abs_tol=EPS, |
@@ -263,3 +263,3 @@ import numpy as np | ||
| la.lsumsw2d_shift(6, 0, 2 * np.pi, [0, 0], a, [0.2, 0.2, 0.1], 0), | ||
| 110.69823590056764 - 138.74329901305353j, | ||
| 554145.857367349-554173.9024304616j, | ||
| ) | ||
@@ -311,3 +311,3 @@ | ||
| la.lsumsw1d_shift(6, 0, 2 * np.pi, 0, 1, [0.2, 0.2, 0.1], 0), | ||
| -0.3552853450806117 - 25.183882160999745j, | ||
| -0.3552862673579646-24.943884092634878j, | ||
| ) | ||
@@ -369,3 +369,3 @@ | ||
| la.lsumcw1d_shift(6, 2 * np.pi, 0, 1, [0.2, 0.1], 0), | ||
| -224.72932005925895 + 675.8601828886733j, | ||
| -1743317.7346371387+1743768.8654999665j, | ||
| 1e-5, | ||
@@ -372,0 +372,0 @@ ) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
16467227
0.04%13003
0.31%