|
class TestAlternativePairingSchemes(unittest.TestCase): |
|
"""Tests for the alternative delta_n/delta_p interpolation schemes |
|
(bsk.ref_pairing_field_eq2/eq3/eq6), based on Eq. (2), (3) and (6) of |
|
https://link.springer.com/article/10.1140/epja/s10050-025-01503-x#citeas |
|
|
|
TODO(Adarsh): each scheme is currently a stub that raises |
|
NotImplementedError (see bsk.py). As you implement a scheme, remove its |
|
@unittest.skip decorator and fill in real assertions - e.g. following the |
|
pattern in TestReferencePairingFields above: |
|
- eta = 0 (rho_n == rho_p) should reduce to symmetric_pairing_field |
|
- rho_p = 0 should reduce to neutron_pairing_field |
|
- finite output for both scalar and array input |
|
""" |
|
|
|
@unittest.skip("TODO(Adarsh): implement ref_pairing_field_eq2 (Eq. 2)") |
|
def test_ref_pairing_field_eq2(self): |
|
rho_n, rho_p = 0.05, 0.05 |
|
ref = bsk.ref_pairing_field_eq2(rho_n, rho_p) |
|
sym = bsk.symmetric_pairing_field(rho_n, rho_p) |
|
self.assertAlmostEqual(float(ref), float(sym), places=6) |
|
|
|
@unittest.skip("TODO(Adarsh): implement ref_pairing_field_eq3 (Eq. 3)") |
|
def test_ref_pairing_field_eq3(self): |
|
rho_n, rho_p = 0.05, 0.05 |
|
ref = bsk.ref_pairing_field_eq3(rho_n, rho_p) |
|
sym = bsk.symmetric_pairing_field(rho_n, rho_p) |
|
self.assertAlmostEqual(float(ref), float(sym), places=6) |
|
|
|
@unittest.skip("TODO(Adarsh): implement ref_pairing_field_eq6 (Eq. 6)") |
|
def test_ref_pairing_field_eq6(self): |
|
rho_n, rho_p = 0.05, 0.05 |
|
ref = bsk.ref_pairing_field_eq6(rho_n, rho_p) |
|
sym = bsk.symmetric_pairing_field(rho_n, rho_p) |
|
self.assertAlmostEqual(float(ref), float(sym), places=6) |
Implement pairing field implementations from paper:
https://link.springer.com/article/10.1140/epja/s10050-025-01503-x#citeas
libnest/libnest/bsk.py
Lines 345 to 370 in ed1345f
And the tests for it:
libnest/tests/test_bsk.py
Lines 211 to 244 in dbc4f76