def driver(spinfile, interactionfile, direction, steps, kMin, kMax): # myfilestr=spinfile#r'c:\spins.txt' # myspins=readfiles.read_spins(myfilestr)#Returns all spins from file in array form # spins=readfiles.find_collinear(myspins)#This is actually a list of Rotation matrices # print 'driver spins',spins # Now that rotation matrices are calculated algebraically, there si no need for # find_collinear. The functionality of read_spins has been put into readFiles # myfilestr=interactionfile#r'c:\montecarlo.txt' # any atom.spin opbjects past here would have actually been rotation matrices # so they can be replaced with the new spinRmatrix atom_list, jnums, jmats, N_atoms_uc = readfiles.readFiles(interactionfile, spinfile) # sympy.matrices.Matrix # atom_list[1].spinRmatrix = N.matrix([[-1, 0, 0], # [0, 1, 0], # [0,0,-1]],'Float64') N_atoms = len(atom_list) # N_atoms_uc=1 print "N_atoms", N_atoms, "Natoms_uc", N_atoms_uc # atom_list=generate_atoms() # atom_list=generate_atoms_rot() for atom in atom_list: print atom.neighbors print atom.interactions Hsave = calculate_dispersion(atom_list, N_atoms_uc, N_atoms, jmats, showEigs=True) qrange = [] wrange = [] for q in N.arange(kMin, kMax, kMax / steps): wrange.append(calc_eigs(Hsave, q * direction["kx"], q * direction["ky"], q * direction["kz"])) qrange.append(q) wrange = N.real(wrange) wrange = N.array(wrange) wrange = N.real(wrange.T) for wrange1 in wrange: pylab.plot(qrange, wrange1, "s") direction = {} direction["kx"] = 0.0 direction["ky"] = 1.0 direction["kz"] = 0.0 # pylab.figure() # calc_eigs(Hsave,direction,steps) pylab.show() # for figwin in Gcf.get_all_fig_managers(): # figwin.frame.Show() print jmats print direction print steps print spinfile print interactionfile
def driver1(spinfile,interactionfile): """generates Hsave""" atom_list, jnums, jmats,N_atoms_uc=readfiles.readFiles(interactionfile,spinfile) N_atoms=len(atom_list) print 'N_atoms',N_atoms,'Natoms_uc',N_atoms_uc for atom in atom_list: print atom.neighbors print atom.interactions Hsave = calculate_dispersion(atom_list,N_atoms_uc,N_atoms,jmats,showEigs=False) print 'driver1: complete' print Hsave return Hsave
def driver1(spinfile,interactionfile): """generates Hsave""" atom_list, jnums, jmats,N_atoms_uc=readfiles.readFiles(interactionfile,spinfile) N_atoms=len(atom_list) print 'N_atoms',N_atoms,'Natoms_uc',N_atoms_uc for atom in atom_list: print atom.neighbors print atom.interactions Hsave = calculate_dispersion(atom_list,N_atoms_uc,N_atoms,jmats,showEigs=False) print 'driver1: complete' print Hsave Hamfile = open('Hsave.txt','w') Hamfile.write(sympy.sstr(Hsave)) Hamfile.close() return Hsave
def driver1(spinfile, interactionfile): """generates Hsave""" atom_list, jnums, jmats, N_atoms_uc = readfiles.readFiles( interactionfile, spinfile) N_atoms = len(atom_list) print 'N_atoms', N_atoms, 'Natoms_uc', N_atoms_uc for atom in atom_list: print atom.neighbors print atom.interactions Hsave = calculate_dispersion(atom_list, N_atoms_uc, N_atoms, jmats, showEigs=False) print 'driver1: complete' print Hsave return Hsave