Ejemplo n.º 1
0
import numpy as np
import math
from src.atomic_subs import atomic_state
from scipy.special import comb
from module.atomic_basis import atomic_make_basis
#(norbs, totncfgs, ncfgs, ntots, nmin, nmax, nstat, basis, invcd, invsn)

norbs = np.int(10)
totncfgs = math.pow(2, norbs)
ncfgs = np.int(comb(norbs, 7) + comb(norbs, 8) + comb(norbs, 9))
ntots = np.int(8)
nmin = np.int(7)
nmax = np.int(9)
nstat = atomic_state(norbs)
print('nstat=\n', nstat)
basis, invcd, invsn = atomic_make_basis(norbs, totncfgs, ncfgs, ntots, nmin,
                                        nmax, nstat)
print('norbs=', norbs)
print('totncfgs=', totncfgs)
print('ncfgs=', ncfgs)
print('ntots=', ntots)
print('nmin=', nmin)
print('nmax=', nmax)
try:
    with open('test_atom.basis.dat', 'w') as f:
        for i in range(ncfgs):
            line = '{:^8d}{:^8d}{:^8d}'.format(i + 1, basis[i],
                                               invsn[basis[i]])
            f.write(line)
            for j in range(norbs):
                line1 = '{:>2d}'.format(invcd[j, i])
                f.write(line1)
Ejemplo n.º 2
0
from src.atomic_subs   import atomic_state  
from scipy.special import comb
from module.atomic_basis import atomic_make_basis#(norbs,totncfgs,ncfgs,ntots,nmin,nmax,nstat)

# construct atom object
atom1 = Atom.from_incar()
atom1.make_instance()
#atom1.make_ncfgs()
#atom1.check_incar()
#atom1.make_soc()
#atom1.show_incar()
#
#totncfgs = atom1.make_totncfgs()

# construct cumat and transform it to natural basis
cumat   = atomic_make_cumat(atom1.norb,atom1.int_val['U'],atom1.int_val['Up'],atom1.int_val['Jz'],atom1.int_val['Js'],atom1.int_val['Jp'])
cumat_t = atomic_tran_cumat(atom1.norb,atom1.amat,cumat)

# make basis
nstat = atomic_state(atom1.norb)
print('nstat=\n',nstat)
basis,invcd,invsn = atomic_make_basis(atom1.norb,atom1.totncfgs,atom1.ncfgs,atom1.norb,atom1.nmin,atom1.nmax,nstat)

# make umat

# make hmat
# (norbs, totncfgs, ncfgs, state, invcd, invsn, eimp, umat, hmat)
hmat  =  atomic_make_hmtrx(atom1.norb,atom1.totncfgs,atom1.ncfgs,basis,invcd,invsn,atom1.cfd_mat,cumat_t)