差分

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

ab_initio:ase_manual 2009/01/24 00:36 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>
 +===== 状態密度 =====
 +<code python>
 +f1 = 'out.nc'
 +
 +from Dacapo import Dacapo
 +s1 = Dacapo.ReadAtoms(filename = f1)
 +c1 = s1.GetCalculator()
 +
 +from ASE.Utilities.DOS import DOS
 +d1 = DOS(c1)
 +x0 = d1.GetEnergies()
 +y1 = d1.GetDOS(0)
 +y2 = d1.GetDOS(1)
 +
 +for i in range(len(x0)):
 +  print x0[i], y1[i], -y2[i]
 +</code>
 +===== WriteXYZ =====
 +<code python>
 +from Dacapo import Dacapo
 +s1 = Dacapo.ReadAtoms(filename = 'out.nc')
 +
 +from ASE.IO.xyz import WriteXYZ
 +WriteXYZ('out.xyz', atoms = s1)
 +</code>
 +
 +==== 標準ツール trajectory2xyz ソースコード ====
 +<code python>
 +#!/usr/bin/env python
 +from optparse import OptionParser
 +
 +from ASE.IO.xyz import WriteXYZ
 +from ASE.Trajectories.NetCDFTrajectory import NetCDFTrajectory
 +
 +
 +
 +parser = OptionParser(usage='%prog [-r R1 R2 R3] trajectory xyzfile',
 +                      version='%prog 0.1')
 +parser.add_option('-r', '--repeat', type='int', nargs=3,
 +                  help='Repeat R1, R2, R3 times along the three axes',
 +                  metavar='R1 R2 R3')
 +
 +options, args = parser.parse_args()
 +
 +if len(args) != 2:
 +    parser.print_help()
 +    raise SystemExit
 +
 +print 'Creating xyz file:' ,args[1]
 +trajectory = NetCDFTrajectory(args[0])
 +WriteXYZ(args[1],trajectory=trajectory,repeat=options.repeat,id=args[0])
 +</code>
 +
 +===== VTK (Visual Tool Kit) =====
 +
 +<code python>
 +f1 = 'out.nc'
 +
 +from Dacapo import Dacapo
 +s1 = Dacapo.ReadAtoms(filename = f1)
 +
 +from ASE.Visualization.VTK import VTKPlotAtoms
 +ap1 = VTKPlotAtoms(s1)
 +</code>
 +
 +<code python>
 +f1 = 'out.nc'
 +
 +from Dacapo import Dacapo
 +s1 = Dacapo.ReadAtoms(filename = f1)
 +
 +from ASE.Visualization.VTK import VTKPlotDensity
 +dp1 = VTKPlotDensity(s1, showatoms = True)
 +</code>
 +
 +<code python>
 +f1 = 'out.nc'
 +m1 = 0
 +
 +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.1232724973.txt.gz · 最終更新: 2009/01/24 00:36 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