% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_B.R
\name{.woodbury_halfsqrt_components}
\alias{.woodbury_halfsqrt_components}
\title{Compute Woodbury Half-Square-Root Components}
\usage{
.woodbury_halfsqrt_components(Ghalf_corrected, E, J_signs, r, K, p_expansions)
}
\arguments{
\item{Ghalf_corrected}{List of corrected \eqn{\mathbf{G}_{\mathrm{on},k}^{1/2}}.}

\item{E}{Off-diagonal low-rank factor (\eqn{P \times r}), denoted
\eqn{\mathbf{E}} in the supplement.}

\item{J_signs}{Length-\eqn{r} sign vector corresponding to the
diagonal of \eqn{\mathbf{J}}.}

\item{r}{Integer effective rank.}

\item{K, p_expansions}{Integer dimensions.}
}
\value{
A list with components:
\describe{
  \item{valid}{Logical; FALSE if \eqn{\mathbf{F}} is not positive
    definite (signals fallback to dense).}
  \item{U_Q}{\eqn{P \times r} left singular vectors of
    \eqn{\mathbf{N} = \mathbf{G}_{\mathrm{on}}^{1/2}\mathbf{E}}. This spans the same
    subspace as the supplement QR factor \eqn{\mathbf{Q}}.}
  \item{Q_basis}{Alias for \code{U_Q}, included so the stored object can
    be read directly against the supplement notation \eqn{\mathbf{Q}}.}
  \item{C}{\eqn{r \times r} diagonal matrix
    encoding the rank-\eqn{r} update in the internal form
    \eqn{\mathbf{F}^{1/2} = \mathbf{I}_P - \mathbf{U}_Q\mathbf{C}
    \mathbf{U}_Q^{\top}}.}
  \item{C_inv}{\eqn{r \times r} diagonal matrix
    encoding the inverse update in the internal form
    \eqn{\mathbf{F}^{-1/2} = \mathbf{I}_P +
    \mathbf{U}_Q\mathbf{C}_{\mathrm{inv}}\mathbf{U}_Q^{\top}}.}
  \item{GchalfUQ}{List of \eqn{K+1} matrices, each \eqn{p \times r}:
    \eqn{\mathbf{G}_{\mathrm{on},k}^{1/2} \mathbf{U}_Q[rows_k,]}.}
}
}
\description{
Converts the low-rank Woodbury decomposition into square-root objects
used directly by the solver. Starting from
\eqn{\mathbf{N} = \mathbf{G}_{\mathrm{on}}^{1/2}\mathbf{E}}, it builds
a basis for the supplement matrix \eqn{\mathbf{Q}} and stores
\eqn{\mathbf{F}^{1/2}} and \eqn{\mathbf{F}^{-1/2}} in the internal forms
\eqn{\mathbf{I} - \mathbf{U}_Q\mathbf{C}\mathbf{U}_Q^{\top}} and
\eqn{\mathbf{I} + \mathbf{U}_Q\mathbf{C}_{\mathrm{inv}}\mathbf{U}_Q^{\top}}.
}
\details{
This helper is standalone: its output is the complete square-root state
consumed by \code{.lagrangian_project_woodbury()}.
}
\keyword{internal}
