pub fn rotate_state_rank_blocks_two_sided<const D: usize, const DB: usize>(
v: Tensor<D>,
ql: Tensor<DB>,
qr: Tensor<DB>,
) -> Tensor<D>Expand description
Apply a per-block two-sided quaternion rotation to the state_rank axis
of v: v ↦ ql ⊗ v ⊗ qr per 4-block.
This is the general SO(4) element (RotationKind::Rotor4D); pass
qr = (1,0,0,0) to recover rotate_state_rank_blocks. Absorbing the
inverse cumulative rotation into B/C (B̄ = P⁻¹B with
P(v) = Q v T̄) is ql = conj(Q), qr = T — note the conjugate is on the
left factor only.
Shapes as rotate_state_rank_blocks: v is [..., state_rank], both
quaternions [..., J, 4], and DB = D + 1.