xzackli / Bolt.jl

differentiable boltzmann code
MIT License
42 stars 5 forks source link

need a fast array type for the component vector #38

Closed xzackli closed 3 years ago

xzackli commented 3 years ago

Interacting with the component vector could be easier. The vector is [Θ..., Θᵖ..., 𝒩..., Φ, δ, v, δb, vb]. The relativistic components Θ, Θᵖ, 𝒩 are expanded in multipoles, and therefore are parts of the array indexed by multipole (typically 0 through ~8). @marius311 tried using ComponentArrays in https://github.com/xzackli/Bolt.jl/compare/main...marius311:componentarrays but incurred a 2x speed hit, maybe it's something related to memory layout?

A simple array type that just does what is currently done (offsetarray of views) would be a nice addition.