optical-beams-meep

Simulation of reflection and refraction of polarized opticial beams at plane and curved dielectric interfaces.

https://github.com/danielkotik/optical-beams-meep

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.4%) to scientific vocabulary

Keywords

airy-beams cython fdtd gaussian-beams laguerre-gaussian meep numerical-codes optics python scheme simulation
Last synced: 6 months ago · JSON representation ·

Repository

Simulation of reflection and refraction of polarized opticial beams at plane and curved dielectric interfaces.

Basic Info
Statistics
  • Stars: 26
  • Watchers: 3
  • Forks: 12
  • Open Issues: 15
  • Releases: 12
Topics
airy-beams cython fdtd gaussian-beams laguerre-gaussian meep numerical-codes optics python scheme simulation
Created almost 9 years ago · Last pushed over 2 years ago
Metadata Files
Readme License Citation

README.md

concave planar convex Airy

snap snap snap Airy

Optical-beams-MEEP

DOI Binder PyMeep Meep libctl Guile docs

FDTD simulation of reflection and refraction of polarised optical beams at plane and curved dielectric interfaces based on Meep as underlying FDTD simulation software package. A mathematical description of the currently implemented beam profiles is outlined in this Jupyter notebook.

The provided files (and features) are: * Scheme/Python configuration files for Gaussian beams (2d) impinging upon planar, concave and convex dielectric interfaces * Scheme/Python configuration file for Laguerre-Gaussian (vortex) beams (3d) impinging upon a planar dielectric interface * Scheme/Python configuration file for Airy beams (2d) impinging upon a planar dielectric interface * Python scripts for enhanced visualisation and analysis of the generated HDF5 output files * The waist/focus of the beams can be placed anywhere along the propagation direction - independently of the location of the source current distribution

Originally, these files have been used in studying optical beam shifts providing independent numerical simulations. With regards to their scriptability, together with the ease and widespread use of the powerful Meep tool, these scripts can easily be adapted to other and possibly more complicated beam/interface setups.

This repository is structured as follows:

├── docs : Sphinx documentation folder ├── optbeam : Cython package with exact implementations of optical beams └── scripts : Python and Scheme scripts to use together with optbeam+PyMeep/Meep

Installation of PyMeep and optbeam

We highly recommend to install the parallel version of PyMeep via Conda:

```shell

create conda virtual environment "pmp"

$ conda create -n pmp -c conda-forge pymeep==mpimpich scipy cython

next command is optional, but recommended to enforce environment isolation (no local

user site packages in conda environment that may shadow conda installed dependencies)

$ conda env config vars set PYTHONNOUSERSITE=True -n pmp

activate conda environment

$ conda activate pmp

install optbeam package inside conda environment

$ python3 -m pip install . ```

For detailed installation instructions of PyMeep using the Conda package manager, see the Meep documentation.

Invocation of scripts

A Scheme (extension .ctl) or Python configuration file (extension .py) may be launched with the serial or parallel version of Meep and with parameters specified via command line arguments, for example by executing commands like (notice the single quotes to specify strings and Scheme expressions):

```shell

Scheme

$ mpirun -quiet -np X meep-mpi interface='"concave"' Gauss2d.ctl

Python

$ mpirun -quiet -np X python3 Gauss2d.py -interface concave ```

or another example

```shell

Scheme

$ mpirun -quiet -np X meep-mpi n2=1.5 ez='(/ 1+1i 2)' ey='(/ 1-1i 2)' LaguerreGauss3d.ctl

Python

$ mpirun -quiet -np X python3 LaguerreGauss3d.py -n2 1.5 -ez "(1+1j)/2" -ey "(1-1j)/2" ```

