-- Define a tight binding Hamiltonian for an infinite 1 dimensional chain HTB = NewTightBinding() HTB.Name = "1D tight binding" HTB.Cell = {{1,0,0}, {0,1,0}, {0,0,1}} HTB.Atoms = { {"A", {0,0,0}, {{"s", {"0"}}} } } HTB.Hopping = { {"A.s","A.s",{ 0, 0, 1},{{1}} } , {"A.s","A.s",{ 0, 0,-1},{{1}} } } -- create an operator representing a 10 site supercell with periodic boundary conditions HCl = CreateClusterHamiltonian(HTB, {"periodic",{{1,0,0},{0,1,0},{0,0,10}}}) -- calculate the vacuum one-particle Green's function for site 0 vacStr="" for i=1,HCl.NF do vacStr=vacStr.."0" end psivac = NewWavefunction(HCl.NF,0,{{vacStr,1}}) a0Cr = NewOperator(HCl.NF,0,{{ 0,1}}) S, G = CreateSpectra(HCl,a0Cr,psivac,{{"Tensor",true}}) -- change the one-particle Green's function to different types GAnd = ResponseFunction.ChangeType(G,"And") GAnd.Chop(1E-12,{{"deflate",true}}) GAnd.name = "G in Anderson representation" print("The one particle Green's function is") print(GAnd) -- change the Green's function to a tight binding model HTB2 = Chop( ResponseFunction.ToTightBinding(GAnd) ) print("A tight binding Hamiltonian with the same one particle Green's function is given as") print(HTB2)