-- H0, H1, Npsi, TPes, TIPes are defined beforehand psiList = Eigensystem(H0,StartRestrictions, Npsi) G0PESIPES_Spectra, G0PESIPES_ResponseFunction = CreateSpectra(H0, {TPes, TIPes}, psiList[1], {{"Emin",-1}, {"Emax",9}, {"NE",1000}, {"Gamma",0.25}}) G0 = G0PESIPES_ResponseFunction[2] + ResponseFunction.InvertEnergy(G0PESIPES_ResponseFunction[1]) Eigensystem(H0+H1, psiList[1]) -- Use H0 groundstate as Ansatz for Full Hamiltonian groundstate calculation --For memory efficiency, this way of calling Eigensystem overwrites Ansatz wavefunction with a new one. GPESIPES_Spectra, GPESIPES_ResponseFunction = CreateSpectra(H0+H1, {TPes, TIPes}, psiList[1], {{"Emin",-1}, {"Emax",9}, {"NE",1000}, {"Gamma",0.25}}) G = GPESIPES_ResponseFunction[2] + ResponseFunction.InvertEnergy(GPESIPES_ResponseFunction[1]) Sigma = ResponseFunction.CalculateSelfEnergy(G0,G) print(ResponseFunction.ToTable(Sigma))