Python code to aid with calculations for nanophotonics. Currently it contains:
- lumicks.pyoptics.psf: code that calculates the point spread function (electromagnetic field distribution) of a focused laser beam with arbitrary wavefront. The code takes polarization into account
- lumicks.pyoptics.trapping: code that calculates the electromagnetic field distribution of a spherical particle at an arbitrary distance relative to a focused laser
All code is developed in-house at LUMICKS.
Py-optics is free to use under the conditions of the Apache-2.0 open source license.
-
Create and activate a virtual environment. With conda:
$ conda create -n py-optics python=3.12 $ conda activate py-optics
Py-optics is tested on Python version 3.9 to 3.12. On Windows, there is a potential performance improvement if numpy and scipy are installed with conda, as they are optimized to use the Intel MKL libraries.
-
Clone the repository:
$ git clone https://github.com/lumicks/py-optics $ cd py-optics
-
Install the pyoptics package:
$ pip install -e .
Or, if you want to install the additional dependencies for the example Notebooks:
$ pip install -e .[examples]
To run the benchmarks, you'll need to install extra packages for testing:
$ pip install -e .[testing]
Example Jupyter Notebooks are available in the examples
directory:
-
Run the Notebook:
$ cd examples $ jupyter notebook