yasfpy.coupling.factory ======================= .. py:module:: yasfpy.coupling.factory .. autoapi-nested-parse:: Factory for per-simulation dense coupling operations. The dense coupling backend uses a low-level "ops" object that performs matvecs and owns any per-simulation caches/buffers. This module provides a single entry point :func:`get_dense_coupling_ops` that selects a CPU or CUDA implementation at runtime. Functions --------- .. autoapisummary:: yasfpy.coupling.factory.get_dense_coupling_ops Module Contents --------------- .. py:function:: get_dense_coupling_ops(sim) Return a per-simulation dense coupling ops instance. :param sim: Simulation instance. :returns: A CPU or CUDA implementation of :class:`yasfpy.coupling.ops.DenseCouplingOps`. :rtype: DenseCouplingOps .. rubric:: Notes The returned object is cached on the simulation instance under ``sim._dense_coupling_ops`` so repeated matvec calls reuse internal buffers. If ``sim.numerics.gpu`` is true but Numba CUDA is unavailable, the factory falls back to CPU ops (and emits a warning).