In [3]:
# dependencies should be installed
import numpy as np
import pandas as pd

In [4]:
from tensormoments import io
from tensormoments import tools

In [5]:
# read the elk output file and transform it into a pandas data frame
df = io.makeDataframe(io.readVaspOutput('TENSMOM.R1.OUT'))

In [7]:
# transform from (complex) spherical harmonics to real spherical harmonics
real_df = tools.transformFrameToReal(df)

In [11]:
# filter for a specific component
# one can leave out any of the arguments except for the first
tools.filterTmoms(real_df, l1=1, l2=2, nu=1, k=1, p=1, r=0)


Out[11]:
atom k l1 l2 nu p r species t value
411 1 1 1 2 1 1 0 1 0 (0.003562032239+0j)
1059 2 1 1 2 1 1 0 1 0 (0.003562058513+0j)
1707 3 1 1 2 1 1 0 1 0 (0.003562054284+0j)
2355 4 1 1 2 1 1 0 1 0 (0.003562067995+0j)

In [12]:
# look at toroidal moment of first atom
tools.filterTmoms(real_df, l1=1, l2=2, nu=1, k=1, p=1, r=1, atom=1)


Out[12]:
atom k l1 l2 nu p r species t value
412 1 1 1 2 1 1 1 1 -1 (1.77964634689e-08+0j)
413 1 1 1 2 1 1 1 1 0 (-4.226e-09+0j)
414 1 1 1 2 1 1 1 1 1 (-1.25251238365e-07+0j)

In [13]:
# look at quadrupole of first atom
tools.filterTmoms(real_df, l1=1, l2=2, nu=1, k=1, p=1, r=2, atom=1)


Out[13]:
atom k l1 l2 nu p r species t value
415 1 1 1 2 1 1 2 1 -2 (-1.36834411116e-05+0j)
416 1 1 1 2 1 1 2 1 -1 (-1.695090518e-07+0j)
417 1 1 1 2 1 1 2 1 0 (0.003562039616+0j)
418 1 1 1 2 1 1 2 1 1 (-3.59351666199e-09+0j)
419 1 1 1 2 1 1 2 1 2 (0.000280458942378+0j)

In [ ]: