差分

この文書の現在のバージョンと選択したバージョンの差分を表示します。

ab_initio:ase_manual 2009/01/24 01:09 ab_initio:ase_manual 2009/05/19 18:35 現在
ライン 4: ライン 4:
from LinearAlgebra import Heigenvalues from LinearAlgebra import Heigenvalues
from Numeric import array from Numeric import array
-a = array([[1.0, 0.01j], [-0.01j, 1.0]]) +a1 = array([[1.0, 0.01j], [-0.01j, 1.0]]) 
-b = Heigenvalues(a+b1 = Heigenvalues(a1
-print b+print b1
</code> </code>
ライン 12: ライン 12:
<code python> <code python>
-the_filename = 'out.nc'+f1 = 'out.nc'
from Dacapo import Dacapo from Dacapo import Dacapo
-the_model = Dacapo.ReadAtoms(filename = the_filename+s1 = Dacapo.ReadAtoms(filename = f1
-the_calculator = the_model.GetCalculator()+c1 = s1.GetCalculator()
from ASE.Utilities.DOS import DOS from ASE.Utilities.DOS import DOS
-a_dos = DOS(the_calculator+d1 = DOS(c1
-= a_dos.GetEnergies() +x0 = d1.GetEnergies() 
-y1 = a_dos.GetDOS(0) +y1 = d1.GetDOS(0) 
-y2 = a_dos.GetDOS(1)+y2 = d1.GetDOS(1)
-for i in range(len(x)): +for i in range(len(x0)): 
-  print x[i], y1[i], -y2[i]+  print x0[i], y1[i], -y2[i]
</code> </code>
 +===== WriteXYZ =====
 +<code python>
 +from Dacapo import Dacapo
 +s1 = Dacapo.ReadAtoms(filename = 'out.nc')
-===== 標準ツール trajectory2xyz ソースコード =====+from ASE.IO.xyz import WriteXYZ 
 +WriteXYZ('out.xyz', atoms = s1) 
 +</code>
 +==== 標準ツール trajectory2xyz ソースコード ====
<code python> <code python>
#!/usr/bin/env python #!/usr/bin/env python
ライン 59: ライン 66:
<code python> <code python>
 +f1 = 'out.nc'
-band = 0 +from Dacapo import Dacapo 
-'CO_in_a_box.nc'+s1 = Dacapo.ReadAtoms(filename = f1)
-from ASE import ListOfAtoms 
-from ASE import Atom 
-from ASE.Visualization.VTK import VTKPlotWaveFunction 
from ASE.Visualization.VTK import VTKPlotAtoms from ASE.Visualization.VTK import VTKPlotAtoms
 +ap1 = VTKPlotAtoms(s1)
 +</code>
 +
 +<code python>
 +f1 = 'out.nc'
from Dacapo import Dacapo from Dacapo import Dacapo
-atoms = Dacapo.ReadAtoms(filename='CO_in_a_box.nc') +s1 = Dacapo.ReadAtoms(filename = f1)
-calc = atoms.GetCalculator()+
-# make a combined plot of the wavefunction and the atoms +from ASE.Visualization.VTK import VTKPlotDensity 
-atomplot = VTKPlotAtoms(atoms) +dp1 = VTKPlotDensity(s1, showatoms = True
-wfplot = VTKPlotWaveFunction(atoms,band=band,parent=atomplot+</code>
-atomplot.Update()+
-# The appearence of the individual atomic elements can also be changed. +<code python> 
-# Finding aluminium atom avatar (found in the dictionary of species avatars) +f1 = 'out.nc
-p1_O=atomplot.GetDictOfSpecies()['O'] +m1 = 0
-p1_C=atomplot.GetDictOfSpecies()['C'] +
- +
-# Change the radius to 2.0 AA and set the color to blue +
-p1_C.SetRadius(0.5) +
-p1_O.SetRadius(0.7) +
- +
-#The color is given in an rgb (red,green,blue) scale +
-p1_C.SetColor((1,0,0)) +
-p1_O.SetColor((0,1,0)) +
-atomplot.Render() +
- +
-# The unitcell can be removed +
-unitcell=atomplot.unitcell +
-atomplot.RemoveAvatar(unitcell) +
-atomplot.Render()+
 +from Dacapo import Dacapo
 +s1 = Dacapo.ReadAtoms(filename = f1)
 +from ASE.Visualization.VTK import VTKPlotWaveFunction
 +wp1 = VTKPlotWaveFunction(s1, band = m1, showatoms = True)
 +</code>
ab_initio/ase_manual.1232726954.txt.gz · 最終更新: 2009/01/24 01:09 by kimi
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0