この文書の現在のバージョンと選択したバージョンの差分を表示します。
ab_initio:ase_manual 2009/01/24 01:19 | — 現在 | ||
---|---|---|---|
ライン 1: | ライン 1: | ||
- | ====== ASEマニュアル ====== | ||
- | ===== 行列の固有値 ===== | ||
- | <code python> | ||
- | from LinearAlgebra import Heigenvalues | ||
- | from Numeric import array | ||
- | a = array([[1.0, 0.01j], [-0.01j, 1.0]]) | ||
- | b = Heigenvalues(a) | ||
- | print b | ||
- | </code> | ||
- | |||
- | ===== 状態密度 ===== | ||
- | |||
- | <code python> | ||
- | the_filename = 'out.nc' | ||
- | |||
- | from Dacapo import Dacapo | ||
- | the_model = Dacapo.ReadAtoms(filename = the_filename) | ||
- | the_calculator = the_model.GetCalculator() | ||
- | |||
- | from ASE.Utilities.DOS import DOS | ||
- | a_dos = DOS(the_calculator) | ||
- | x = a_dos.GetEnergies() | ||
- | y1 = a_dos.GetDOS(0) | ||
- | y2 = a_dos.GetDOS(1) | ||
- | |||
- | for i in range(len(x)): | ||
- | print x[i], y1[i], -y2[i] | ||
- | </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> | ||
- | the_filename = 'out.nc' | ||
- | |||
- | from Dacapo import Dacapo | ||
- | the_model = Dacapo.ReadAtoms(filename = the_filename) | ||
- | |||
- | from ASE.Visualization.VTK import VTKPlotAtoms | ||
- | a_atom_plot = VTKPlotAtoms(the_model) | ||
- | </code> | ||
- | |||
- | <code python> | ||
- | the_filename = 'out.nc' | ||
- | the_band = 0 | ||
- | |||
- | from Dacapo import Dacapo | ||
- | the_model = Dacapo.ReadAtoms(filename = the_filename) | ||
- | the_calculator = the_model.GetCalculator() | ||
- | |||
- | from ASE.Visualization.VTK import VTKPlotAtoms | ||
- | a_atom_plot = VTKPlotAtoms(the_model) | ||
- | |||
- | from ASE.Visualization.VTK import VTKPlotWaveFunction | ||
- | a_wavefunction_plot = VTKPlotWaveFunction(the_model, band = the_band, parent = a_atom_plot) | ||
- | a_atom_plot.Update() | ||
- | </code> | ||
- | |||