Home     Homework     Project

Introduction     Theory     Example     Program

Downloading and running

(1) The code is written as a single C file which you can download from HERE.

(2) Compile the program using the command "gcc -o zeemanout zeemanout.c".

(3) Run "zeemanout".
In order to find the splitting you need to know the two energy states of the electron: before and after the transition, and the corresponding spectral line of this transition.
For example, in Mercury (Hg), the transition between the upper level 3S1 and the lower level 3P1 corresponds to the blue spectral line 435.8nm.
For each energy state you need to know the spin angular momentum S, orbital angular momentum L and total angular momentum J. The first number in the level name corresponds to 2S+1. The middle letter refers to the name of the orbital: S,P,D,F... with orbital angular momentums L=0,1,2,3... respectively. Finally, the last number refers to the total angular momentum J. So, for the upper level 3S1 you would answer the code's query with: S=1, L=0, J=1
After running the programm you will get 61 ".list" files numbered from 10 to 70.

(4) Combine all files to a single one using the command "cat *.list>out.list".
Make sure you do not already have a file with that name. If you did, either erase it or give it a new name before combining the files.

(5) For the visualizaation download the PGPLOT file from HERE.

(6) Compile it using the command "pgplotcl spectrum.f" and run it. You will get 61 .ps files, in every one of them you can see the splitting according to the corresponding magnetic field.

(7)In order to make a GIF video of all these files use the command "convert *.ps filename.gif". To see the GIF copy the location of the file to your browser and add the file name. for example: "file:///...file location.../filename.gif".

This code has been already tested on phelafel.tachnion.ac.il and also on aluf.technion.ac.il and other linux machines with a full pgplot installation.