Three kinds of agreement
Two simulators that integrate the same equations the same way, in the same precision, should produce the same numbers to rounding. Where they integrate differently, the right claim is a measured tolerance, and the reason for it. Where the system is chaotic, as large random networks are, the last bit of rounding grows into different spikes, and the right comparison is statistics over many runs. sparx states which of the three each check is.
Below, sparx runs the inputs of the committed reference fixtures, the same ones its parity tests run: 300 ms of random excitatory and inhibitory spike trains and a constant current, in float64. Orange is the reference, blue is sparx drawn over it, and the dots below are their difference on a log scale.
LIF, exponential current synapses against NEST iaf_psc_exp: same numbers the same 10 spikes; voltages within 9.9e-14 mV.
Both integrate the membrane and the synaptic currents exactly over each step. Test: test_current_synapses_match_nest_to_rounding.
LIF, conductance synapses against NEST iaf_cond_exp (adaptive RK45): within a tolerance the same 33 spikes; voltages within 7.2e-4 mV.
sparx holds each conductance at its exact mean over the step, a second-order scheme; NEST integrates adaptively to within 1e-9 mV of the truth. Test: test_conductance_synapses_fire_with_nest_spike_for_spike.
LIF, conductance synapses against Brian2 exponential_euler: same numbers the same 34 spikes; voltages within 7.1e-14 mV.
With hold="start" sparx holds the conductance at its value at the start of the step, as Brian2 does, and counts refractoriness one step shorter, as Brian2 does. Test: test_brian2_exponential_euler_is_the_start_of_step_hold.
Izhikevich, regular spiking against NEST izhikevich: same numbers the same 7 spikes; voltages within 0, to the last bit.
Run op by op in float64 with order="nest", it is NEST's run to the last bit. Test: test_izhikevich_published_scheme_is_nests_to_the_last_bit.
- Current synapses: NEST and sparx both solve the membrane and the synaptic currents exactly over each step, so they agree to rounding, 1e-13 mV.
- Conductance synapses: NEST integrates adaptively to within 1e-9 mV of the truth. sparx holds each conductance at its exact mean over the step, a second-order scheme, and stays within about 1e-3 mV; halve the step and its error falls fourfold. Run as Brian2's
exponential_eulerholds the conductance, sparx is Brian2 to rounding. - Izhikevich: compiled, XLA fuses the quadratic's arithmetic and rounds its last bit differently, and the membrane amplifies that until a spike moves by a step. Run op by op, sparx is NEST's run to the last bit.
Izhikevich's twenty patterns
Izhikevich's 2004 paper shows twenty behaviours of one neuron model with four parameters, from tonic spiking to inhibition-induced bursting, each made by his own short MATLAB script. sparx runs each panel with his current, step and starting state.
- A. Tonic spiking5 spikes on his steps · 3e-12 mV
- B. Phasic spiking1 spike on his steps · 6e-11 mV
- C. Tonic bursting28 spikes on his steps · 2e-11 mV
- D. Phasic bursting6 spikes on his steps · 2e-10 mV
- E. Mixed mode6 spikes on his steps · 5e-12 mV
- F. Spike frequency adaptation6 spikes on his steps · 8e-13 mV
- G. Class 1 excitable10 spikes on his steps · 2e-11 mV
- H. Class 2 excitable14 spikes on his steps · 1e-2 mV
- I. Spike latency1 spike on his steps · 7e-10 mV
- J. Subthreshold oscillations1 spike on his steps · 6e-12 mV
- K. Resonator1 spike on his steps · 5e-11 mV
- L. Integrator1 spike on his steps · 7e-14 mV
- M. Rebound spike1 spike on his steps · 1e-9 mV
- N. Rebound burst7 spikes on his steps · 1e-9 mV
- O. Threshold variability1 spike on his steps · 6e-12 mV
- P. Bistability5 spikes on his steps · 3e-9 mV
- Q. Depolarizing after potential1 spike on his steps · 4e-13 mV
- R. Accommodation1 spike on his steps · 3e-13 mV
- S. Inhibition induced spiking3 spikes on his steps · 3e-9 mV
- T. Inhibition induced bursting12 spikes on his steps · 3e-11 mV
izhikevich_2004(pattern), orange his figure1.m run in GNU Octave, each with its own current, step and start. The voltages differ by at most the figure under each panel, between spikes. In class 2 excitability, Octave's V^2 rounds differently from v * v in about one value in a thousand, and the slow ramp through the bifurcation grows that to 0.012 mV.Where it does not match, and what is unmeasured
- AdEx: every spike within 0.8 ms of NEST's adaptive solver at ten substeps, within 0.1 ms at a hundred; not to rounding.
- Hodgkin-Huxley: every spike within one step of NEST's, and within 0.02 mV with
rk4at 0.025 ms. - Chaotic networks (Brunel, CUBA, COBA, the microcircuit's own draws): rates, irregularity and synchrony within the references' spread over seeds, not spikes.
- Speed, on a 4-core CPU: a simulated second of Brunel's network takes sparx 9.6 s, NEST 7.5 s and Brian2 11.8 s; the cortical microcircuit, sparx 8.8 s and NEST 2.9 s. No GPU or TPU numbers exist yet.
The fidelity ledger lists every model's checks, the observed error and every known difference, and performance the measurements.
Checked
Every trace here comes from site/lab/parity.py, which runs the helpers of sparx's tests/test_simulators.py on the fixtures NEST 3.10, Brian2 2.10 and GNU Octave produced, and saves both traces and their largest difference.