Shell model
In nuclear physics, the nuclear shell model is a model of the atomic nucleus which uses the Pauli principle to describe the structure of the nucleus in terms of energy levels. The model was developed in 1949 following independent work by several physicists, most notably Eugene Paul Wigner, Maria Goeppert-Mayer and J. Hans D. Jensen, who shared the 1963 Nobel Prize in Physics for their contributions.
The shell model is partly analogous to the atomic shell model which describes the arrangement of electrons in an atom, in that a filled shell results in greater stability. When adding nucleons (protons or neutrons) to a nucleus, there are certain points where the binding energy of the next nucleon is significantly less than the last one. This observation, that there are certain magic numbers of nucleons: 2, 8, 20, 28, 50, 82, 126 which are more tightly bound than the next higher number, is the origin of the shell model.
Note that the shells exist for both protons and neutrons individually, so that we can speak of "magic nuclei" where one nucleon type is at a magic number, and "doubly magic nuclei", where both are. Due to some variations in orbital filling, the upper magic numbers are 126 and, speculatively, 184 for neutrons but only 114 for protons. This has a relevant role in the search of the so-called island of stability. Besides, there have been found some semimagic numbers, noticeably Z=40.
In order to get these numbers, the nuclear shell model starts from an average potential with a shape something between the square well and the harmonic oscillator. To this potential a relativistic spin orbit term is added. Even so, the total perturbation does not coincide with experiment, and an empirical spin orbit coupling, named Nilsson Term, must be added with at least two or three different values of its coupling constant, depending on the nuclei being studied.
Nevertheless, the magic numbers of nucleons, as well as other properties, can be arrived at by approximating the model with a three-dimensional harmonic oscillator plus a spin-orbit interaction. A more realistic but also complicated potential is known as Woods Saxon potential.

# Deformed harmonic oscillator approximated model
Consider a three-dimensional harmonic oscillator. This would give, for example, in the first two levels
We can imagine ourselves building a nucleus by adding protons and neutrons. These will always fill the lowest available level. Thus the first two protons fill level zero, the next six protons fill level one, and so on. As with electrons in the periodic table, protons in the outermost shell will be relatively loosely bound to the nucleus if there are only few protons in that shell, because they are farthest from the center of the nucleus. Therefore nuclei which have a full outer proton shell will have a higher binding energy than other nuclei with a similar total number of protons. All this is true for neutrons as well.
This means that the magic numbers are expected to be those in which all occupied shells are full. We see that for the first two numbers we get 2 (level 0 full) and 8 (levels 0 and 1 full), in accord with experiment. However the full set of magic numbers does not turn out correctly. These can be computed as follows:
In particular, the first six shells are:
- level 0: 2 states (l = 0) = 2.
- level 1: 6 states (l = 1) = 6.
- level 2: 2 states (l = 0) + 10 states (l = 2) = 12.
- level 3: 6 states (l = 1) + 14 states (l = 3) = 20.
- level 4: 2 states (l = 0) + 10 states (l = 2) + 18 states (l = 4) = 30.
- level 5: 6 states (l = 1) + 14 states (l = 3) + 22 states (l = 5) = 42.
where for every l there are 2l+1 different values of ml and 2 values of ms, giving a total of 4l+2 states for every specific level.

