Exemple #1
0
           parallel={'domain': mpi.size},
           xc='PBE', txt='CO-m.txt', spinpol=True)

m = atoms.copy()
m.set_initial_magnetic_moments([-1,1])
m.set_calculator(m_c)
m.get_potential_energy()

d_c = GPAW(gpts=N_c, nbands=16, mixer=MixerDif(0.1, 5, weight=100.0),
           convergence={'bands':10},
           parallel={'domain': mpi.size},
           xc='PBE', txt='CO-d.txt', spinpol=True)

d = atoms.copy()
d.set_initial_magnetic_moments([-1,1])
d_c.set(charge=1)
d.set_calculator(d_c)
d.get_potential_energy()

istart=0 # band index of the first occ. band to consider
jend=15  # band index of the last unocc. band to consider
d_lr = LrTDDFT(d_c, xc='PBE', nspins=2 , istart=istart, jend=jend)
d_lr.diagonalize()

pes = TDDFTPES(m_c, d_lr, d_c)
pes.save_folded_pes('CO-td.dat', folding=None)

pes = DOSPES(m_c, d_c)
pes.save_folded_pes('CO-dos.dat', folding=None)

Exemple #2
0
           parallel={'domain': mpi.size},
           xc='PBE', txt='CO-m.txt', spinpol=True)

m = atoms.copy()
m.set_initial_magnetic_moments([-1,1])
m.set_calculator(m_c)
m.get_potential_energy()

d_c = GPAW(gpts=N_c, nbands=16, mixer=MixerDif(0.1, 5, weight=100.0),
           convergence={'bands':10},
           parallel={'domain': mpi.size},
           xc='PBE', txt='CO-d.txt', spinpol=True)

d = atoms.copy()
d.set_initial_magnetic_moments([-1,1])
d_c.set(charge=1)
d.set_calculator(d_c)
d.get_potential_energy()

istart=0 # band index of the first occ. band to consider
jend=15  # band index of the last unocc. band to consider
d_lr = LrTDDFT(d_c, xc='PBE', nspins=2 , istart=istart, jend=jend)
d_lr.diagonalize()

pes = TDDFTPES(m_c, d_lr, d_c)
pes.save_folded_pes('CO-td.dat', folding=None)

pes = DOSPES(m_c, d_c, shift=True)
pes.save_folded_pes('CO-dos.dat', folding=None)

Exemple #3
0
e_H2 = H2.get_potential_energy()
niter_H2 = calc.get_number_of_iterations()

calc_plus = GPAW(gpts=(12, 12, 12),
                 xc=xc,
                 nbands=2,
                 parallel={'domain': mpi.world.size},
                 spinpol=True,
                 txt=txt)
calc_plus.set(charge=+1)
H2_plus.set_calculator(calc_plus)
e_H2_plus = H2_plus.get_potential_energy()
niter_H2_plus = calc.get_number_of_iterations()

out = 'dospes.dat'
pes = DOSPES(calc, calc_plus, shift=True)
pes.save_folded_pes(filename=out, folding=None)
pes.save_folded_pes(filename=None, folding=None)

# check for correct shift
VDE = calc_plus.get_potential_energy() - calc.get_potential_energy()
BE_HOMO = 1.e23
be_n, f_n = pes.get_energies_and_weights()
for be, f in zip(be_n, f_n):
    if f > 0.1 and be < BE_HOMO:
        BE_HOMO = be
equal(BE_HOMO, VDE)

lr = LrTDDFT(calc_plus, xc=xc)

out = 'lrpes.dat'
Exemple #4
0
            spinpol=True, txt=txt)
H2.set_calculator(calc)
e_H2 = H2.get_potential_energy()
niter_H2 = calc.get_number_of_iterations()


calc_plus = GPAW(gpts=(12, 12, 12), xc=xc, nbands=2, 
                 parallel={'domain': mpi.world.size},
                 spinpol=True, txt=txt)
calc_plus.set(charge=+1)
H2_plus.set_calculator(calc_plus)
e_H2_plus = H2_plus.get_potential_energy()
niter_H2_plus = calc.get_number_of_iterations()

out = 'dospes.dat'
pes = DOSPES(calc, calc_plus, shift=True)
pes.save_folded_pes(filename=out, folding=None)
pes.save_folded_pes(filename=None, folding=None)

# check for correct shift
VDE = calc_plus.get_potential_energy() - calc.get_potential_energy()
BE_HOMO = 1.e23
be_n, f_n = pes.get_energies_and_weights()
for be, f in zip(be_n, f_n):
    if f > 0.1 and be < BE_HOMO:
        BE_HOMO = be
equal(BE_HOMO, VDE)

lr = LrTDDFT(calc_plus, xc=xc)

out = 'lrpes.dat'
Exemple #5
0
            spinpol=True, txt=txt)
H2.set_calculator(calc)
e_H2 = H2.get_potential_energy()
niter_H2 = calc.get_number_of_iterations()


calc_plus = GPAW(gpts=(12, 12, 12), xc=xc, nbands=2, 
                 parallel={'domain': mpi.world.size},
                 spinpol=True, txt=txt)
calc_plus.set(charge=+1)
H2_plus.set_calculator(calc_plus)
e_H2_plus = H2_plus.get_potential_energy()
niter_H2_plus = calc.get_number_of_iterations()

lr = LrTDDFT(calc_plus, xc=xc)

pes=DOSPES(calc, calc_plus)
pes.save_folded_pes(filename=txt, folding=None)
pes.save_folded_pes(filename=None, folding=None)

pes=TDDFTPES(calc, lr)
pes.save_folded_pes(filename=txt, folding='Gauss')
pes.save_folded_pes(filename=None, folding=None)

energy_tolerance = 0.000008
niter_tolerance = 0
equal(e_H2, -3.90059, energy_tolerance)
equal(niter_H2, 15, niter_tolerance)
equal(e_H2_plus, 10.5659703, energy_tolerance)
equal(niter_H2_plus, 15, niter_tolerance)
Exemple #6
0
e_H2 = H2.get_potential_energy()
niter_H2 = calc.get_number_of_iterations()

calc_plus = GPAW(gpts=(12, 12, 12),
                 xc=xc,
                 nbands=2,
                 parallel={'domain': mpi.world.size},
                 spinpol=True,
                 txt=txt)
calc_plus.set(charge=+1)
H2_plus.set_calculator(calc_plus)
e_H2_plus = H2_plus.get_potential_energy()
niter_H2_plus = calc.get_number_of_iterations()

lr = LrTDDFT(calc_plus, xc=xc)

pes = DOSPES(calc, calc_plus)
pes.save_folded_pes(filename=txt, folding=None)
pes.save_folded_pes(filename=None, folding=None)

pes = TDDFTPES(calc, lr)
pes.save_folded_pes(filename=txt, folding='Gauss')
pes.save_folded_pes(filename=None, folding=None)

energy_tolerance = 0.000008
niter_tolerance = 0
equal(e_H2, -3.90059, energy_tolerance)
equal(niter_H2, 15, niter_tolerance)
equal(e_H2_plus, 10.5659703, energy_tolerance)
equal(niter_H2_plus, 15, niter_tolerance)