[gpaw-users] H_ks in realspace ?

Torsten Hahn Torsten.Hahn at physik.tu-freiberg.de
Thu Jul 5 17:40:21 CEST 2012


Hi,

thx for that comment. 

However that is only part of what i need. Let me formulate the question a bit different.

If i really want to calculate something like

(1) x = < psi1 | H | psi2 > 

than i need psi1/psi2 and H (or some other operator) to be defined in the same basis. 

With psi1 = calc.get_pseudo_wavefunction() i have psi1 in a realspace representation. To calculate (1) i would therefore need H also in realspace representation.

Or the other way around. If i take H in LCAO-Basis (which is the case i think if i use get_lcao_hamiltonian() ) i need psi also converted (back?) to LCAO basis.

Dont get me wrong, i just do not want to reinvent the wheel. Im quite sure the required code is somewhere already present (and error checked) in GPAW. Would save me plenty of time if somebody could give me a hint. 

Best regards,
Torsten.

Am 03.07.2012 um 16:22 schrieb Chengjun Jin:

> 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
> 
> 
> _______________________________________________
> 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