Skip to content

Clarify CPL dark-energy density scalings across CAMB and Halofit#201

Draft
Copilot wants to merge 3 commits into
masterfrom
copilot/fix-dark-energy-density-issues
Draft

Clarify CPL dark-energy density scalings across CAMB and Halofit#201
Copilot wants to merge 3 commits into
masterfrom
copilot/fix-dark-energy-density-issues

Conversation

Copy link
Copy Markdown

Copilot AI commented May 11, 2026

The issue was a mismatch between CPL dark-energy density expressions in DarkEnergyInterface.f90 and halofit.f90. The underlying (w0, wa) definition is unchanged; the apparent discrepancy came from different routines evolving differently rescaled density quantities.

  • What changed

    • Added targeted source comments in fortran/DarkEnergyInterface.f90 and fortran/halofit.f90 to distinguish:
      • rho_de / rho_de0
      • a^2 * rho_de / rho_de0
      • a^4 * rho_de / rho_de0
    • Kept the numerical implementation unchanged; the update is a clarification of variable meaning and normalization.
  • Regression coverage

    • Extended camb/tests/camb_test.py with a focused CPL background test against the public API.
    • The test checks that get_dark_energy_rho_w() matches the expected CPL density and equation-of-state relations.
  • CPL relation now made explicit

    a = np.array([0.3, 0.5, 0.8, 1.0])
    expected_rho = a ** (-3 * (1 + w0 + wa)) * np.exp(-3 * wa * (1 - a))
    expected_w = w0 + wa * (1 - a)
  • Net effect

    • Makes it clear that the formulas were already consistent.
    • Reduces the chance of interpreting internal helper variables as using a different CPL parameter convention.

Copilot AI linked an issue May 11, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits May 11, 2026 14:15
Agent-Logs-Url: https://github.com/cmbant/CAMB/sessions/53dece78-cbd2-4939-aa25-31f907a7d02d

Co-authored-by: cmbant <3958819+cmbant@users.noreply.github.com>
Agent-Logs-Url: https://github.com/cmbant/CAMB/sessions/53dece78-cbd2-4939-aa25-31f907a7d02d

Co-authored-by: cmbant <3958819+cmbant@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix different dark energy density calculations in halofit and DarkEnergyInterface Clarify CPL dark-energy density scalings across CAMB and Halofit May 11, 2026
Copilot finished work on behalf of cmbant May 11, 2026 14:17
Copilot AI requested a review from cmbant May 11, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Different dark energy density of CPL

2 participants