with X indicating the number of cores. All possible Meep parameters that can be set from the command line are defined in expressions beginning with (define-param ... in the respective Scheme configuration files.

Visualisation

The generated HDF5 files can be processed by different visualisation tools. To get a quick impression of the data Meep comes bundled with the h5utils programs. Utilising these tools, visualisation is fairly easy performed by issuing for example the following commands:

for 2d simulations:

```shell

real part of the field pattern, optical denser material is shaded in grey

$ h5topng -S2 -Zc dkbluered -a gray -A eps-000000000.h5 ez-000003696.h5

intensity distribution, optical denser material is shaded in grey

$ h5topng -S2 -c hot -a yarg -A eps-000000000.h5 e2_s-000003696.h5 ```

for 3d simulations:

```shell

slice within the plane of incidence

$ h5topng -S2 -0 -z 0 -c hot ereal2p-000001500.h5

slice transversal to the incident propagation axis with INDEX specifying the slice index

$ h5topng -S2 -x INDEX -c hot ereal2p-000001500.h5

create a VTK file

$ h5tovtk ereal2p-000001500.h5 ``` A VTK file can be opened by e.g. the MayaVi or ParaView visualisation application.

The Meep Scheme tutorial provides further useful information and assistance. For a more detailed explanation of our configuration files and the physical background, please see my dissertation thesis. Coming soon.

Supported beams, interfaces and polarisation configurations

  • [x] Gaussian beams (2d), planar, s- and p-polarisation
  • [x] Gaussian beams (2d), concave, s- and p-polarisation
  • [x] Gaussian beams (2d), convex, s- and p-polarisation
  • [x] Laguerre-Gaussian (vortex) beams (3d), planar, arbitrary complex polarisation
  • [x] Airy beams (2d), planar, s- and p-polarisation

Citing

If you use code from this repository in a published work, please cite the DOI corresponding to the specific version of Optical-beams-MEEP that you used (DOIs are listed at Zenodo.org).

Owner

  • Name: Daniel Kotik
  • Login: DanielKotik
  • Kind: user
  • Location: Dresden, Germany
  • Company: @casus

Research Scientist and Software Developer

Citation (CITATION.cff)

# YAML 1.2
# Metadata for citation of this software according to the CFF format (https://citation-file-format.github.io/)
cff-version: 1.0.3
message: If you use this software, please cite it using these metadata.
title: 'Optical-beams-MEEP'
doi: 10.5281/zenodo.2631828 # This DOI represents all versions, and will always resolve to the latest one.
authors:
- given-names: Daniel
  family-names: Kotik
  orcid: https://orcid.org/0000-0001-8735-3199
- given-names: Jörg
  family-names: Götte
version: 2.1.2
date-released: 2021-08-17
repository-code: https://github.com/DanielKotik/Optical-beams-MEEP
license: MIT

GitHub Events

Total
  • Watch event: 6
Last Year
  • Watch event: 6

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 649
  • Total Committers: 5
  • Avg Commits per committer: 129.8
  • Development Distribution Score (DDS): 0.123
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Daniel Kotik d****k@f****e 569
Daniel Kotik k****k@p****g 75
Jörg Götte j****e@g****m 2
Daniel Kotik d****k@v****e 2
Daniel Kotik d****e@f****e 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: about 2 years ago

All Time
  • Total issues: 14
  • Total pull requests: 10
  • Average time to close issues: 14 days
  • Average time to close pull requests: less than a minute
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 0.43
  • Average comments per pull request: 0.0
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • DanielKotik (13)
  • EMinsight (1)
Pull Request Authors
  • DanielKotik (8)
  • dependabot[bot] (2)
Top Labels
Issue Labels
good first issue (1) enhancement (1)
Pull Request Labels
dependencies (2)

Dependencies

docs/requirements.txt pypi
  • docutils ==0.16
  • myst-parser ==0.15.1
  • sphinx ==4.1.2
  • sphinx-rtd-theme ==0.5.2
requirements.txt pypi
  • matplotlib ==3.0.1
  • numpy ==1.17.2
  • scipy ==1.3.1
setup.py pypi
  • scipy *
.github/workflows/gh-pages.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • peaceiris/actions-gh-pages v3 composite
pyproject.toml pypi