Commit Graph

20 Commits

Author SHA1 Message Date
Nuwan Yapa ba83021a63 Generalized to Hartree-Bogoliubov (RHB)
Canonical-basis BCS with constant-G monopole pairing, following Vretenar et al. 2005 Sec 2.3.3 (Eqs. 48-50).

Changes (~80 new lines, only 3 files touched):
- system.jl:28-40 — spectrum now carries occ::Vector{Float64} plus pairing gap Δ and chemical potential λ.
- nucleons.jl:147-156 — new helpers: Ω_κ(κ)=|κ|, pairing_G(s)=20/A, and a 5 MeV active-window constant E_pair_window that regularizes the constant-G gap equation.
- nucleons.jl:172-232 — solveBCS: freezes orbitals outside ±5 MeV of the Fermi level as core/empty; in the active window alternates two 1-D bisections on λ (particle-number constraint) and Δ (gap equation G/2 · Σ Ω/√((ε-λ)²+Δ²) = 1), falling back to Δ=0 when no non-trivial solution exists. Thin wrapper fillNucleonsBCS returns a spectrum.
- nucleons.jl:209-218 — nucleon_E now adds the BCS pairing energy −(Δ_p² + Δ_n²)/G.
- nucleons.jl:244 — density loop skips orbitals with negligible occupation for speed.
- fillNucleons was kept (one-line sharp filler) since two diagnostic test scripts use it.

Verification:
- Pb-208 (doubly-magic, test/Pb208.jl): Δ_p = Δ_n = 0; binding energy 7.892 MeV/nucleon — bit-identical to the pre-RHB baseline (confirmed by git stash).
- Sn-120 (open neutron shell): Δ_n = 0.56 MeV with properly fractional occupations on the N=50–82 shell (e.g. 1h_{11/2}: 1.03/12, 3s_{1/2}: 1.57/2, 2d_{3/2}: 3.51/4); neutron particle-number sums to 70 exactly. Proton Δ_p = 0 (Z=50 closed). Binding 8.475 MeV/A (exp. 8.50).

Design notes: The ±5 MeV pairing window is the standard BCS cut-off that prevents constant-G from generating spurious gap at closed shells (without it, Pb-208 would pair). It's exposed via E_window kwarg on solveBCS if you want to tune it. G=20/A gives somewhat weaker gaps than experimental (Sn-120 expt ≈1.4 MeV vs our 0.56) — a typical limitation of the Bohr-Mottelson estimate; the user can override pairing_G or pass a custom G through solveBCS directly.
2026-04-16 00:28:56 +00:00
Nuwan Yapa c9b9022bb9 Model parameters are no longer hard-coded 2026-02-14 00:50:00 -05:00
Nuwan Yapa e470e3c804 Quick dependency fix 2025-03-12 19:13:22 -04:00
Nuwan Yapa 33c8b3f81d Delete deprecated function 2025-02-25 16:41:17 -05:00
Nuwan Yapa 43e91bf78e struct spectrum 2025-02-25 16:12:36 -05:00
Nuwan Yapa 3a0cd0a26a Saving single particle spectrum in struct system 2025-02-24 20:10:28 -05:00
Nuwan Yapa f1553f548f Reorganize dependency structure 2025-02-21 10:55:11 -05:00
Nuwan Yapa 0c748534c8 Tighten convergence 2025-02-21 10:40:45 -05:00
Nuwan Yapa b9659255c9 Fixed the unstability 2025-02-20 17:00:42 -05:00
Nuwan Yapa e1378be8db Total E calculation (meson part wrong) 2025-02-20 16:47:13 -05:00
Nuwan Yapa b7dd47eab8 Fields and densities read off from s::system 2025-02-18 16:54:55 -05:00
Nuwan Yapa 5e7bbd124e Expanded struct system 2025-02-18 16:07:53 -05:00
Nuwan Yapa 6850fdf351 All functions take s::system 2025-02-17 19:32:19 -05:00
Nuwan Yapa 365c65ee73 Performance benchmarking 2025-02-14 18:34:16 -05:00
Nuwan Yapa 3e6c28ef17 Dirty fix for stability 2025-02-10 20:30:33 -05:00
Nuwan Yapa 3149d4c302 Formatting 2025-02-10 20:12:27 -05:00
Nuwan Yapa c0a914c3c4 Bug fixed 2025-02-10 18:59:49 -05:00
Nuwan Yapa aeb3225254 Prettier monitoring 2025-02-10 18:58:36 -05:00
Nuwan Yapa 664e38d624 Monitor via plots 2025-02-10 16:40:22 -05:00
Nuwan Yapa 31457c9dc7 Rough subroutine for self-consistent solution 2025-02-07 18:27:16 -05:00