Periodic vs Hard-Wall Boundary Conditions and Mode Counting

To do statistical mechanics on a quantum gas you must first count states: convert a sum over the discrete single-particle levels of a box into a smooth integral over energy. But the discrete levels depend on a modelling choice you seem free to make — what happens at the walls. Two idealizations dominate. Periodic boundary conditions (Born–von Kármán) pretend the box wraps onto a torus, giving travelling plane waves eik⋅re^{i\mathbf k\cdot\mathbf r} with ki=2πni/Lk_i=2\pi n_i/L and both signs of nin_i allowed. Hard-wall (Dirichlet) conditions force the wavefunction to vanish at the surface, giving standing sine waves with ki=πni/Lk_i=\pi n_i/L and only positive nin_i. These look completely different — running waves versus standing waves, all of k\mathbf k-space versus one octant of it. The reassuring and load-bearing fact is that the bulk density of states is identical for both. The hard-wall cells are 2d2^d times smaller in k\mathbf k-space, but hard-wall modes live in only 1/2d1/2^d of it (the positive octant); those two factors cancel exactly. What survives is the boundary-independent statement that each quantum state occupies a k\mathbf k-space volume (2π)d/V(2\pi)^d/V, equivalently a phase-space volume hdh^d. This is the measure that aq-sm-density-of-states-k-space establishes and aq-sm-density-of-states-energy pushes through the dispersion, and it is what feeds the grand-canonical ensemble, the Bose–Einstein and Fermi–Dirac distributions, and the thermal de Broglie wavelength. The equivalence is exact only in the thermodynamic limit. At finite size the two spectra genuinely differ, and the difference is a surface effect: the Dirichlet count carries a negative correction that scales as area over volume, ∼1/L\sim1/L (Weyl's law), while periodic conditions have no surface at all. For a macroscopic sample this washes out; for a nanostructure it is the physics. This article derives both quantization rules, proves their bulk equivalence, and isolates the surface term that distinguishes them.

Key takeaways
  • Confining a free particle discretizes its wavevectors; the spacing is set by the boundary condition, not the bulk physics.
  • Periodic conditions give eik⋅re^{i\mathbf k\cdot\mathbf r} with ki=2πni/Lk_i=2\pi n_i/L (ni∈Zn_i\in\mathbb Z); hard walls give sin⁡\sin standing waves with ki=πni/Lk_i=\pi n_i/L (ni∈Z+n_i\in\mathbb Z^+).
  • The hard-wall cells are 2d2^d smaller but occupy only the positive octant (1/2d1/2^d of k\mathbf k-space); the two factors of 2d2^d cancel, so both give the same bulk density V/(2π)dV/(2\pi)^d per mode.
  • The universal measure is dN=gs V ddk/(2π)d=gs ddr ddp/hd\mathrm dN=g_s\,V\,\mathrm d^d k/(2\pi)^d=g_s\,\mathrm d^d r\,\mathrm d^d p/h^d — one state per phase-space volume hdh^d.
  • Periodic conditions are the working default: they keep momentum a good quantum number, kill surface terms, and make Fourier methods trivial.
  • Boundary-dependent corrections scale as surface/volume ∼1/L\sim1/L (Weyl's law) and vanish as L→∞L\to\infty; they matter only for finite or mesoscopic systems.
  • Key idea: the number of single-particle states per momentum-space volume is a boundary-independent bulk quantity; different boundary conditions reshuffle which discrete k\mathbf k are allowed, but not how densely states pack per unit volume.
The core insight

The count of states per k\mathbf k-space volume, dN=gsV ddk/(2π)d=gs ddr ddp/hd\mathrm dN=g_s V\,\mathrm d^d k/(2\pi)^d=g_s\,\mathrm d^d r\,\mathrm d^d p/h^d, is a bulk quantity independent of the boundary condition. Periodic and hard-wall schemes redistribute the allowed k\mathbf k (all of k\mathbf k-space with cell (2π/L)d(2\pi/L)^d versus the positive octant with cell (π/L)d(\pi/L)^d), but the density of states per unit volume is identical because 2d2^d (finer spacing) times 1/2d1/2^d (octant) equals one. The only difference is a surface term ∼1/L\sim1/L that vanishes in the thermodynamic limit.

Where this lives today

Boundary-condition bookkeeping is invisible in macroscopic thermodynamics but decisive in computation and nanoscience. Every lattice Monte Carlo and molecular-dynamics simulation uses periodic boundary conditions precisely because they have no surface: a cube of spins wraps onto a torus, every site is equivalent, and momentum-space (FFT) methods apply directly, with finite-size corrections that scale as known powers of 1/L1/L for controlled extrapolation. In the opposite regime — quantum dots, nanowires, thin films — the level spacing ∼ℏ2π2/2mL2\sim\hbar^2\pi^2/2mL^2 becomes comparable to kBTk_BT, the confinement is genuinely Dirichlet-like, and the discrete sine-mode spectrum is directly observable in transport and optical experiments. The universal density of states no longer suffices there; the actual finite spectrum, boundary and all, is the physics.

The physical picture

Think of the box as a musical instrument. Hard walls are a guitar string clamped at both ends: only standing waves with nodes at the walls fit, so the allowed wavelengths are λ=2L/n\lambda=2L/n. Periodic conditions are a circular loop with no edge: a travelling wave fits provided it closes on itself after going around, so λ=L/n\lambda=L/n. Different instruments — but in a huge concert hall, the number of distinguishable pitches per unit frequency is the same. That "per unit frequency" density is the density of states, and it does not care which instrument you built. Now picture k\mathbf k-space tiled by cells. Periodic conditions fill all of k\mathbf k-space (positive and negative kik_i) with cubic cells of side 2π/L2\pi/L. Hard walls fill only the positive octant with cells of side π/L\pi/L — cells that are 2d2^d times smaller. The octant is 1/2d1/2^d of the full space; the cells are 1/2d1/2^d of the volume. Multiply the two together and you get exactly one, leaving one state per (2π/L)d(2\pi/L)^d of full k\mathbf k-space either way. This is not a coincidence to memorize but a cancellation to see: the extra states you seem to gain from finer spacing are exactly the states you lose by throwing away seven of the eight octants.

Figure
Periodic uses all of k-space with wide cells; hard-wall uses one octant with narrow cells — same bulk density
Two lattices, one bulk density: 2ᵈ spacing × (1/2ᵈ) octant = 1 periodic: all kₓ, kᵧ · cell (2π/L) includes k=0 (BEC ground state) hard wall: kₓ,kᵧ positive · cell (π/L) no k=0 (sin node); lowest is nᵢ=1 same states per unit volume

The punchline: the wide full grid (periodic) and the narrow octant grid (hard wall) pack states at the same density per unit volume. The finer spacing on the right is exactly compensated by keeping only one quadrant.

Figure
Hard-wall count approaches the continuum from below with a surface deficit that shrinks as 1/L
Finite-box counts → continuum; hard-wall deficit ∝ 1/L (Weyl) box size L → count / continuum → continuum = 1 periodic: no surface term hard wall: −surface/volume deficit halves each time L doubles → both meet in the thermodynamic limit

The owned result made numerical: the hard-wall count sits below the continuum by a surface (Weyl) deficit that scales as 1/L1/L — halving each time the box doubles — while the periodic count has no surface term. Both reach the same bulk density as L→∞L\to\infty.

The core equations

Periodic (Born–von Kármán) conditions demand the wavefunction be unchanged under translation by LL, which quantizes k\mathbf k to a lattice covering all of k\mathbf k-space.

ψk(r)=1V eik⋅r,ki=2πniL, ni∈Z(1)\psi_{\mathbf k}(\mathbf r)=\frac{1}{\sqrt V}\,e^{i\mathbf k\cdot\mathbf r},\qquad k_i=\frac{2\pi n_i}{L},\ n_i\in\mathbb Z \qquad (1)

where: ψk\psi_{\mathbf k} — normalized plane-wave eigenfunction; V=LdV=L^d; nin_i — any integer, positive, negative, or zero. Physical reading: momentum ℏk\hbar\mathbf k stays a good quantum number, and left- and right-movers (±ni\pm n_i) are distinct states — which is why periodic conditions fill all of k\mathbf k-space. Hard-wall (Dirichlet) conditions demand the wavefunction vanish on every wall, selecting standing sine waves in the positive octant.

ψn(r)=(2L)d/2∏i=1dsin⁡ ⁣(πnixiL),ki=πniL, ni∈{1,2,3,… }(2)\psi_{\mathbf n}(\mathbf r)=\left(\frac{2}{L}\right)^{d/2}\prod_{i=1}^d\sin\!\left(\frac{\pi n_i x_i}{L}\right),\qquad k_i=\frac{\pi n_i}{L},\ n_i\in\{1,2,3,\dots\} \qquad (2)

where: nin_i — strictly positive integers (a node sits at each wall); xix_i — Cartesian coordinate, 0≤xi≤L0\le x_i\le L. Physical reading: sin⁡\sin (not cos⁡\cos) forces ψ=0\psi=0 at the walls, and ni=0n_i=0 gives the trivial zero, so only positive nin_i survive — the octant restriction. Despite the different spectra, both collapse to one universal continuum measure — the object that every ideal-gas calculation uses.

∑k  ⟶  gsV(2π)d∫ddk=gshd∫ddr ddp(3)\sum_{\mathbf k}\;\longrightarrow\;\frac{g_s V}{(2\pi)^d}\int\mathrm d^d k=\frac{g_s}{h^d}\int\mathrm d^d r\,\mathrm d^d p \qquad (3)

where: h=2πℏh=2\pi\hbar — Planck constant; p=ℏk\mathbf p=\hbar\mathbf k; gs=2s+1g_s=2s+1 — spin degeneracy. Physical reading: one quantum state per phase-space volume hdh^d — a boundary-independent, statistics-independent bulk fact. The cancellation that makes this work is a one-line identity in the cell sizes and the octant fraction.

1(π/L)d⏟hard-wall cell density×12d⏟positive octant=1(2π/L)d=V(2π)d⏟periodic density(4)\underbrace{\frac{1}{(\pi/L)^d}}_{\text{hard-wall cell density}}\times\underbrace{\frac{1}{2^d}}_{\text{positive octant}}=\frac{1}{(2\pi/L)^d}=\underbrace{\frac{V}{(2\pi)^d}}_{\text{periodic density}} \qquad (4)

where: the first factor counts hard-wall states per unit k\mathbf k-volume, the second restricts to ki>0k_i>0. Physical reading: the 2d2^d from finer Dirichlet spacing exactly cancels the 1/2d1/2^d from keeping one octant — the heart of the boundary-independence. At finite size the two schemes differ by a surface term captured in the Weyl expansion of the integrated count.

N(ε)=gsV(2π)d Ωdd kd  −  14 gsS(2π)d−1 Ωd−1 kd−1+⋯(5)N(\varepsilon)=\frac{g_s V}{(2\pi)^d}\,\frac{\Omega_d}{d}\,k^d\;-\;\frac{1}{4}\,\frac{g_s S}{(2\pi)^{d-1}}\,\Omega_{d-1}\,k^{d-1}+\cdots \qquad (5)

where: N(ε)N(\varepsilon) — number of states up to energy ε\varepsilon (i.e. ∣k∣≤k|\mathbf k|\le k); SS — surface area; the surface term has coefficient −14-\tfrac14 for Dirichlet walls and is absent for periodic conditions. Physical reading: the leading correction is ∝S/V∼1/L\propto S/V\sim1/L — a boundary effect that vanishes in the thermodynamic limit, leaving the bulk term universal.

Derivations

Derivation AThe two quantization rules from single-valuedness and vanishing walls

The goal is to derive both spectra from their defining boundary condition — periodic ki=2πni/Lk_i=2\pi n_i/L over all of k\mathbf k-space, and hard-wall ki=πni/Lk_i=\pi n_i/L in the positive octant — and to see exactly where the factor-of-two in spacing and the octant restriction come from, because those two facts are what will cancel in the next card. We take the box spectrum's structure as given by quantum mechanics (aq-qm-particle-in-3d-box owns the standing-wave eigenfunctions sin⁡(n1πx/L)\sin(n_1\pi x/L)); here we extract only the counting consequences.

Step 1. Periodic phase condition. Requiring ψ(r+Le^i)=ψ(r)\psi(\mathbf r+L\hat e_i)=\psi(\mathbf r) for the plane wave eik⋅re^{i\mathbf k\cdot\mathbf r} gives eikiL=1e^{ik_iL}=1, so kiL=2πnik_iL=2\pi n_i and ki=2πni/Lk_i=2\pi n_i/L with ni∈Zn_i\in\mathbb Z. Why: the phase accrued crossing the box must be a whole number of 2π2\pi; both signs of nin_i solve it, so left- and right-movers are distinct.

Step 2. Hard-wall node condition. Requiring ψ=0\psi=0 at xi=0x_i=0 forces sin⁡(kixi)\sin(k_ix_i) (not cos⁡\cos); requiring ψ=0\psi=0 at xi=Lx_i=L then gives sin⁡(kiL)=0\sin(k_iL)=0, so kiL=πnik_iL=\pi n_i and ki=πni/Lk_i=\pi n_i/L. Why: the far wall quantizes the wavelength; ni=0n_i=0 gives sin⁡0≡0\sin0\equiv0 everywhere — not a state — so it is excluded, unlike the periodic ni=0n_i=0 which gives the valid uniform k=0\mathbf k=0 mode.

Step 3. Sign of kik_i for hard walls. Since sin⁡(−kixi)=−sin⁡(kixi)\sin(-k_ix_i)=-\sin(k_ix_i) is the same physical state up to an overall sign, negative nin_i add nothing new. Only ni>0n_i>0 counts: the allowed k\mathbf k fill the positive octant of k\mathbf k-space. Why: the standing wave has no direction, so ±ki\pm k_i are one state, not two — the origin of the 1/2d1/2^d octant factor.

Step 4. Cell sizes. Periodic states sit on a lattice of spacing 2π/L2\pi/L over all Rd\mathbb R^d, one state per cell (2π/L)d=(2π)d/V(2\pi/L)^d=(2\pi)^d/V. Hard-wall states sit on a lattice of spacing π/L\pi/L in the octant, one per cell (π/L)d(\pi/L)^d — a cell 2d2^d times smaller, but confined to 1/2d1/2^d of k\mathbf k-space. Why: these are precisely the two competing factors of 2d2^d whose cancellation is proved next. Verified: eikL=1e^{ikL}=1 at k=2πn/Lk=2\pi n/L, sin⁡(kL)=0\sin(kL)=0 at k=πn/Lk=\pi n/L, the ni=0n_i=0 exclusion for hard walls versus its validity for periodic conditions, and the sign identity are checked symbolically in verify_boundary-conditions-mode-counting.py.

Go deeper · Derivation B · 1 minThe bulk count is identical; the difference is a surface term
Derivation BThe bulk count is identical; the difference is a surface term

The goal is the owned result: periodic and hard-wall boundary conditions yield the same bulk density of states, with the only difference a surface (Weyl) correction that scales as 1/L1/L and vanishes in the thermodynamic limit. We count states below a fixed kFk_F under each scheme in 3D and show they agree, then identify the leading correction as a boundary effect.

Step 1. Periodic count. The states with ∣k∣≤kF|\mathbf k|\le k_F fill a full sphere of radius kFk_F; dividing by the cell (2π/L)3(2\pi/L)^3 and including gsg_s gives NPBC=gs43πkF3(2π/L)3=gsVkF36π2N_{\rm PBC}=g_s\dfrac{\tfrac43\pi k_F^3}{(2\pi/L)^3}=\dfrac{g_sVk_F^3}{6\pi^2}. Why: the full sphere is the natural domain for a lattice covering all of k\mathbf k-space.

Step 2. Hard-wall count. Only the positive octant contributes (18\tfrac18 of the sphere), with the smaller cell (π/L)3(\pi/L)^3: NHW=gs18⋅43πkF3(π/L)3=gsVkF36π2N_{\rm HW}=g_s\dfrac{\tfrac18\cdot\tfrac43\pi k_F^3}{(\pi/L)^3}=\dfrac{g_sVk_F^3}{6\pi^2}. The 18\tfrac18 and the eight-times-denser lattice conspire to reproduce the periodic answer exactly. Why: this is the 23×18=12^3\times\tfrac18=1 cancellation made concrete on the Fermi sphere.

Step 3. Bulk equivalence. NPBC=NHW=gsVkF3/6π2N_{\rm PBC}=N_{\rm HW}=g_sVk_F^3/6\pi^2, so the bulk density of states — and everything built from it (EFE_F, CVC_V, TcT_c) — is boundary-independent. Why: the density of states counts states in the bulk, where the wavefunction does not sense the walls; the walls are a surface effect.

Step 4. The surface term. A finer count (Weyl's law) gives N(ε)=gsV(2π)dΩddkd−14gsS(2π)d−1Ωd−1kd−1+⋯N(\varepsilon)=\frac{g_sV}{(2\pi)^d}\frac{\Omega_d}{d}k^d-\frac14\frac{g_sS}{(2\pi)^{d-1}}\Omega_{d-1}k^{d-1}+\cdots, where the surface term has coefficient −14-\tfrac14 for Dirichlet walls (states are removed by the nodes) and 00 for periodic conditions (no surface). A direct lattice-point count confirms the hard-wall total approaches the continuum from below, with the deficit ∝S/V∼1/L\propto S/V\sim1/L — halving each time the box doubles. Why: nodes at the walls suppress amplitude in a surface layer of thickness ∼1/k\sim1/k, costing a count proportional to the surface area, negligible against the volume as L→∞L\to\infty. Verified: NPBC=NHW=gsVkF3/6π2N_{\rm PBC}=N_{\rm HW}=g_sVk_F^3/6\pi^2 symbolically, the 2d×2−d=12^d\times2^{-d}=1 cancellation for d=1,2,3d=1,2,3, and a brute-force lattice-point count showing the hard-wall deficit scaling as 1/L1/L (the deficit at LL is ≈4×\approx4\times the deficit at 4L4L) are checked in verify_boundary-conditions-mode-counting.py.

Limiting cases

The mode count behaves differently across scales; the boundary condition matters only when the box is small.

RegimeBehaviourMeaning
Thermodynamic limit (L→∞L\to\infty)NPBC=NHWN_{\rm PBC}=N_{\rm HW}, surface term →0\to0sums become integrals; DOS exact and boundary-independent
Mesoscopic (kBT∼ℏ2π2/2mL2k_BT\sim\hbar^2\pi^2/2mL^2)spectra differ measurablyquantum dots/nanostructures sense the actual walls
Surface (Weyl) correctionN=Nbulk−14(S/⋯ )kd−1+⋯N=N_{\rm bulk}-\tfrac14(S/\cdots)k^{d-1}+\cdotsDirichlet lowers the count ∝S/L\propto S/L; periodic has none
Classical limit (nλ3≪1n\lambda^3\ll1)cell hdh^d → smooth measure d3r d3p/h3\mathrm d^3r\,\mathrm d^3p/h^3recovers Maxwell–Boltzmann counting with Gibbs 1/N!1/N!

Worked examples

Example 1 — Verify the cancellation by counting states in a small box.

Step 1. Setup. Take a 3D box and count orbital states with ∣k∣≤kF|\mathbf k|\le k_F for a physical kFk_F such that the periodic sphere radius is R=kFL/2π=8R=k_FL/2\pi=8. The continuum answer is N=VkF3/6π2=(kFL)3/6π2=(2πR)3/6π2N=Vk_F^3/6\pi^2=(k_FL)^3/6\pi^2=(2\pi R)^3/6\pi^2.

Step 2. Continuum count. (2π⋅8)3/6π2=(50.27)3/59.22=1.270×105/59.22=2145(2\pi\cdot8)^3/6\pi^2=(50.27)^3/59.22=1.270\times10^5/59.22=\mathbf{2145} orbital states.

Step 3. Periodic lattice count. Summing integer points (including zero and negatives) with nx2+ny2+nz2≤82n_x^2+n_y^2+n_z^2\le8^2 gives 21092109 — a ratio 2109/2145=0.9832109/2145=\mathbf{0.983}, already within 2% of the continuum with no surface deficit.

Step 4. Hard-wall lattice count. Summing positive integers (ni≥1n_i\ge1) with nx2+ny2+nz2≤(kFL/π)2=162n_x^2+n_y^2+n_z^2\le(k_FL/\pi)^2=16^2 gives 18491849 — a ratio 1849/2145=0.8621849/2145=\mathbf{0.862}, below the continuum by a ∼14%\sim14\% surface deficit. Doubling the box to R=16R=16 (hard-wall radius 32) raises the hard-wall ratio to 0.9300.930, and to R=32R=32 gives 0.9650.965: the deficit 0.138→0.070→0.0350.138\to0.070\to0.035 halves each doubling, exactly the 1/L1/L Weyl scaling. Both schemes converge to the same bulk density.

Example 2 — The Fermi energy is boundary-independent.

Step 1. Setup. Use the boundary-independent count N=gsVkF3/6π2N=g_sVk_F^3/6\pi^2 to find the Fermi wavevector and energy of a free-electron gas at density n=N/Vn=N/V with gs=2g_s=2.

Step 2. Invert for kFk_F. n=2kF36π2=kF33π2n=\dfrac{2k_F^3}{6\pi^2}=\dfrac{k_F^3}{3\pi^2}, so kF=(3π2n)1/3k_F=(3\pi^2 n)^{1/3}.

Step 3. Fermi energy. EF=ℏ2kF22m=ℏ22m(3π2n)2/3E_F=\dfrac{\hbar^2k_F^2}{2m}=\dfrac{\hbar^2}{2m}(3\pi^2 n)^{2/3} — identical whether the metal's surface is modelled by hard walls or periodic conditions, because the surface term is ∼1/L\sim1/L and vanishes for a macroscopic crystal.

Step 4. Number. For copper (n=8.49×1028 m−3n=8.49\times10^{28}\ \mathrm{m^{-3}}) this gives EF=7.0 eVE_F=\mathbf{7.0\ eV} (worked in aq-sm-density-of-states-energy) — a bulk property no experiment attributes to the choice of boundary condition. This is why lattice simulations universally adopt periodic conditions: they eliminate surface artifacts while giving the exact bulk answer.

Origins · 1 minboundary conditions and how this was discovered
BC
boundary conditions
the wall rules that quantize k · Born and von Kármán introduced periodic boundary conditions in 1912 to count lattice vibrations without the complications of real surfaces — the trick of identifying opposite faces of the crystal into a torus. The competing Dirichlet (hard-wall) conditions predate them, being the original particle-in-a-box quantization. The deep lesson, sharpened by Weyl's 1911 asymptotic law for the eigenvalue count of the Laplacian, is that the leading term depends only on the volume, while the boundary contributes a calculable surface correction — the mathematical statement of why bulk thermodynamics ignores the walls.

History
1911
— Weyl proves the asymptotic law for the eigenvalue count: leading term set by volume
1912
— Born and von Kármán introduce periodic boundary conditions for lattice dynamics
1926
— Schrödinger's particle-in-a-box gives the Dirichlet standing-wave spectrum
1928
— Sommerfeld and Bethe systematize the free-electron mode count for metals

Going further

  • Texts: Pathria & Beale, Statistical Mechanics (3rd ed.), §1.4, §6.1; Kardar, Statistical Physics of Particles, Ch. 4, 7; Reif, Fundamentals of Statistical and Thermal Physics, §1.10, §9.9; Sethna, Statistical Mechanics, Ch. 7; Landau & Lifshitz, Statistical Physics Part 1, §37–38.
  • Quantum-mechanics owner: the standing-wave box eigenfunctions sin⁡(n1πx/L)\sin(n_1\pi x/L) and the degeneracy structure are owned by aq-qm-particle-in-3d-box; the k\mathbf k-space cell (2π/L)d(2\pi/L)^d and dN=V(2π)3d3k\mathrm dN=\frac{V}{(2\pi)^3}\mathrm d^3k appear in aq-qm-density-of-final-states.
  • Leads to: the universal measure feeds the k\mathbf k-space density (aq-sm-density-of-states-k-space), the energy density of states (aq-sm-density-of-states-energy), the grand-canonical ensemble (aq-sm-grand-canonical-ideal-quantum-gases), and the Bose–Einstein and Fermi–Dirac distributions.
  • Provenance: AllQFT `sm` export (Pathria & Beale), aq-sm-boundary-conditions-mode-counting, ref STAT.QSTAT.BCMODE.1213. The quantization rules, the 2d×2−d=12^d\times2^{-d}=1 cancellation, the identical bulk count N=gsVkF3/6π2N=g_sVk_F^3/6\pi^2, and the 1/L1/L Weyl surface scaling are python-verified (checks all PASS).
Why do physicists almost always use periodic boundary conditions?

Three reasons. First, momentum ℏk\hbar\mathbf k stays a good quantum number, so plane-wave (Fourier) methods work directly and the Hamiltonian is diagonal in k\mathbf k. Second, there is no surface, so there is no surface correction to worry about — the count is gsVkF3/6π2g_sVk_F^3/6\pi^2 exactly, and finite-size effects scale as clean powers of 1/L1/L. Third, in a simulation a torus has no edges, so every site is equivalent and translation invariance is exact. Hard walls are used only when the physical confinement really is a wall — quantum dots, nanowires, thin films.

If the spectra are different, how can the thermodynamics be the same?

Because thermodynamics depends only on the density of states in the bulk, not on the individual level positions. The two spectra reshuffle which discrete k\mathbf k are allowed, but they pack states at the same density per unit volume — that is the 2d×2−d=12^d\times2^{-d}=1 cancellation. Any quantity built from an energy integral ∫g(ε)(⋯ )dε\int g(\varepsilon)(\cdots)\mathrm d\varepsilon sees only that density. The individual levels differ, but no macroscopic measurement resolves a single level out of ∼1023\sim10^{23}; it sees the smooth g(ε)g(\varepsilon), which is boundary-independent.

Where does the factor of h^d per state come from?

From the k\mathbf k-space cell. One state occupies (2π/L)d(2\pi/L)^d in k\mathbf k-space; multiplying by the real-space volume V=LdV=L^d gives (2π)d(2\pi)^d in k\mathbf k-space per state per unit real volume, i.e. one state per (2π)d/V(2\pi)^d/V of k\mathbf k-space, or one state per ddr ddk/(2π)d\mathrm d^dr\,\mathrm d^dk/(2\pi)^d of phase space. Since p=ℏk\mathbf p=\hbar\mathbf k and h=2πℏh=2\pi\hbar, the momentum-space cell is hdh^d: one quantum state per phase-space volume hdh^d. This is the same h3Nh^{3N} that Gibbs and Sackur–Tetrode insert to make the classical partition function dimensionless (aq-sm-gibbs-correction-boltzmann-counting).

Does the boundary condition affect Bose-Einstein condensation?

Only through which state is the "ground state," not through the transition itself. Periodic conditions have a clean k=0\mathbf k=0 mode that becomes macroscopically occupied below TcT_c; hard walls have no k=0\mathbf k=0 mode (it would be sin⁡0≡0\sin0\equiv0), so the lowest state is the standing mode ni=1n_i=1. The critical temperature kBTck_BT_c, set by the bulk density and the ε\sqrt{\varepsilon} DOS, is the same either way. This is one reason periodic conditions are preferred for BEC calculations: they isolate the condensate mode cleanly.

What is Weyl's law, exactly?

Weyl's law (1911) is the asymptotic count of eigenvalues of the Laplacian in a domain: the number of modes with ∣k∣≤k|\mathbf k|\le k is N(k)=V(2π)dΩddkd−14S(2π)d−1Ωd−1kd−1+⋯N(k)=\frac{V}{(2\pi)^d}\frac{\Omega_d}{d}k^d-\frac14\frac{S}{(2\pi)^{d-1}}\Omega_{d-1}k^{d-1}+\cdots. The leading (volume) term is universal — this is why bulk thermodynamics ignores the walls. The subleading (surface) term depends on the boundary: it is negative for Dirichlet walls (nodes remove states) and absent for periodic conditions. The famous question "can one hear the shape of a drum?" is precisely about reading geometry off these correction terms.

How small must a box be before the boundary condition matters?

When the level spacing near the relevant energy becomes comparable to kBTk_BT. For a free particle the spacing is ∼ℏ2π2/2mL2\sim\hbar^2\pi^2/2mL^2; setting this equal to kBTk_BT gives a crossover length L∗∼ℏπ/2mkBTL^*\sim\hbar\pi/\sqrt{2mk_BT}, which is a few times the thermal de Broglie wavelength (aq-sm-thermal-de-broglie-wavelength-sm4). For electrons at room temperature that is nanometers — hence quantum dots and nanostructures are boundary-sensitive, while any macroscopic sample is firmly in the universal-DOS regime.

Before this

Where this leads