Repository navigation
Fix multispecies perturbation bookkeeping - #12
Open
rogeriojorge wants to merge 3 commits into
Open
rogeriojorge wants to merge 3 commits into
rogeriojorge wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
rogeriojorge
marked this pull request as ready for review
July 13, 2026 03:09
rogeriojorge
added a commit
that referenced
this pull request
Sep 23, 2026
rogeriojorge
force-pushed
the
agent/fix-multispecies-perturbations
branch
from
September 26, 2026 21:11
e428bb3 to
94960e3
Compare
This was referenced Sep 26, 2026
dCk must differ from Ck only in each species' uniform density slot; the k=0 first Hermite moment (mean current) and all k != 0 coefficients are kept, and the net mean current still drives the uniform field.
rogeriojorge
force-pushed
the
agent/fix-multispecies-perturbations
branch
from
October 3, 2026 14:29
94960e3 to
3f89a09
Compare
This was referenced Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
simulationbuilds the perturbationdCkby zeroing the uniform density coefficient (n=m=p=0, k=0) of species 0 and 1 only. With three or more populations the other backgrounds stay indCk.Change (1 production line)
dCk = Ck.at[:, jnp.arange(Ns) * Nn * Nm * Np, 0, 0, 0].set(0).Tests
test_perturbation_removes_every_background_density_and_keeps_mean_current[Ns=1,2,3,4]: each species has a background density, a uniform drift (k=0 first Hermite moment, i.e. a physical mean current) and a kx=1 density perturbation.dCkmust equalCkeverywhere except the Ns density slots; the mean-current coefficients survive indCk, and the net mean current still drives the uniformEx. On main, Ns=3 and Ns=4 fail; Ns=1 and 2 pass.Evidence (tested SHA 3f89a09, rebased on main ab87385; local, Python 3.12.9, JAX 0.11.2)
python -m pytest -n 2 -q tests: 12 passed.Other two-species assumptions on main, not changed here: default
qs,Omega_cs([1, 1/mi_me]) and initial state are two-species;diagnosticsusesmi_memasses and the legacy Debye length only for Ns=2, otherwise unit masses unlessms/massesis given;EM_energyand the Ampere source are normalised byOmega_cs[0].No dependencies. Touches the same
_simulation.pyblock as #13 (trivial conflict).