-2
$\begingroup$

I have calculated the eigenvalues of Hamiltonian by exact diagonalization. Now I want to plot density of states (DOS) on y-axis and E on x-axis. DOS counts the number of energy levels in unit interval $DOS = dN/dE$. If I plot histogram x-axis gives bis and y-axis gives counts. So how can I plot DOS using histogram?

`E = np.array[(-2.21624382536, -1.7385345624, -1.05978531706, -0.742126286458, 
-0.694103548853, -0.561063356108,-0.519502851983, -0.179336545855, 
-0.0660011982944 0.521325710734, 0.549263158802, 0.627772313014, 
0.716034277291, 1.23811345401 1.84733960261, 2.27684897591 )]`
$\endgroup$

put on hold as unclear what you're asking by Brian Borchers, boyfarrell, Mauro Vanzetto, nicoguaro yesterday

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ The first question would be, how is it usually plotted in your field? $\endgroup$ – Anton Menshov May 13 at 15:29
  • $\begingroup$ I'will use histogram to plot this. But I have little confusion about this usually the DOS are plotted by Energy(on x-axis) and DOS(on y-axis). DOS has units of 1/Energy whereas DOS is calculated by counting the no of energy levels in unit interval. But if I plot histogram it gives me count(on y-axis) and bins(on x-axis). So how to get 1/Energy unit for DOS? $\endgroup$ – jerry May 13 at 15:35
  • $\begingroup$ Regarding getting an answer, you need to help us help you. Add some information for us to decipher what is your goal. $\endgroup$ – nicoguaro May 13 at 16:00
  • $\begingroup$ Did you check this question: scicomp.stackexchange.com/q/29307/9667 ? $\endgroup$ – nicoguaro May 13 at 16:05
  • $\begingroup$ Yes I checked it but it uses two methods. I want to use histogram. or even if I use simple plot i'm not clear how can plot DOS from simple energy eigenvalues. $\endgroup$ – jerry May 13 at 16:10
0
$\begingroup$

A couple of things.

1) The x axis of the histogram would be the energy axis and y axis would be proportional to the density of states. IMPORTANT CAVEAT BELOW

2) The multiplicity of the eigen values (i.e. the number of eigen vectors for each eigen value) will be needed for weighting the histogram. That is, unless the energy calculation above has no degenerate states.

3) Both matplotlib and numpy histogram implement the weight keyword.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.