jax_sn.variance_reduction.continuous_adjoint module¶
Continuous adjoint of the multi-group operator.
The continuous adjoint \(\mathbf{A}^\dagger\) is the discretisation of the adjoint transport
equation: it negates the streaming direction (\(\Omega \to -\Omega\)) but keeps the moment/discrete
operators \(\mathbf{M}, \mathbf{D}\) at \(+\Omega\), and gathers the transposed group scatter.
It is therefore not the algebraic transpose \(\mathbf{A}^T\) (which reverses the whole operator
chain); see MultiGroupOperator.
Because the harmonics wk_ylm/ylm are frozen at AngularData construction and only the transport sweep re-reads
quadrature_set.angles, negating the angles after that freeze flips only the streaming, leaving
\(\mathbf{M}, \mathbf{D}\) at \(+\Omega\). Combined with (a) reversing the sweep ordering to match
the negated direction and (b) transposing the group axes of the scatter tensor (so the forward
incoming_gather computes the outgoing sum), the ordinary forward
MultiGroupOperator run on this
transformed data is \(\mathbf{A}^\dagger\). No new operator/strategy/solver is introduced.
The transformed data is deliberately kept private and consumed immediately inside
solve_continuous_adjoint(): it is a valid computational object but internally inconsistent (its
angles no longer match its frozen harmonics; its scatter tensor is transposed), so it must never escape
into general use.
- solve_continuous_adjoint(operator: MultiGroupOperator, rhs, solver: AbstractLinearSolver)[source]¶
Solve \(\mathbf{A}^\dagger \psi^\dagger = \mathbf{C}^\dagger[b]\) for the continuous adjoint of
operator, where the source is conditioned by the adjoint chain \(\mathbf{C}^\dagger = \mathbf{M}\,(\mathbf{T}^\dagger)^{-1}\mathbf{H}\mathbf{D}\) (built automatically because the chain strategy runs on the adjoint-transformed data).The adjoint operator is the ordinary forward
MultiGroupOperatorrun on_continuous_adjoint_data(); it is built inside the jit so gradients w.r.t. cross sections / geometry still flow through the adjoint solve.- Parameters:
operator (
MultiGroupOperator) – The forward multi-group operator whose continuous adjoint is solved.rhs (RightHandSide) – The (physical) adjoint source.
solver (
AbstractLinearSolver) – An iterative solver (GMRES / BiCGStab). The direct block solver is rejected: for downscattering the continuous adjoint is upper-triangular, which that solver does not handle.
- Return type:
lx.LinearSolveOutput