@galihru/mnp-material 0.1.2 → 0.1.3

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 (2) hide show
  1. package/README.md +152 -219
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,220 +1,153 @@
1
- # @galihru/mnp-material
2
-
3
- Analytical dielectric-function models for metallic nanoparticles in the framework of plasmonic nanophotonics.
4
- Provides frequency-dependent permittivity evaluation via the Drude free-electron model, constant dielectric approximation, and wave-number computation — all operating natively in the wavelength domain (λ in nm).
5
-
6
- ---
7
-
8
- ## Physical Background
9
-
10
- The optical response of a metallic nanoparticle is governed by its frequency-dependent complex dielectric function ε(ω). This package implements three levels of approximation used in nanophotonics electrodynamics.
11
-
12
- ---
13
-
14
- ## Implemented Models
15
-
16
- ### 1. Energy–Wavelength Conversion
17
-
18
- All models accept wavelength in nanometres. The photon energy is obtained via:
19
-
20
- ![ω = C/λ](https://latex.codecogs.com/svg.latex?\omega\,[\mathrm{eV}]=\frac{C}{\lambda\,[\mathrm{nm}]},\quad%20C=1239.84\,\mathrm{eV{\cdot}nm})
21
-
22
- ---
23
-
24
- ### 2. Drude Free-Electron Model
25
-
26
- The Drude model describes the optical response of free-electron metals:
27
-
28
- ![ε(ω) = ε∞ - ωp²/(ω(ω+iγ))](https://latex.codecogs.com/svg.latex?\varepsilon(\omega)=\varepsilon_\infty-\frac{\omega_p^2}{\omega(\omega+i\gamma)})
29
-
30
- where:
31
- - **ε∞** interband (high-frequency) dielectric constant
32
- - **ωₚ** — bulk plasma frequency, derived from the Wigner–Seitz radius *rₛ*:
33
-
34
- ![ωp derived from rs](https://latex.codecogs.com/svg.latex?\rho_0=\frac{3}{4\pi%20r_s^3},\quad\omega_p=\sqrt{4\pi\rho_0}\times\mathcal{H})
35
-
36
- where *H* = 27.2116 eV (Hartree energy) converts atomic-unit plasma frequency to eV.
37
-
38
- - **γ** — phenomenological damping (Drude scattering rate)
39
-
40
- #### Built-in Material Parameters
41
-
42
- | Material | *rₛ* (a.u.) | ε∞ | γ (eV) | ωₚ (eV) |
43
- |---|---|---|---|---|
44
- | `Au` / `gold` | 3.00 | 10.0 | 0.066 | ~9.07 |
45
- | `Ag` / `silver` | 3.00 | 3.3 | 0.022 | ~9.07 |
46
- | `Al` / `aluminum` | 2.07 | 1.0 | 1.06 | ~15.8 |
47
-
48
- ---
49
-
50
- ### 3. Constant Dielectric Model
51
-
52
- For non-dispersive homogeneous embedding media (e.g. glass, water):
53
-
54
- ![ε(λ) = ε₀](https://latex.codecogs.com/svg.latex?\varepsilon(\lambda)=\varepsilon_0\in\mathbb{C})
55
-
56
- ---
57
-
58
- ### 4. Wave Number in Medium
59
-
60
- The complex wave number for light propagating in a dielectric medium:
61
-
62
- ![k(λ) = (2π/λ)√ε](https://latex.codecogs.com/svg.latex?k(\lambda)=\frac{2\pi}{\lambda}\sqrt{\varepsilon(\lambda)})
63
-
64
- ---
65
-
66
- ## Install
67
-
68
- ```bash
69
- npm install @galihru/mnp-material
70
- ```
71
-
72
- ---
73
-
74
- ## API Reference
75
-
76
- ### `drudeEpsilon(materialName, wavelengthNm)`
77
-
78
- Evaluates the Drude dielectric function for a built-in metal.
79
-
80
- ```js
81
- import { drudeEpsilon } from "@galihru/mnp-material";
82
-
83
- // Single wavelength
84
- const eps = drudeEpsilon("Au", 548.1);
85
- // → { re: -7.45, im: 1.23 }
86
-
87
- // Array of wavelengths
88
- const spectra = drudeEpsilon("Ag", [400, 500, 600, 700]);
89
- // → [{ re, im }, ...]
90
- ```
91
-
92
- ---
93
-
94
- ### `makeDrudeMaterial(name)`
95
-
96
- Returns raw Drude parameters for a given metal.
97
-
98
- ```js
99
- import { makeDrudeMaterial } from "@galihru/mnp-material";
100
-
101
- const au = makeDrudeMaterial("Au");
102
- // → { name: "Au", eps0: 10.0, gammad: 0.066, wp: 9.07 }
103
- ```
104
-
105
- ---
106
-
107
- ### `constantEpsilon(value, wavelengthNm)`
108
-
109
- Returns a constant complex permittivity independent of frequency.
110
-
111
- ```js
112
- import { constantEpsilon } from "@galihru/mnp-material";
113
-
114
- // Water: n ≈ 1.33, ε = n² = 1.769
115
- const epsWater = constantEpsilon(1.769, 548.1);
116
- // → { re: 1.769, im: 0 }
117
- ```
118
-
119
- ---
120
-
121
- ### `wavenumberInMedium(wavelengthNm, epsilonComplex)`
122
-
123
- Computes the complex wave number k = (2π/λ)√ε.
124
-
125
- ```js
126
- import { constantEpsilon, wavenumberInMedium } from "@galihru/mnp-material";
127
-
128
- const eps = constantEpsilon(1.769, 548.1);
129
- const k = wavenumberInMedium(548.1, eps);
130
- // { re: ..., im: ... } [nm⁻¹]
131
- ```
132
-
133
- ---
134
-
135
- ### Complex Arithmetic Utilities
136
-
137
- ```js
138
- import { complex, add, sub, mul, div, sqrtComplex, fromReal } from "@galihru/mnp-material";
139
-
140
- const z1 = complex(-5.2, 1.3); // -5.2 + 1.3i
141
- const z2 = fromReal(2.0); // 2.0 + 0i
142
- const prod = mul(z1, z2); // → { re: -10.4, im: 2.6 }
143
- ```
144
-
145
- ---
146
-
147
- ## Author
148
-
149
- **GALIH RIDHO UTOMO** · g4lihru@students.unnes.ac.id
150
- University of Semarang State (UNNES)
1
+ # @galihru/mnp-material
2
+
3
+ Analytical dielectric-function models for metallic nanoparticles in the framework of plasmonic nanophotonics. Provides frequency-dependent complex permittivity via the Drude free-electron model and constant dielectric approximation, with complex wave-number computation � all operating natively in the wavelength domain (?, nm).
4
+
5
+ ---
6
+
7
+ ## Physical Background
8
+
9
+ The optical response of a metallic nanoparticle is governed by its frequency-dependent complex dielectric function e(?). This package implements two analytical models and the wave-number relation used in electrodynamic simulations.
10
+
11
+ ---
12
+
13
+ ## Implemented Models
14
+
15
+ ### 1. Energy�Wavelength Conversion
16
+
17
+ All models accept wavelength in nanometres. The photon energy is computed as:
18
+
19
+ ![? = C/?](https://latex.codecogs.com/svg.latex?\omega\,[\mathrm{eV}]=\frac{C}{\lambda\,[\mathrm{nm}]},\quad%20C=1239.841984\,\mathrm{eV{\cdot}nm})
20
+
21
+ ---
22
+
23
+ ### 2. Drude Free-Electron Model
24
+
25
+ Describes the dielectric response of free-electron metals:
26
+
27
+ ![e(?) = e8 - ?p�/(?(?+i?))](https://latex.codecogs.com/svg.latex?\varepsilon(\omega)=\varepsilon_\infty-\frac{\omega_p^2}{\omega(\omega+i\gamma)})
28
+
29
+ **Parameters:**
30
+ - **e8** � high-frequency (interband) dielectric constant
31
+ - **??** bulk plasma frequency, derived from electron density via the Wigner�Seitz radius *r?*:
32
+
33
+ ![?p from rs](https://latex.codecogs.com/svg.latex?\rho_0=\frac{3}{4\pi%20r_s^3},\qquad\omega_p=\sqrt{4\pi\rho_0}\times%2027.2116\,\mathrm{eV})
34
+
35
+ - **?** � phenomenological Drude damping rate (scattering)
36
+
37
+ **Built-in material table:**
38
+
39
+ | Material | *r?* (a.u.) | e8 | ? (eV) | ?? (eV) |
40
+ |---|---|---|---|---|
41
+ | `Au` / `gold` | 3.00 | 10.0 | 0.066 | ~9.07 |
42
+ | `Ag` / `silver` | 3.00 | 3.3 | 0.022 | ~9.07 |
43
+ | `Al` / `aluminum` | 2.07 | 1.0 | 1.06 | ~15.8 |
44
+
45
+ ---
46
+
47
+ ### 3. Constant Dielectric Model
48
+
49
+ For non-dispersive homogeneous embedding media (glass, water, vacuum):
50
+
51
+ ![e(?) = e0](https://latex.codecogs.com/svg.latex?\varepsilon(\lambda)=\varepsilon_0,\quad\varepsilon_0\in\mathbb{C})
52
+
53
+ ---
54
+
55
+ ### 4. Wave Number in Medium
56
+
57
+ Complex wave number for light propagating through a dielectric:
58
+
59
+ ![k(?) = (2p/?)ve](https://latex.codecogs.com/svg.latex?k(\lambda)=\frac{2\pi}{\lambda}\sqrt{\varepsilon(\lambda)}\quad[\mathrm{nm}^{-1}])
60
+
61
+ ---
62
+
63
+ ## Install
64
+
65
+ ```bash
66
+ npm install @galihru/mnp-material
67
+ ```
68
+
69
+ ---
70
+
71
+ ## API Reference
72
+
73
+ ### `drudeEpsilon(materialName, wavelengthNm)`
74
+
75
+ Returns the complex Drude permittivity for a built-in metal at one or multiple wavelengths.
76
+
77
+ ```js
78
+ import { drudeEpsilon } from "@galihru/mnp-material";
79
+
80
+ // Single wavelength ? { re, im }
81
+ const eps = drudeEpsilon("Au", 548.1);
82
+
83
+ // Wavelength array ? [{ re, im }, ...]
84
+ const spectra = drudeEpsilon("Ag", [400, 500, 600, 700]);
85
+ ```
86
+
87
+ ---
88
+
89
+ ### `makeDrudeMaterial(name)`
90
+
91
+ Returns the raw Drude parameter object for a given metal name.
92
+
93
+ ```js
94
+ import { makeDrudeMaterial } from "@galihru/mnp-material";
95
+
96
+ const au = makeDrudeMaterial("Au");
97
+ // ? { name: "Au", eps0: 10.0, gammad: 0.066, wp: 9.07 }
98
+ ```
99
+
100
+ ---
101
+
102
+ ### `constantEpsilon(value, wavelengthNm)`
103
+
104
+ Returns a wavelength-independent complex permittivity.
105
+
106
+ ```js
107
+ import { constantEpsilon } from "@galihru/mnp-material";
108
+
109
+ // Water: n = 1.33 ? e = n� � 1.769
110
+ const epsWater = constantEpsilon(1.769, 548.1);
111
+ // ? { re: 1.769, im: 0 }
112
+ ```
113
+
114
+ ---
115
+
116
+ ### `wavenumberInMedium(wavelengthNm, epsilonComplex)`
117
+
118
+ Computes the complex wave number k = (2p/?)ve.
119
+
120
+ ```js
121
+ import { constantEpsilon, wavenumberInMedium } from "@galihru/mnp-material";
122
+
123
+ const eps = constantEpsilon(1.769, 548.1);
124
+ const k = wavenumberInMedium(548.1, eps);
125
+ // ? { re: ..., im: ... } [nm?�]
126
+ ```
127
+
128
+ ---
129
+
130
+ ### Complex Arithmetic Utilities
131
+
132
+ ```js
133
+ import { complex, add, sub, mul, div, sqrtComplex, fromReal } from "@galihru/mnp-material";
134
+
135
+ const z1 = complex(-5.2, 1.3); // -5.2 + 1.3i
136
+ const z2 = fromReal(2.0); // 2.0 + 0i
137
+ const prod = mul(z1, z2); // ? { re: -10.4, im: 2.6 }
138
+ const root = sqrtComplex(z1); // ? { re: ..., im: ... }
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Keywords
144
+
145
+ plasmonics � dielectric-function � drude-model � nanoparticle � nanophotonics � permittivity � gold � silver � electrodynamics � optics
146
+
147
+ ---
148
+
149
+ ## Author
150
+
151
+ **GALIH RIDHO UTOMO** � g4lihru@students.unnes.ac.id
152
+ Universitas Negeri Semarang (UNNES)
151
153
  License: GPL-2.0-only
152
-
153
-
154
- ## Features
155
-
156
- - Constant dielectric model for homogeneous media
157
- - Drude free-electron model for metals (Au, Ag, Al)
158
- - Tabulated `(E, n, k)` optical constants with wavelength interpolation
159
- - Complex arithmetic utilities
160
-
161
- ## Implemented Formulations
162
-
163
- ### Constant Dielectric
164
-
165
- ![ε(λ) = ε₀](https://latex.codecogs.com/svg.latex?\varepsilon(\lambda)=\varepsilon_0)
166
-
167
- Wave number in medium:
168
-
169
- ![k(λ) = (2π/λ)√ε](https://latex.codecogs.com/svg.latex?k(\lambda)=\frac{2\pi}{\lambda}\sqrt{\varepsilon})
170
-
171
- ### Drude Model
172
-
173
- For free-electron metals (Au, Ag, Al):
174
-
175
- ![ε(ω) = ε∞ - ωp²/(ω(ω+iγ))](https://latex.codecogs.com/svg.latex?\varepsilon(\omega)=\varepsilon_\infty-\frac{\omega_p^2}{\omega(\omega+i\gamma)})
176
-
177
- Energy–wavelength conversion:
178
-
179
- ![ω_eV = 1239.84 / λ_nm](https://latex.codecogs.com/svg.latex?\omega_{\mathrm{eV}}=\frac{1239.84}{\lambda_{\mathrm{nm}}})
180
-
181
- ### Tabulated Material
182
-
183
- Given tabulated optical constants `(E, n, k)`:
184
-
185
- ![ε = (n + ik)²](https://latex.codecogs.com/svg.latex?\varepsilon=(n+ik)^2)
186
-
187
- ## Install
188
-
189
- ```bash
190
- npm install @galihru/mnp-material
191
- ```
192
-
193
- ## API
194
-
195
- ```js
196
- import {
197
- constantEpsilon,
198
- drudeEpsilon,
199
- makeDrudeMaterial,
200
- wavenumberInMedium,
201
- complex, add, sub, mul, div, sqrtComplex,
202
- EV_TO_NM, HARTREE_EV
203
- } from "@galihru/mnp-material";
204
-
205
- // Drude model for gold at 548.1 nm
206
- const epsAu = drudeEpsilon("Au", 548.1);
207
- console.log(epsAu); // { re: ..., im: ... }
208
-
209
- // Constant dielectric (water, n ≈ 1.33)
210
- const epsWater = constantEpsilon(1.33 ** 2, 548.1);
211
-
212
- // Wave number in medium
213
- const k = wavenumberInMedium(epsWater, 548.1);
214
- ```
215
-
216
- ## Author
217
-
218
- **GALIH RIDHO UTOMO** — g4lihru@students.unnes.ac.id
219
- License: GPL-2.0-only
220
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galihru/mnp-material",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Analytical dielectric-function models for metallic nanoparticles in plasmonic nanophotonics.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",