Attachment 'plotwavefunction.py'

Download

   1 #Saving the wave function as a .Cube file
   2 #This does unfortunately only work for cubic unit cells. You should use VTK to plot wave functions in non cubic unit cells
   3 
   4 import os
   5 from Dacapo import Dacapo
   6 from ASE import Atom, ListOfAtoms
   7 from ASE.IO.Cube import WriteCube
   8 atoms=Dacapo.ReadAtoms('filename')
   9 calc=atoms.GetCalculator()
  10 for band in range(6):  
  11  wavefunction_array=calc.GetWaveFunctionArray(band=band)
  12  #The wave function cube file is written as the density array, with the only difference being that we include the phase of the wave function as either + or - so that wave functions with opposite phases have opposite signs
  13  WriteCube(atoms,wavefunction_array,'wavefunctionarray_%d.cube' %band,real=True)

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2007-01-26 13:09:42, 0.8 KB) [[attachment:Fe-ferro.py]]
  • [get | view] (2006-02-02 12:16:15, 0.8 KB) [[attachment:H2O_vib.py]]
  • [get | view] (2007-02-20 13:13:49, 0.6 KB) [[attachment:LDOS.py]]
  • [get | view] (2007-03-14 13:57:46, 1.3 KB) [[attachment:VTKplotwavefunction.py]]
  • [get | view] (2006-02-02 14:33:52, 1.1 KB) [[attachment:dos.py]]
  • [get | view] (2007-02-20 15:04:44, 1.4 KB) [[attachment:localmagmoment.py]]
  • [get | view] (2007-03-14 13:54:20, 0.7 KB) [[attachment:plotwavefunction.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.