Two boundary conditions of free electron gas model Consider free electron gas in a rectangular solid with each side length $L_x$, $L_y$, $L_z$.
"Griffiths <Introduction to Quantum Mechanics>" use infinite square barrier as fixed boundary condition. e.i. $\psi(0)=\psi(L_{x,y,z})=0$, this lead to quantum numbers positive integers $n_{x,y,z}=1,2, ...$ corresponding to standing wave solutions $\psi=\sqrt{\frac{8}{V}}sin(\frac{n_x\pi}{L_x})sin(\frac{n_y\pi}{L_y})sin(\frac{n_z\pi}{L_z})$ with $E=\frac{\hbar^2k^2}{2m}, k_{x,y,z}=\frac{n\pi}{L_{x,y,z}}$.
But "Ashcroft&Mermin <Solid State Physics>" use periodic boundary conditions. e.i. $\psi(x,y,z)=\psi(x,y,z+L_z);\psi(x,y,z)=\psi(x+L_x,y,z);\psi(x,y,z)=\psi(x,y+L_y,z)$. Thus this time the quantum numbers are just integers $n_{x,y,z}=0,\pm1,\pm2, ...$ corresponding to running wave solutions $\psi=\sqrt{\frac{1}{V}}e^{ikr}$ with $E=\frac{\hbar^2k^2}{2m}, k_{x,y,z}=\frac{2n\pi}{L_{x,y,z}}$.

These two boundary conditions give very different energy levels. For instance, the ground state wavefunction of fixed boundary condition is $\psi_{111}$ since n cannot be zero. But for periodic boundary conditons we can have state like $\psi_{100}, \psi_{110}$ since n can be zero. I am confused by the difference in these two books. So what is the real ground state of a electron gas model? Or in what condition should we use these two different boundary?
 A: 
These two boundary conditions give very different energy levels.

Do they?  In one dimension, the energy levels look like this (where the animation takes the thermodynamic limit $L\rightarrow \infty$):

The red circles are the (nondegenerate) energy levels corresponding to the fixed boundary conditions, the blue asterisks are the (doubly-degenerate) energy levels corresponding to the periodic boundary conditions.  They are different, but when one takes the thermodynamic limit then they both approach the same density of states.

So what is the real ground state of a electron gas model? Or in what condition should we use these two different boundary?

Operationally, the two models yield the same predictions in the limit $L\rightarrow \infty$.  By that I mean that if you fix $L$ to be finite and compute some measurable prediction of the model, then the result will generically depend on the boundary conditions you've applied - however, if you subsequently take the limit as $L\rightarrow\infty$, then the differences in the two predictions will disappear. In that sense, the boundary conditions don't really matter.  The periodic conditions tend to make things slightly easier, so those are the ones which are usually employed, but in principle it's up to you.
This can all be avoided by working in the infinite-volume limit from the outset, but then we are beset by technical problems like the fact that there are strictly speaking no energy or momentum eigenstates because the spectrum of the Hamiltonian is continuous; we then have to resort to generalized (non-normalizable) eigenstates and a number of other more sophisticated tools.
