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 accountlumicks.pyoptics.trapping
: code that calculates the electromagnetic field distribution of a spherical particle at an arbitrary distance relative to a focused laser. Forces on the particle can be calculated as well.
All code is developed in-house at LUMICKS.
Py-optics is tested to be compatible with Python version 3.10 to 3.13, and 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.13 $ conda activate py-optics
-
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