- #1
wondering12
- 18
- 0
Hi,
I am using Mathematica to calculate density of states and current of the Green's function times self energy in most simple form. I am not sure if I am getting current integral over energy implemented correctly. Shouldnt first current plot be a line with a slope? Below is my code:
I am using Mathematica to calculate density of states and current of the Green's function times self energy in most simple form. I am not sure if I am getting current integral over energy implemented correctly. Shouldnt first current plot be a line with a slope? Below is my code:
Code:
Remove["Global`*"];//Quiet
ClearAll
inputEta=0.6;inputHop=0.6;inputStep=0.1;inputAngle=1;inputCoup=0.5;inputDrange={0,2.5};inputCrange={0,0.1};range=10;\[Chi]range=4*Pi;
(* plotting density of states *)
greenF[\[Eta]_,t_,\[Theta]_]:=1/(e+I*\[Eta]-2*t*Cos[\[Theta]])
integral[eta_,hopping_,steps_,plotrange_]:=Module[{},ListPlot[Table[{e,-1/Pi*Im[NIntegrate[greenF[eta,hopping,angle],{angle,-Pi,Pi}]]},{e,-range,range,steps}],Joined->True,AxesLabel->{"E","DOS"},PlotRange->Automatic]]//Timing
integral[inputEta,inputHop,inputStep,inputDrange]
(* plotting current *)
(*selfEnergy1=1 , greenF1=greenF*selfEnergy1 *)
greenF1[\[Eta]_,t_,\[Theta]_,v_,e_]:=v/(e+I*\[Eta]-2*t*Cos[\[Theta]]);
integral[eta_,hopping_,angle_,coupling_,steps_,plotrange_]:=Module[{},ListPlot[Table[{\[Chi],1/(2*Pi)*Re[NIntegrate[greenF1[eta,hopping,angle,coupling,energy],{energy,-range,range}]]},{\[Chi],-\[Chi]range,\[Chi]range,steps}],Joined->True,AxesLabel->{"\[Chi]","I"},PlotRange->Automatic]]//Timing
integral[inputEta,inputHop,inputStep,inputAngle,inputCoup,inputCrange]
(*selfEnergy2=v*Cos[\[Chi]] , greenF1=greenF*selfEnergy1 *)
greenF2[\[Eta]_,t_,\[Theta]_,v_,e_]:=v*Cos[\[Chi]]/(e+I*\[Eta]-2*t*Cos[\[Theta]]);
integral[eta_,hopping_,angle_,coupling_,steps_,plotrange_]:=Module[{},ListPlot[Table[{\[Chi],1/(2*Pi)*Re[NIntegrate[greenF2[eta,hopping,angle,coupling,energy],{energy,-range,range}]]},{\[Chi],-\[Chi]range,\[Chi]range,steps}],Joined->True,AxesLabel->{"\[Chi]","I"},PlotRange->Automatic]]//Timing
integral[inputEta,inputHop,inputStep,inputAngle,inputCoup,inputCrange]
Last edited by a moderator: