% Full Stark shift of the n=2 space in hydrogen

h = 6.626E-34; % J*s

hbar = h/(2*pi);

a0 = 5.3E-11; % m

e = 1.6E-19; % C



% Hydrogen fine structure and lamb shift

E1 = 0; % Zero point of energy

E2 = h*1E9; % Lamb shift is approx 1GHz

E3 = h*10E9; % Fine structure is approx 10GHz



N = 1000;

Es = linspace(0,10E5,N); % [V/m]

En = zeros(3,N);

for i = 1:N

    E = Es(i); 

    Ed = 3*e*a0*E; % <2s|d|2p0>*E

    H = [E2           -sqrt(1/3)*Ed sqrt(2/3)*Ed;

        -sqrt(1/3)*Ed  E1           0;

        sqrt(2/3)*Ed   0            E3]; % Hamiltonian in the m=(+/-)1/2 substates

    En(:,i) = eig(H);

end

for i = 1:3

    plot(Es/100,En(i,:)/h*1E-9); hold on;

end

xlabel('Ext. electric field, E [V/cm]');

ylabel('Energy splitting [GHz]');

plot(Es/100,10*ones(1,N),'b'); % Plot the unaffected m=3/2,-3/2 states

title('Stark splittings of the n=2 states of hydrogen');