pub struct OpticalElf { /* private fields */ }Expand description
A tabulated optical energy-loss function ELF(ħω) = Im[-1/ε(ω)] of one
material, at zero momentum transfer.
The ELF is the quantity a dielectric-function inelastic model extends into momentum transfer (Ritchie, Phys. Rev. 106, 874 (1957); Penn, Phys. Rev. B 35, 482 (1987)). It is dimensionless.
Invariants (checked by OpticalElf::new and by every loader):
non-blank material and provenance; at least two samples; photon
energies ħω finite, positive and strictly increasing; ELF values finite
and non-negative (zero is allowed, e.g. inside a band gap), one per energy.
Interpolation is piecewise linear in (ħω, ELF). It reproduces the
tabulated values at the knots, never goes negative, and handles zero-valued
ELF (where log-log interpolation would fail). Queries outside
[ħω_min, ħω_max] are an ElectronDataError::OutOfRange error: nothing
is extrapolated here. Extrapolation to high energy (for example by a sum
rule or atomic photoabsorption data) belongs to a later physical model.
TOML form (all four keys required, no others accepted):
material = "Si"
provenance = "Author, Journal vol, page (year), Table N"
energy_ev = [1.0, 10.0, 16.7, 100.0]
elf = [0.0, 0.5, 4.0, 0.1]Implementations§
Source§impl OpticalElf
impl OpticalElf
Sourcepub fn new(
material: impl Into<String>,
provenance: impl Into<String>,
energy_ev: Vec<f64>,
elf: Vec<f64>,
) -> Result<Self, ElectronDataError>
pub fn new( material: impl Into<String>, provenance: impl Into<String>, energy_ev: Vec<f64>, elf: Vec<f64>, ) -> Result<Self, ElectronDataError>
Build a validated ELF table. See the type docs for the invariants.
Sourcepub fn from_toml_str(text: &str) -> Result<Self, ElectronDataError>
pub fn from_toml_str(text: &str) -> Result<Self, ElectronDataError>
Parse and validate the TOML form (see the type docs).
Sourcepub fn from_toml_file(path: impl AsRef<Path>) -> Result<Self, ElectronDataError>
pub fn from_toml_file(path: impl AsRef<Path>) -> Result<Self, ElectronDataError>
Load the TOML form from a file.
Sourcepub fn provenance(&self) -> &str
pub fn provenance(&self) -> &str
Provenance string (to be copied into run metadata).
Sourcepub fn elf_values(&self) -> &[f64]
pub fn elf_values(&self) -> &[f64]
Tabulated ELF values (dimensionless), one per energy.
Sourcepub fn energy_range_ev(&self) -> (f64, f64)
pub fn energy_range_ev(&self) -> (f64, f64)
The tabulated range (min, max) of ħω, eV.
Trait Implementations§
Source§impl Clone for OpticalElf
impl Clone for OpticalElf
Source§fn clone(&self) -> OpticalElf
fn clone(&self) -> OpticalElf
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OpticalElf
impl Debug for OpticalElf
Source§impl<'de> Deserialize<'de> for OpticalElf
impl<'de> Deserialize<'de> for OpticalElf
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for OpticalElf
impl PartialEq for OpticalElf
Source§impl Serialize for OpticalElf
impl Serialize for OpticalElf
impl StructuralPartialEq for OpticalElf
Auto Trait Implementations§
impl Freeze for OpticalElf
impl RefUnwindSafe for OpticalElf
impl Send for OpticalElf
impl Sync for OpticalElf
impl Unpin for OpticalElf
impl UnsafeUnpin for OpticalElf
impl UnwindSafe for OpticalElf
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more