[gpaw-users] get Kohn-Sham Potential

Chengjun Jin chej at fysik.dtu.dk
Tue Jul 3 16:22:10 CEST 2012


For H,
(2, 1, 136, 136)
(kpt, spin,#of basis, #of basis)

Here is an example from https://wiki.fysik.dtu.dk/gpaw/exercises/transport/transport.html?highlight=get_lcao_hamiltonian

# Attach a GPAW calculator
calc = GPAW(h=0.3,
            xc='PBE',
            basis='szp(dzp)',
            occupations=FermiDirac(width=0.1),
            kpts=(1, 1, 1),
            mode='lcao',
            txt='pt_h2_lcao_scat.txt',
            mixer=Mixer(0.1, 5, weight=100.0),
            usesymm=None)
atoms.set_calculator(calc)

atoms.get_potential_energy() # Converge everything!
Ef = atoms.calc.get_fermi_level()

H_skMM, S_kMM = get_lcao_hamiltonian(calc)
# Only use first kpt, spin, as there are no more
H, S = H_skMM[0, 0], S_kMM[0]
H -= Ef * S
remove_pbc(atoms, H, S, 0)

# Dump the Hamiltonian and Scattering matrix to a pickle file
pickle.dump((H, S), open('scat_hs.pickle', 'wb'), 2)



________________________________________
From: Torsten Hahn [Torsten.Hahn at physik.tu-freiberg.de]
Sent: Tuesday, July 03, 2012 4:01 PM
To: Chengjun Jin
Cc: gpaw-users
Subject: Re: [gpaw-users] get Kohn-Sham Potential

Hi,

doing this

H,S = get_lcao_hamiltonian(c)

i get for H a matrix with e.g. shape

(2, 1, 136, 136)

Can you explain what the indexes mean ? Or can you give a minimal example for <psi1|H|psi2> ?

Torsten.


Am 03.07.2012 um 15:43 schrieb Chengjun Jin:

> Hi,
>
> try this:
> from gpaw.lcao.tools import get_lcao_hamiltonian
>
> Chengjun
>
>
> ________________________________________
> From: gpaw-users-bounces at listserv.fysik.dtu.dk [gpaw-users-bounces at listserv.fysik.dtu.dk] On Behalf Of Torsten Hahn [Torsten.Hahn at physik.tu-freiberg.de]
> Sent: Tuesday, July 03, 2012 2:35 PM
> To: gpaw-users
> Subject: [gpaw-users] get Kohn-Sham Potential
>
> Hello,
>
> can someone give o slightly more extended explanation of the calculators function
>
> GPAW.get_effective_potential(self, spin=0, pad=True, broadcast=False)
>
> ?
>
> I wanted to calculate something like
>
> value = <psi_1|H_ks|psi_2>
>
> from an lcao-mode calculation and thought of using the above function for that purpose.
>
> psi_1 = c.get_pseudo_wavefunction(...)
> psi_2 = c.get_pseudo_wavefunction(...)
> H_ks = h c.get_effective_potential()
>
> value = psi_1 + H_ks + psi_2
>
> Or is there a better way to do that?
>
> Best regards,
> Torsten.
> _______________________________________________
> gpaw-users mailing list
> gpaw-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/gpaw-users
>
> _______________________________________________
> gpaw-users mailing list
> gpaw-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/gpaw-users




More information about the gpaw-users mailing list