#!/usr/bin/env python """ Plotter forskjellene mellom bosoner og fermioner for H_2 system. @author Are Raklev """ from numpy import * from matplotlib.pyplot import * from numpy.polynomial.hermite_e import hermeval # Definerer losninger av TUSL for H-atom def psi_100( x ): a = 0.0529 # Bohrradius [nm] r = abs(x) return 1./sqrt(pi*a**3)*exp(-r/a) def psi_200( x ): a = 0.0529 # Bohrradius [nm] r = abs(x) return sqrt(1./a**3/2.**2)*exp(-r/2./a)*(4.-2.*2.*r/2./a)*sqrt(1./4./pi) # Lager x-verdier x = linspace( -0.5, 0.5, 1e3 ) # Offset fra x = 0 for de to elektronene. Tilsvarer sentrum av H-atomene. x_1 = -0.05 x_2 = 0.05 # Plotter de to elektrontilstandene for seg selv figure() plot( x, abs(psi_100(x+x_1))**2, label='$|\psi_{100}(x_1,0,0)|^2$') plot( x, abs(psi_200(x+x_2))**2, label='$|\psi_{200}(x_2,0,0)|^2$') # Tekst langs x-aksen xlabel('$x$ [nm]') # Tekst langs y-aksen ylabel('$|\psi (x,0,0)|^2$ [nm$^{-3}$]') # legend(loc='best') # Plotter de forskjellige topartikkeltilstandene figure() # Adskillbare partikler #plot( x, abs(psi_100( x+x_1 )*psi_200( x+x_2 ))**2, label='$|\psi_{100}(x_1,0,0)\psi_{200}(x_2,0,0)|^2$') # Bosoner plot( x, 0.5*abs(psi_100(x+x_1)*psi_200(x+x_2) + psi_200(x+x_1)*psi_100(x+x_2))**2, label='$|\psi_{100}(x_1,0,0)\psi_{200}(x_2,0,0)+\psi_{200}(x_1,0,0)\psi_{100}(x_2,0,0)|^2$') # Fermioner plot( x, 0.5*abs(psi_100(x+x_1)*psi_200(x+x_2) - psi_200(x+x_1)*psi_100(x+x_2))**2, label='$|\psi_{100}(x_1,0,0)\psi_{200}(x_2,0,0)-\psi_{200}(x_1,0,0)\psi_{100}(x_2,0,0)|^2$') # Setter tittel title('$H_2$') # Tekst langs x-aksen xlabel('$x$ [nm]') # Tekst langs y-aksen ylabel('$|\psi (x,0,0)|^2$ [nm$^{-3}$]') # legend(loc='best') # Lagre som .eps fil savefig('H2.eps') # Viser plottet show()