Commit Graph

113 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 22766ad7bc Remove Claude directory 2026-04-15 22:31:43 +00:00
Nuwan Yapa bee055dcf1 Beautify KG solving routine (back to old structure) 2026-04-02 21:49:41 -04:00
Nuwan Yapa 912c90838e Adaptive Simpson's for KG eqns (finally solves discrepancy) 2026-04-02 21:16:28 -04:00
Nuwan Yapa 99b4359972 Increase precision of bisection 2026-04-02 19:22:19 -04:00
Nuwan Yapa 3becb0860f Matching point = 3fm (same as Hartree.f) 2026-04-02 14:28:42 -04:00
Nuwan Yapa 4211227d6a MacOS temp file 2026-04-01 18:00:10 -04:00
Nuwan Yapa 51ce895a2a Hartree.f for reference 2026-04-01 17:59:28 -04:00
Nuwan Yapa c9b9022bb9 Model parameters are no longer hard-coded 2026-02-14 00:50:00 -05:00
Nuwan Yapa 2a09192f83 Disable live plots and timers for cleaner output 2025-12-18 20:24:04 -05:00
Nuwan Yapa 8cde68c54c Simpson's rule for meson E 2025-12-18 17:40:14 -05:00
Nuwan Yapa 3bd5e4f53b Center-of-mass correction 2025-12-18 16:30:38 -05:00
Nuwan Yapa 12acf3297e More accurate normalization 2025-08-05 16:27:23 -04:00
Nuwan Yapa 20fa595fa2 Skin thickness calculation 2025-08-04 16:57:34 -04:00
Nuwan Yapa 5fc391ee74 Simpson's rule 2025-08-04 14:30:36 -04:00
Nuwan Yapa 0af47ef161 Reorganize shooting method (not optional anymore) 2025-04-16 16:08:32 -04:00
Nuwan Yapa 897fdf9214 Changed initial boundary condition 2025-04-08 12:29:01 -04:00
Nuwan Yapa 268ce12b6c Tsit5 -> Vern9 for better accuary 2025-04-07 19:40:31 -04:00
Nuwan Yapa d3b2ec4dd8 Integration bug fixed 2025-04-07 19:38:23 -04:00
Nuwan Yapa a143edb496 Elegant method to attach two partitions 2025-04-07 19:24:42 -04:00
Nuwan Yapa 9f8cea12a3 Asymptotic boundary condition 2025-04-04 18:36:01 -04: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 5680b7e489 Distinguish in-place functions 2025-02-25 16:37:07 -05:00
Nuwan Yapa 4b0bf66da3 Refactor Pb208 2025-02-25 16:16:02 -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 b99cdc98e3 Fixed meson_E (dimensions and couplings) 2025-02-21 10:40:27 -05:00
Nuwan Yapa 1c195cd5da Minor change in a test 2025-02-21 10:24:43 -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 a93056d173 Adjust tolerance 2025-02-19 14:14:51 -05:00
Nuwan Yapa df8ed2fe12 Implemented determinant and removed boundary value 2025-02-19 12:49:43 -05:00
Nuwan Yapa b8e82644a8 Some static typing 2025-02-18 19:18:00 -05:00
Nuwan Yapa 5fced75f41 Remove third-party root finding package in favor of bisection (implemented by AI) 2025-02-18 18:59:04 -05:00
Nuwan Yapa f49207fc42 Changed default E_min and E_max 2025-02-18 18:22:58 -05:00
Nuwan Yapa 459d35e08e Major optimization to the Dirac equation 2025-02-18 17:52:26 -05:00
Nuwan Yapa 6c219816ed Merge branch 'structs' 2025-02-18 17:11:54 -05:00
Nuwan Yapa b04b41373b Missed change 2025-02-18 17:11:02 -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 63feefbd1b RK4 -> Tsit5 2025-02-17 19:33:47 -05:00
Nuwan Yapa 6850fdf351 All functions take s::system 2025-02-17 19:32:19 -05:00
Nuwan Yapa 95c1083693 RK4 -> Tsit5 2025-02-17 18:12:18 -05:00
Nuwan Yapa 27e8f3c8f5 Simple optimization 2025-02-17 14:46:58 -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