Skip to content

Unified interface for controlling multicompartment discretisation #840

Description

@apdavison

Summary

PyNN's multicompartment (MC) backends discretise neurites with different, hardcoded, non-user-configurable rules. As a result the same standard model can produce different results on different backends.

Evidence

Running examples/mc/current_injection_mc.py on NEURON and Arbor: the soma-voltage and gating-variable panels overlay closely (< 0.06 mV RMS), but the dendrite-voltage panel differs by ~0.44 mV RMS. The difference is purely spatial discretisation: the soma is a single isopotential compartment in both, so it matches; the extended dendrite is not.

backend soma 500 µm dendrite rule
NEURON 1 seg 29 segs d_lambda 0.1 @ 100 Hz (pyNN/neuron/cells.py)
Arbor 1 CV ~50 CVs cv_policy_max_extent(10 µm) (pyNN/arbor/cells.py)

Neither rule is exposed to the user, and the two are neither matched to each other nor fully converged. A quick Arbor CV sweep shows the dendrite trace is converged by ~3 µm; the 10 µm default is ~0.25 mV off, and NEURON's d_lambda result sits a further ~0.2 mV from the converged solution.

Design direction

The MC API intentionally abstracts discretisation away from the user (doc/mc_api.txt: "hides details of the spatial discretization"), so the aim is an optional refinement knob with a matched, sensible default, expressed in backend-neutral terms and resolved to each simulator's native mechanism, mirroring how PyNN already handles ion-channel distributions and region selectors.

Illustrative sketch:

cell_type = sim.MultiCompartmentNeuron(
    morphology=..., cm=..., Ra=...,
    discretization=max_compartment_length(1.0),   # optional; matched default if omitted
)

with a small family of backend-neutral specs (e.g. max compartment length, compartments per section, single compartment, d_lambda), each mapping to NEURON nseg and Arbor cv_policy.

Open questions for discussion

  1. Default rule Geometric max-length (simple and predictable, but over-refines short thick sections such as the soma) vs d_lambda (biophysically adaptive, keeps NEURON's current behaviour, but Arbor has no native d_lambda and would need to emulate it)?
  2. Spec family Which discretisation specs should we support initially?
  3. d_lambda on Arbor Arbor has no native d_lambda policy and there is a long-standing open request for one (d-lambda CV policy arbor-sim/arbor#1546, help wanted, unscheduled), so PyNN would have to emulate it. Emulate faithfully via explicit CV boundaries computed by PyNN (mirroring NEURON's equal branch division), or approximate with a region-scoped max-extent? (Note d-lambda CV policy arbor-sim/arbor#1546 discusses a heterogeneity-aware variant that would not match NEURON's equal division.)
  4. Placement A MultiCompartmentNeuron parameter, a setup() global default, or both?
  5. Granularity Whole-cell only, or per-region ({region: spec}) using the existing region-filter machinery (MorphologyFilter / Morphology.section_groups)?
  6. Backwards-compatibility — changing NEURON's default away from d_lambda is a behaviour change; acceptable given MC support is currently flagged experimental?

Reproduction

python examples/mc/current_injection_mc.py neuron
python examples/mc/current_injection_mc.py arbor

Compare current_injection_mc_neuron.png and current_injection_mc_arbor.png: panels 1/3/4/5 overlay; panel 2 (dendrite Vm) diverges. Recording v at soma and dendrite on both backends and taking the RMS difference on a common time grid gives the ~0.44 mV figure above.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions