# ASEマニュアル

## 行列の固有値

```from LinearAlgebra import Heigenvalues
from Numeric import array
a = array([[1.0, 0.01j], [-0.01j, 1.0]])
b = Heigenvalues(a)
print b```

## 状態密度

```the_filename = 'out.nc'

from Dacapo import Dacapo
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]```

## 標準ツール trajectory2xyz ソースコード

```#!/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')
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])```

## VTK (Visual Tool Kit)

<code python>

band = 0 'CO_in_a_box.nc'

from ASE import ListOfAtoms from ASE import Atom from ASE.Visualization.VTK import VTKPlotWaveFunction from ASE.Visualization.VTK import VTKPlotAtoms

from Dacapo import Dacapo atoms = Dacapo.ReadAtoms(filename='CO_in_a_box.nc') calc = atoms.GetCalculator()

# make a combined plot of the wavefunction and the atoms atomplot = VTKPlotAtoms(atoms) wfplot = VTKPlotWaveFunction(atoms,band=band,parent=atomplot) atomplot.Update()

# The appearence of the individual atomic elements can also be changed. # Finding aluminium atom avatar (found in the dictionary of species avatars) p1_O=atomplot.GetDictOfSpecies()['O'] p1_C=atomplot.GetDictOfSpecies()['C']