def tb90_scf(h, ab, old_mf, nkpoints=100, error=0.0000001, filling=.5, do_dos=False): """Run SCF cycle using the tb90 code""" h.write("hamiltonian_0.in") # write in file import input_tb90 in90 = input_tb90.tb90in() # create class in90.mode("nothing") # no mode in90.mode("SCF") # no mode in90.kpoints.nkpoints = nkpoints if do_dos: in90.dos.do_dos = True # do DOS in90.electrons.filling = filling in90.scf_convergence.mean_field_operators = "from_file" in90.scf_convergence.mean_field_matrix = "from_file" in90.scf_convergence.max_scf_err = error # error in SCF in90.write() # write in file write_ab_mf(ab) # write men field operators input_tb90.write_mean_field( old_mf, output_file="mean_field.in") # write old mean field # exit() import os os.system("tb90.x") # run SCF mf = input_tb90.read_mean_field(input_file="mean_field.in") return mf
def tb90_scf(h,ab,old_mf,nkpoints=100): """Run SCF cycle using the tb90 code""" h.write("hamiltonian_0.in") # write in file import input_tb90 in90 = input_tb90.tb90in() # create class in90.mode("nothing") # no mode in90.mode("SCF") # no mode in90.kpoints.nkpoints = nkpoints in90.scf_convergence.mean_field_operators = "from_file" in90.scf_convergence.mean_field_matrix = "from_file" in90.scf_convergence.max_scf_err = 0.0000001 # error in SCF in90.write() # write in file write_ab_mf(ab) # write men field operators input_tb90.write_mean_field(old_mf,output_file="mean_field.in") # write old mean field # exit() import os os.system("tb90.x") # run SCF mf = input_tb90.read_mean_field(input_file="mean_field.in") return mf
os.system("cp tb90.in-scf tb90.in") os.system("tb90.x") #in90.tb90in().write() if False: h.read("hamiltonian.in") mag = in90.read_magnetization() # ground state magnetism h.align_magnetism(mag) h.write() os.system("cp tb90.in-bands tb90.in") os.system("tb90.x") if False: # h.read("hamiltonian.in") h.global_spin_rotation(vector = [1.,0.,0.],angle=0.5) h.write(output_file = "hamiltonian_0.in") if False: tb90in = in90.tb90in() tb90in.mode("total_energy") tb90in.set_hubbard(2.0) tb90in.write() tb90in.run() if True: in90.spin_stiffness(h) # spin stiffness calculation
h.read("hamiltonian.in") mag = in90.read_magnetization() # ground state magnetism h.align_magnetism(mag) h.write() os.system("cp tb90.in-bands tb90.in") os.system("tb90.x") if False: # h.read("hamiltonian.in") h.global_spin_rotation(vector=[1., 0., 0.], angle=0.5) h.write(output_file="hamiltonian_0.in") if False: h.generate_spin_spiral(vector=[1., 0., 0.], angle=1.) h.write(output_file="hamiltonian_0.in") if False: tb90in = in90.tb90in() tb90in.mode("total_energy") tb90in.set_hubbard(2.0) tb90in.write() tb90in.run() if True: atoms = [0, len(h.intra) / 2] # atoms to rotate atoms = None # atoms to rotate qrange = np.arange(0., 0.4, 0.02) vector = np.array([1., 0., 0.]) # spin stiffness calculation in90.spin_stiffness(h, qrange=qrange, vector=vector, atoms=atoms)
import geometry import input_tb90 g = geometry.honeycomb_zigzag_ribbon(100) #g = g.supercell(3) h = g.get_hamiltonian() h.write(output_file="hamiltonian_0.in") in90 = input_tb90.tb90in() #in90.write()