## Including a spin-orbit interaction
We next include a spin-orbit interaction. First we have to describe the system by the quantum numbers j, mj and parity instead of l, ml and ms, as in the Hydrogen-like atom. Since every even level includes only even values of l, it includes only states of even (positive) parity; Similarly every odd level includes only states of odd (negative) parity. Thus we can ignore parity in counting states. The first six shells, described by the new quantum numbers, are
- level 0 (n=0): 2 states (j = 1/2). Even parity.
- level 1 (n=1): 4 states (j = 3/2) + 2 states (j = 1/2) = 6. Odd parity.
- level 2 (n=2): 6 states (j = 5/2) + 4 states (j = 3/2) + 2 states (j = 1/2) = 12. Even parity.
- level 3 (n=3): 8 states (j = 7/2) + 6 states (j = 5/2) + 4 states (j = 3/2) + 2 states (j = 1/2) = 20. Odd parity.
- level 4 (n=4): 10 states (j = 9/2) + 8 states (j = 7/2) + 6 states (j = 5/2) + 4 states (j = 3/2) + 2 states (j = 1/2) = 30. Even parity.
- level 5 (n=5): 12 states (j = 11/2) + 10 states (j = 9/2) + 8 states (j = 7/2) + 6 states (j = 5/2) + 4 states (j = 3/2) + 2 states (j = 1/2) = 42. Odd parity.
where for every j there are 2j+1 different states from different values of mj.
Due to the spin-orbit interaction the energies of states of the same level but with different j will no longer be identical. This is because in the original quantum numbers, when \vec{s} is parallel to \vec{l}, the interaction energy is negative; and in this case j = l + s = l + 1/2. When \vec{s} is anti-parallel to \vec{l} (i.e. aligned oppositely), the interaction energy is positive, and in this case j = l - s = l - 1/2. Furthermore, the strength of the interaction is roughly proportional to l.
For example, consider the states at level 4:
- The 10 states with j = 9/2 come from l = 4 and s parallel to l. Thus they have a negative spin-orbit interaction energy.
- The 8 states  with j = 7/2 came from l = 4 and s anti-parallel to l. Thus they have a positive spin-orbit interaction energy.
- The 6 states with j = 5/2 came from l = 2 and s parallel to l. Thus they have a negative spin-orbit interaction energy. However its magnitude is half compared to the states with j = 9/2.
- The 4 states with j = 3/2 came from l = 2 and s anti-parallel to l. Thus they have a positive spin-orbit interaction energy. However its magnitude is half compared to the states with j = 7/2.
- The 2 states with j = 1/2 came from l = 0 and thus have zero spin-orbit interaction energy.

## Deforming the potential
The harmonic oscillator potential V(r) = \mu \omega^2 r^2 /2 grows infinitely as the distance from the center r goes to infinity. A more realistic potential, such as Woods Saxon potential, would approach a constant at this limit. One main consequence is that the average radius of nucleons orbits would be larger in a realistic potential; This leads to a reduced term \hbar^2 l(l+1)/ 2m r^2 in the Laplacian in the Hamiltonian. Another main difference is that orbits with high average radii, such as those with high n or high l, will have a lower energy than in a harmonic oscillator potential. Both effects lead to a reduction in the energy levels of high l orbits.

## Predicted magic numbers
Together with the spin-orbit interaction, and for appropriate magnitudes of both effects, one is led to the following qualitative picture: At all levels, the highest j states have their energies shifted downwards, especially for high n (where the highest j is high). This is both due to the negative spin-orbit interaction energy and to the reduction in energy resulting from deforming the potential to a more realistic one. The second-to-highest j states, on the contrary, have their energy shifted up by the first effect and down by the second effect, leading to a small overall shift. The shifts in the energy of the highest j states can thus bring the energy of states of one level to be closer to the energy of states of a lower level. The "shells" of the shell model are then no longer identical to the levels denoted by n, and the magic numbers are changed.
We may then suppose that the highest j states for n = 3 have an intermediate energy between the average energies of n = 2 and n = 3, and suppose that the highest j states for larger n (at least up to n = 7) have an energy closer to the average energy of n-1. Then we get the following shells (see the figure)
- 1st Shell: 2 states (n = 0, j = 1/2).
- 2nd Shell: 6 states (n = 1, j = 1/2 or 3/2).
- 3rd shell: 12 states (n = 2, j = 1/2, 3/2 or 5/2).
- 4th shell: 8 states (n = 3, j = 7/2).
- 5th shell: 22 states (n = 3, j = 1/2, 3/2 or 5/2; n = 4, j = 9/2).
- 6th shell: 32 states (n = 4, j = 1/2, 3/2, 5/2 or 7/2; n = 5, j = 11/2).
- 7th shell: 44 states (n = 5, j = 1/2, 3/2, 5/2, 7/2 or 9/2; n = 6, j = 13/2).
- 8th shell: 58 states (n = 6, j = 1/2, 3/2, 5/2, 7/2, 9/2 or 11/2; n = 7, j = 15/2).
and so on.
The magic numbers are then
and so on.  This gives all the observed magic numbers, and also predicts a new one, at the value of 184 (for protons, the magic number 126 has not been observed yet, and more complicated theoretical considerations predict the magic number to be 114 instead).

