Abstract

PyCharge is a computational electrodynamics Python simulator that can calculate the electromagnetic fields and potentials generated by moving point charges and can self-consistently simulate dipoles modeled as Lorentz oscillators. To calculate the total fields and potentials along a discretized spatial grid at a specified time, PyCharge computes the retarded time of the point charges at each grid point, which are subsequently used to compute the analytical solutions to Maxwell's equations for each point charge. The Lorentz oscillators are driven by the electric field in the system and PyCharge self-consistently determines the reaction of the radiation on the dipole moment at each time step. PyCharge treats the two opposite charges in the dipole as separate point charge sources and calculates their individual contributions to the total electromagnetic fields and potentials. The expected coupling that arises between dipoles is captured in the PyCharge simulation, and the modified radiative properties of the dipoles (radiative decay rate and frequency shift) can be extracted using the dipole's energy at each time step throughout the simulation. The modified radiative properties of two dipoles separated in the near-field, which require a full dipole response to yield the correct physics, are calculated by PyCharge and shown to be in excellent agreement with the analytical Green's function results (<0.2% relative error, over a wide range of spatial separations). Moving dipoles can also be modeled by specifying the dipole's origin position as a function of time. PyCharge includes a parallelized version of the dipole simulation method to enable the parallel execution of computationally demanding simulations on high performance computing environments to significantly improve run time. Program summaryProgram Title: PyChargeCPC Library link to program files:https://doi.org/10.17632/77d5vt43h9.1Developer's repository link:https://github.com/MatthewFilipovich/pychargeLicensing provisions: GPLv3Programming language: Python 3.7 or newerSupplementary material: Documentation is available at pycharge.readthedocs.io. The PyCharge package and its dependencies can be installed from PyPI: pypi.org/project/pychargeNature of problem: Calculating the electromagnetic fields and potentials generated by complex geometries of point charges, as well as the self-consistent simulation of Lorentz oscillators.Solution method: PyCharge calculates the individual contributions from each point charge in the system to calculate the total electromagnetic fields and potentials, and computes the dipole moment of the Lorentz oscillators at each time step by solving their governing equation of motion.Additional comments including restrictions and unusual features: The parallel simulation method is implemented using the mpi4py package [1].

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call