Radiative transfer is a key bottleneck in computational astrophysics: it is nonlocal, stiff, and tightly coupled to hydrodynamics. We introduce Ray-trax, a GPU-oriented, fully differentiable 3D ray tracer written in JAX that solves the time-dependent emission--absorption problem and runs directly on turbulent gas fields produced by hydrodynamic simulations. The method favors the widely used on-the-fly emission--absorption approximation, which is state of the art in many production hydro codes when scattering is isotropic. Ray-trax vectorizes across rays and sources, supports arbitrarily many frequency bins without architectural changes, and exposes end-to-end gradients, making it straightforward to couple with differentiable hydro solvers while preserving differentiability. We validate against analytical solutions, demonstrate propagation in turbulent media, and perform a simple inverse problem via gradient-based optimization. In practice, the memory footprint scales as $\mathcal{O}(N_{\text{src}}\,N_{\text{cells}})$ while remaining highly efficient on accelerators.
翻译:辐射传输是计算天体物理学中的一个关键瓶颈:它具有非局部性、刚性特征,并与流体动力学紧密耦合。我们提出了Ray-trax,一个基于JAX编写的、面向GPU的完全可微分三维射线追踪器,它解决了时间相关的发射-吸收问题,并可直接在流体动力学模拟产生的湍流气体场上运行。该方法广泛采用实时发射-吸收近似,该近似在各向同性散射条件下是许多生产级流体力学代码的先进技术。Ray-trax在射线和源之间进行向量化处理,支持任意数量的频率区间而无需调整架构,并暴露端到端的梯度,使其能够轻松与可微分流体求解器耦合,同时保持可微性。我们通过解析解验证了其准确性,展示了在湍流介质中的传播过程,并通过基于梯度的优化完成了一个简单的反问题求解。在实际应用中,其内存占用按$\mathcal{O}(N_{\text{src}}\,N_{\text{cells}})$规模增长,同时在加速器上保持高效运行。