## Other properties of nuclei
This model also predicts or explains with some success other properties of nuclei, in particular spin and parity of nuclei ground states, and to some extent their excited states as well. Take 178O9 as an example - its nucleus has eight protons filling the two first proton shells, eight neutrons filling the two first neutron shells, and one extra neutron.  All protons in a complete proton shell have total angular momentum zero, since their angular momenta cancel each other; The same is true for neutrons. All protons in the same level (n) have the same parity (either +1 or -1), and since the parity of a pair of particles is the product of their parities, an even number of protons from the same level (n) will have +1 parity.  Thus the total angular momentum of the eight protons and the first eight neutrons is zero, and their total parity is +1. This means that the spin (i.e. angular momentum) of the nucleus, as well as its parity, are fully determined by that of the ninth neutron.  This one is in the first (i.e. lowest energy) state of the 3rd shell, and therefore have n = 2, giving it +1 parity, and j = 5/2. Thus the nucleus of 178O9 is expected to have positive parity and spin 5/2, which indeed it has.
For nuclei farther from the magic numbers one must add the assumption that due to the relation between the strong nuclear force and angular momentum, protons or neutrons with the same n tend to form pairs of opposite angular momenta.  Therefore a nucleus with an even number of protons and an even number of neutrons has 0 spin and positive parity. A nucleus with an even number of protons and an odd number of neutrons (or vice versa) has the parity of the last neutron (or proton), and the spin equal to the total angular momentum of this neutron (or proton).  By "last" we mean the properties coming from the highest energy level.
In the case of a nucleus with an odd number of protons and an odd number of neutrons, one must consider the total angular momentum and parity of both the last neutron and the last proton.  The nucleus parity will be a product of theirs, while the nucleus spin will be one of the possible results of the sum of their total angular momenta (with other possible results being excited states of the nucleus).
The ordering of angular momentum levels within each shell is according to the principles described above - due to spin-orbit interaction, with high angular momentum states having their energies shifted downwards due to the deformation of the potential (i.e. moving form a harmonic oscillator potential to a more realistic one). For nucleon pairs, however, it is often energetically favorable to be at high angular momentum, even if its energy level for a single nucleon would be higher.  This is due to the relation between angular momentum and the strong nuclear force.
Nuclear magnetic moment is partly predicted by this simple version of the shell model.  The magnetic moment is calculated through j, l and s of the "last" nucleon, but nuclei are not in states of well defined l and s.  Furthermore, for odd-odd nuclei, one has to consider the two "last" nucleons, as in deuterium. Therefore one gets several possible answers for the nuclear magnetic moment, one for each possible combined l and s state, and the real state of the nucleus is a superposition of them.  Thus the real (measured) nuclear magnetic moment is somewhere in between the possible answers.
The electric dipole of a nucleus is always zero, because its ground state has a definite parity, so its matter density (\psi^2, where \psi is the wavefunction) is always invariant under parity. This is usually the situations with the atomic electric dipole as well.
Higher electric and magnetic multipole moments cannot be predicted by this simple version of the shell model, for the reasons similar to those in the case of the deuterium.