txt = None
#txt = '-'

# load point charges
fname = 'pc.xyz'
if world.rank == 0:
    f = open('i' + fname, 'w')
    print("""1

X 0 0 100 -0.5""", file=f)
    f.close()
world.barrier()

ex = PointCharges()
ex.read('i' + fname)
ex.write('o' + fname)

convergence = {
    'eigenstates': 1.e-4 * 40 * 1.5**3,
    'density': 1.e-2,
    'energy': 0.1
}

# without potential
if True:
    if txt:
        print('\n################## no potential')
    c00 = GPAW(h=0.3, nbands=-1, convergence=convergence, txt=txt)
    c00.calculate(H2)
    eps00_n = c00.get_eigenvalues()
예제 #2
0
import numpy as np
from ase import *

from gpaw.cluster import Cluster
from gpaw.point_charges import PointCharges

# I/O, translate

# old Cmdft style
fCmdft = 'PC_info'
f = open(fCmdft, 'w')
print >> f, """0.4
-3.0  0 0 -4
1.5   0 0 4.
"""
f.close()

pc = PointCharges(fCmdft)
assert (len(pc) == 2)
assert (pc.charge() == -1.5)

fxyz = 'pc.xyz'
pc.write(fxyz)

shift = np.array([0.2, 0.6, 2.8])
pc.translate(shift)

pc2 = PointCharges(fxyz)
for p1, p2 in zip(pc, pc2):
    assert (np.sum(p1.position - shift - p2.position) < 1e-6)
예제 #3
0
print at, 'dimer'
nelectrons = 2 * H2[0].number

txt = None
#txt = '-'

# load point charges
fname = 'pc.xyz'
f = open('i' + fname, 'w')
print >> f, """1

X 0 0 100 -0.5"""
f.close()
ex = PointCharges()
ex.read('i' + fname)
ex.write('o' + fname)

convergence = {'eigenstates':1.e-4, 'density':1.e-2, 'energy':0.1}

# without potential
if True:
    if txt:
        print '\n################## no potential'
    c00 = GPAW(h=0.3, nbands=-1,
               convergence=convergence,
               txt=txt)
    c00.calculate(H2)
    eps00_n = c00.get_eigenvalues()

# 0 potential
if True:
# load point charges
fname = "pc.xyz"
if world.rank == 0:
    f = open("i" + fname, "w")
    print(
        """1

X 0 0 100 -0.5""",
        file=f,
    )
    f.close()
world.barrier()

ex = PointCharges()
ex.read("i" + fname)
ex.write("o" + fname)

convergence = {"eigenstates": 1.0e-4 * 40 * 1.5 ** 3, "density": 1.0e-2, "energy": 0.1}

# without potential
if True:
    if txt:
        print("\n################## no potential")
    c00 = GPAW(h=0.3, nbands=-1, convergence=convergence, txt=txt)
    c00.calculate(H2)
    eps00_n = c00.get_eigenvalues()

# 0 potential
if True:
    if txt:
        print("\n################## 0 potential")
예제 #5
0
import numpy as np
from ase import *

from gpaw.cluster import Cluster
from gpaw.point_charges import PointCharges

# I/O, translate

# old Cmdft style
fCmdft='PC_info'
f = open(fCmdft, 'w')
print >> f, """0.4
-3.0  0 0 -4
1.5   0 0 4.
"""
f.close()

pc = PointCharges(fCmdft)
assert(len(pc) == 2)
assert(pc.charge() == -1.5)

fxyz='pc.xyz'
pc.write(fxyz)

shift = np.array([0.2, 0.6, 2.8])
pc.translate(shift)

pc2 = PointCharges(fxyz)
for p1, p2 in zip(pc, pc2):
    assert(np.sum(p1.position - shift - p2.position) < 1e-6)