Package: elkoa
Elk Optics Analyzer (ElkOA)⚠️NOTE: You may also try the develop branch viagit clone -b develop ...DescriptionElk Optics Analyzer (ElkOA) helps to analyze optics output data fromThe Elk Code.FeaturesElk Optics Analyzer...Gives you quick and painless visual access to many ELK output filesComes with an easy to use GUI as well as a python CLI for expertsRecognizes available tasks / (tensor) fields automaticallyIs easily extendableUsers can...Create and save publication-ready pictures via matplotlib's user interfaceVisualize real and imaginary parts of Elk optics output data in various waysCycle through available datasets quickly viaTabandShift+TabSelect tensor elements to plot via dialogCtrl+TUse global tensor elements settings across all available tasksCtrl+GBatch-load parameter studies to visually analyze the impact of different
parameter settingsCtrl+BImport and plot additional data files on top (e.g. experimental measurements)Ctrl+OWrite out currently displayed data in different formatsCtrl+SManipulate field data tab-wise, e.g. shift graph(s) to left/right, take
square root etc.Ctrl+MConvert response functions viaUniversal Response Relations, e.g. ε ➙ σCtrl+C⚠️ experimental❗Convert dielectric tensors computed in the optical limit (q ➙ 0)
into ordinary and extra-ordinary refractive indices for arbitrary wavevectorsCtrl+C⚠️ experimental❗Possible new features for next releases:Most certainly and foremost: Bugfixes3D-plotting of index ellipsoidsBatch-convert for a set of different q-pointsSample/geometry-dependent (i.e. thin films) conversions of response functionsRequirementsPython 3.xnumpymatplotlibPyQt5pbrwraptnumexprYou should use the packages provided by your linux distribution. On recent
Debian systems for example, you can get all requirements by runningaptinstallpython3-numpypython3-matplotlibpython3-pyqt5python3-pbrpython3-wraptpython3-numexprAlternatively, you can get the latest PyPI versions of each package
automatically as dependencies by installing ElkOA via pip (see below).For testing purposes, you additionally need the following packages:pytestpytest-qtpytest-mplnoseInstallationThe easiest way to install ElkOA is via pip, either from PyPI directlypipinstallelkoaor, if you want the latest git release,gitclonehttps://github.com/PandaScience/ElkOpticsAnalyzer.gitcdElkOpticsAnalyzer
pipinstall.This will also install all required but absent python packages automatically
from PyPI.If you like to install ElkOA only for the current user, add the flag--user.
If you want to take care of the required python packages yourself (i.e. by
using the ones provided by your Linux distribution), add--no-deps.  If you
like to run a developer installation (no copying of files, instead use git repo
files directly), add-e.Note:On newer systems you possibly encountererror: option --user not recognizedduring the developer installation. This
is due to a bug in pypa/setuptools and can be worked around using the flag--no-build-isolation. However, you then have to take care of all build
dependencies yourself.For example, on my Arch Linux system, I usepip install --user --no-deps --no-build-isolation -e .within the repository's folder.In any case, after installation you can run the ElkOA GUI from everywhere in a
terminal using eitherelkoaorElkOpticsAnalyzer.Another way to install is by cloning the repo as above and instead of
installing via pip, put something likeexportPATH=$PATH:/path/to/ElkOpticsAnalyzer/elkoa/guiexportPYTHONPATH=$PYTHONPATH:/path/to/ElkOpticsAnalyzer/to your.bashrcor.bash_profile. Then you can start the ElkOA GUI withElkOpticsAnalyzer.py.TestsTesting is done using thepytestlibrary. Make sure you installed all
additional requirements beforehand.Download and extract the sample dataTODORun (--mpl flag is mandatory!)pytesttest_figures.py--mplPython CLIIn an Elk output directory containing e.g. the filesEPSILON_TDDFT_11.OUTEPSILON_TDDFT_12.OUTEPSILON_TDDFT_13.OUTEPSILON_TDDFT_21.OUTEPSILON_TDDFT_22.OUTEPSILON_TDDFT_23.OUTEPSILON_TDDFT_31.OUTEPSILON_TDDFT_32.OUTEPSILON_TDDFT_33.OUTelk.inINFO.OUTyou can run in a python3 interpreter:# import helpful submodules from elkoa packagefromelkoa.utilsimportelk,io,convert# parse Elk input fileelk_input=elk.ElkInput(verbose=True)eta=elk_input.swidth# or read specific input parameter directlyeta=elk.readElkInputParameter("swidth")# read tensorial Elk optics output (ij = dummy for 11, 12, etc.)freqs,epsilon=io.readTensor("EPSILON_TDDFT_ij.OUT")# find cartesian representation of q-vector from elk.inq=elk_input.q_cart# save crystal lattice vectors in cartesian basis as column-wise matrixB=elk_input.B# create converter instance with conventional frequency regularizationconverter=convert.Converter(q,B,freqs,eta,reg="conv")# convert dielectric tensor to optical conductivitysigma=converter.eps_to_sig(epsilon)# write out converted tensorio.writeTensor("sigma_ij_test.dat",freqs,sigma,threeColumn=True)# write out only 11 and 22 element of converted tensorio.writeTensor("sigma_ij_test.dat",freqs,sigma,elements=[11,22])MiscLoading additional data into existing plot:
ElkOA supports auto-converting filenames to tex-labels. For this feature to
work however, filenames must follow the patternroot+_sub+.ext, which
will show up as rootsub. In caserootcontains a
case-insensitive substring like eps, EPSILON, Sig, SIGma etc., corresponding
greek letters will be used, i.e. eps_ex.dat ➙ εex.The number of additional plots is restricted to 6, but in return we use
consistent coloring after consecutively adding more plots.Extend ElkOAUsers can extend ElkOA easily by modifying the fileelkoa/utils/dicts.py,
where all GUI-available tasks/output files, parameters and converters are set
including naming of axes and tabs.Usage Examples GUITensor plotting and "on-top-data"Batch loading for parameter studiesConverter tools for response functionsManipulating field data and visible frequency range➙ if images are not shown visithttps://github.com/PandaScience/ElkOpticsAnalyzer/