﻿# solve_ivp vectorized columns do not create independent trajectory batches

solve_ivp vectorized columns do not create independent trajectory batches. A focused scientific-computing guide with the documented mechanism, a reproducible validation scenario, evidence and operational limits.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/science-ivp-vectorized-columns-not-ensemble/
Language: en

The vectorized flag in solve_ivp describes how the right-hand-side function accepts columns of states. It does not turn a single ODE request into an independently scheduled batch of trajectories. A neural simulation wrapper that treats those columns as separate examples can mix derivative preparation with ensemble semantics and assign incorrect training identities to intermediate evaluations.

## The scientific interface

Under the documented vectorized contract, the function can receive a matrix whose columns must behave like separate evaluations of the same right-hand side at the supplied time. This supports particular solver operations such as finite-difference Jacobian work. The initial-value problem still has its own initial state, error controls and integration outcome. The extra function-call column axis is not automatically an example axis in the returned trajectory. Methods can also have different performance consequences from enabling this option.

## Implementation details

Implement and test the columnwise right-hand-side rule explicitly, including broadcasting of parameters that are truly shared. Keep independent trajectory identifiers outside the solver's temporary evaluation axis. If an application wants an ensemble, choose a deliberate orchestration method or formulate a larger coupled state with understood shared error control; do not infer ensemble independence from vectorized=True. Preserve method, function shape contract and derivative configuration when benchmarking. Compare valid scientific results before comparing throughput, since a fast incorrectly broadcast derivative can still produce an apparently successful integration.

## A constructed validation case

Use a controlled equation and compare a matrix call with independently computed per-column calls at the same time. Include unequal column states so accidental sharing or reduction is visible. Then run the intended solver configuration and compare its trajectory with a validated nonvectorized reference. Add a deliberately cross-column implementation as a negative control. Acceptance requires the documented function identity and correct trajectory semantics, not a claim that the temporary columns are independent user requests or that every solver becomes faster.

## Numerical and data limits

This is a numerical-call shape contract, not a distributed scheduling guarantee. Ensemble parallelism, GPU execution and dataset batching need their own designs. Keeping the axes separate prevents an implementation convenience from changing the scientific meaning of a trajectory collection used to train or evaluate AI models.

## Primary references

[SciPy integrate.solve_ivp API](https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html); [SciPy integration guide](https://docs.scipy.org/doc/scipy/tutorial/integrate.html).

This is a proposed scientific-interface validation, not an executed Retrivium benchmark. Preserve the implementation version and unresolved outcomes; interface documentation does not establish the accuracy or performance of a scientific model.

## Related reading

[JAX vmap axes: keep shared parameters separate from the example dimension](/journal/fg2-jax-vmap-shared-parameter-axes/); [A GPU inference benchmark you can trust](/journal/inference-benchmark-method/).
