Neon / example.py
Herrprofessor's picture
Upload folder using huggingface_hub
aed74e2 verified
from __future__ import annotations
import sys
from pathlib import Path
try:
from neon import Neon
except ImportError:
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
from neon import Neon
def main() -> None:
model = Neon.from_pretrained()
cases = [
{"thickness": 0.12, "epsilon_real": 2.05, "wavelength": 0.84},
{"thickness": 0.28, "epsilon_real": 2.56, "wavelength": 0.80},
{"thickness": 0.46, "epsilon_real": 4.00, "wavelength": 0.84},
]
for index, case in enumerate(cases, start=1):
result = model.predict(**case)
print(
f"Case {index}: thickness={case['thickness']:.2f} um, "
f"epsilon_real={case['epsilon_real']:.2f}, wavelength={case['wavelength']:.2f} um"
)
print(
f" transmission={result['transmission']:.6f}, "
f"reflection={result['reflection']:.6f}, intensity={result['intensity']:.6f}"
)
# For verification, rerun the matching slab configuration with the direct Neon solver
# and compare the resulting summary.csv transmission, reflection, and peak intensity values.
if __name__ == "__main__":
main()