PyWolf is a software that simulates the propagation of partially coherent light using parallel computing devices through PyOpenCL to decrease the computation time.
Please see the following articless for more technical details:
If you find this software useful for your research, please cite:
Tiago E.C. Magalhães, José M. Rebordão, "PyWolf: A PyOpenCL implementation for simulating the propagation of partially coherent light", Computer Physics Communications, Volume 276, 2022, 108336. DOI
Tiago E.C. Magalhães, Daniela O. Santos, "A new version of PyWolf for the propagation of partially coherent light in media other than free space", Computer Physics Communications, Volume 294, 2024. DOI
PyWolf is build in Python 3.7.6 (x64). It was mostly implemented in Windows 10 (x64). It was tested in the following operating systems:
To use PyWolf, the user needs to install the following packages:
Using the package manager pip to install packages:
pip install numpy
pip install scipy
pip install matplotlib
pip install PyQt5
pip install psutil
Additionally, to load images, one needs to install Python's OpenCV. Using the package manager pip:
pip install opencv-python
Install the PyOpenCL Python's package (cl12).
python3 -m pip install PyOpenCL
Optionally, one can also install OpenCL SDK to have more OpenCL platforms available. For example:
To start PyWolf, execute main.py and a PyQT5 window will appear (see figure below).
When PyOpenCL is not correctly installed, the following error usually appears in the Python interpreter:
from pyopencl._cl import bitlog2 # noqa: F401 ImportError: DLL load failed:
For Windows 7 users, the update Universal C Runtime in Windows must be installed.
For Linux users (e.g., Ubuntu), if PyWolf crashes with the message "Backend terminated or disconnected.", it may be due to the lack of RAM available. Try decreasing the matrix size N or decrease the usage of RAM in other applications.