以前のリビジョンの文書です
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_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]
#!/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 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']
# 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.SetColor1) p1_O.SetColor2) atomplot.Render()
# The unitcell can be removed unitcell=atomplot.unitcell atomplot.RemoveAvatar(unitcell) atomplot.Render()