Skip to content

Direct Shared ​

Both Direct Shared strategies build a common spatial parent from phase snapshots and recover temporal coefficients by sampled least squares. The Per-readout strategy checks snapshot prefixes on each readout. Global rotates the all-time coefficients and checks their error over the stacked phase matrix.

Direct Shared (Global strategy) constructs a common spatial parent directly from representative phase snapshots across readouts, fits all actual time rows, and recompresses the completed coefficients. A user-supplied global H tolerance then drives empirical rank selection and bounded resource expansion. This is distinct from Incremental Shared, which first constructs and incrementally merges local readout factors.

Select method=:direct_shared, strategy=:global with epsilon_H in HighOrderLowRankOp. The default LowRank construction is Incremental Shared. Direct Shared's strategy=:per_readout uses sampled per-readout acceptance.

Both Direct Shared strategies share residual feature preparation, representative snapshot selection, snapshot-space construction, fitting-point selection and the Float64 QR coefficient map. Their fitting pools, rank ordering and acceptance policies differ: Per-readout tests snapshot prefixes and audits the selected factors; Global rotates full-time parent coefficients and uses paired global residual checks with bounded resource expansion.

The internal factor-level control HighOrderMRI.joint_fixed_spatial_basis supports ordering=:snapshot and :coefficient. The former fixes a snapshot prefix with the Per-readout fitting pool; the latter fixes both parent_rank and the retained rank after coefficient rotation. It returns host factors and performs no acceptance test or budget expansion. Its empirical_status=:not_evaluated must not be presented as a tolerance pass. The public operator selects these strategies with method=:direct_shared and strategy=:per_readout or :global. The joint_* controls and adaptive_options keep their numerical meanings; see the implementation guide.

Guarantee level

Projection identities, least-squares stability and SVD recompression have conditional mathematical guarantees derived below. The current snapshot policy, resource expansions and sqrt(mean(loss)+4SE) acceptance rule are empirical strategies. A successful construction reports an empirical pass, with certification_status=:not_requested; it is not a full-matrix or probabilistic certificate, a globally minimal-rank result, or an image-error guarantee.

Common target and phase contract ​

Use the same residual model and notation as Incremental Shared. Let N=NtNro and stack all Hi into H∈CN×Nv, with samples varying fastest within each readout. For stacked time index u,

Huv=exp⁡(i2παuTβv),αu=(tu,k1ures,…)T,βv=(Δf0,v,b1vres,…)T.

Both feature vectors are real. The residual rows follow the 2D/3D Fourier split, with supplied concomitant terms appended when present. Seconds times Hz and the integrated field/basis products are in cycles; the forward sign is positive. H excludes the first-order NFFT, zeroth-order phase, centre correction, CSM, data weights and 1/Nv. Actual ADC times and their phase reference are retained.

The target is

eH=∥H−q^SH∥FNNv≤ϵH,0<ϵH<1,

because every original entry has unit modulus. Here q^ denotes the pure, unscaled coefficients. The factor-level function returns these as q; the constructed operator's op.q additionally contains the temporal phase and normalization folding. Do not compare op.q * op.basis' directly with pure H. For epsilon_H=0.01, the mean squared residual target is 10−4, not 1% discarded squared energy.

The ideal common-space problem is

minSHS=IR,q^∥H−q^SH∥F2.

For fixed S, the optimum is q^=HS; optimizing S gives the leading right singular vectors of the full H. The minimum squared residual is its singular-value tail. [5] [28] The implemented snapshots and gappy fitting approximate this objective without forming H; they do not perform its exact global SVD. Global error weights each entry equally. For unequal readout lengths the corresponding denominator would be Nv∑iNt,i, rather than an unweighted average of readout percentages; the current constructor uses rectangular sample/readout arrays.

Low rank is input-dependent even for this analytic phase model. For example, the square matrix Huv=exp⁡(i2πuv/n), with u,v=0,…,n−1, has equal singular values and best rank-R relative error (n−R)/n. Thus smooth phase formulas alone cannot guarantee a small rank at arbitrary phase extent or a successful finite resource budget.

Phase geometry and representative snapshots ​

Let β― and Cβ be the mean and covariance of the spatial features over the complete original mask:

Cβ=1Nv∑v(βv−β―)(βv−β―)T.

In exact arithmetic, a covariance factor satisfies LβLβT=Cβ. The corresponding features αuTLβ have distance

duw2=(αu−αw)TCβ(αu−αw).

The covariance can be singular, so this is a pseudometric: different time states can have distance zero. It becomes an ordinary Euclidean metric after identifying states with the same transformed features. The code clips negative eigenvalues of the computed covariance to zero; the displayed identity and the following bound use the exact covariance, rather than asserting an identity for a rounded and clipped matrix.

Phase-distance bound. If hu and hw are the corresponding rows of H,

min|γ|=1∥hu−γhw∥2Nv≤2πduw.

Choose γ=exp⁡[i2π(αu−αw)Tβ―] and apply |exp⁡(ix)−1|≤|x| to the centred phase at each voxel. Squaring and averaging gives the bound. A scalar row phase can be represented by the temporal coefficients without enlarging the spatial span. The production fit retains the actual ADC times and the corresponding scalar row phases.

Farthest-point selection in this feature geometry is related to metric covering methods. [27] In ideal arithmetic, farthest-first traversal has covering radius at most twice the optimal K-centre radius on the finite candidate set. For positive radius, the K centres and one farthest remaining point are mutually separated by the achieved radius, while two of these K+1 points must share an optimal ball. Zero radius already gives exact coverage in the feature geometry. The same argument holds for the pseudometric or its equivalence classes. This coverage statement is not a low-rank optimality theorem; numerical stopping and rounded distances introduce further qualifications.

The implementation forms time candidates every 16 samples plus the last sample on construction readouts. When there are at least four readouts, it reserves max(1,nDyn÷10) randomly selected readouts from initial space construction. The candidate rule does not guarantee coverage of all omitted time states. All actual rows, including reserved readouts, enter the later coefficient fit and the global evaluation population.

Weighted snapshot POD ​

In this derivation, let K be the actual number of selected time rows in I; the requested budget is an upper limit, since repeated features or a smaller candidate set can yield fewer snapshots. Let k(u)∈{1,…,K} index the centre assigned to candidate row u, so its snapshot row is Ik(u), and let wk be the unnormalized assignment count for centre k. Construct the spatial snapshot matrix

X=H[I,:]Hdiag(w1,…,wK)∈CNv×K.

Its leading left singular vectors give the parent Q0 of actual width 1≤r0≤min(K,Nv) for a successful construction. This is weighted snapshot POD. [25] For Q0HQ0=I and P0=Q0Q0H,

∥X−P0X∥F2=∑h>r0σh(X)2.

This optimality concerns X, not full H. A direct connection to the candidate population C follows from the phase-distance bound:

∥HC(I−P0)∥F≤2πNv∑u∈Cdu,Ik(u)2+∑h>r0σh(X)2.

For the proof, replace each candidate row by its assigned snapshot with the row phase used above. The first term bounds the replacement error. Projection of the replacements has squared residual equal to the weighted snapshot tail; the triangle inequality completes the result. This derived bound applies to C only and is not computed as a full-H certificate by the code.

The implementation accumulates a small snapshot Gram and orthogonally corrects the retained spatial basis. The actual r0 depends on the parent cap and numerically resolved spectrum; unresolved directions are not zero-padded to reach a requested width. Float32 Gram failures can trigger a Float64 Gram reaccumulation from the same quantized phase samples. This improves the Gram calculation but cannot recover information already lost in phase evaluation.

Oversampled coefficient fitting ​

For J distinct selected voxels, let MJ∈RJ×Nv be the selection matrix and AJ=MJQ0, with 1≤r0≤J≤Nv. Assuming AJ has full column rank, the all-time gappy fit is

q^0=HMJT(AJ†)H,H~=q^0Q0H.

It solves the complex least-squares problem on the selected voxels for each actual time row. Gappy POD supplies this sparse-data coefficient recovery framework. [26] The fit map is obtained by thin QR, and H[:,J] is evaluated in time chunks; no full H or explicit inverse is required.

The current selector performs column-pivoted QR on the conjugate transpose of Q0 restricted to a uniform candidate voxel pool, then adds random unused pool points. Its relation to Q-DEIM and oversampled gappy POD is methodological; the full-space or randomized-sampling theorems cannot be transferred without matching their assumptions. [16] [17]

Conditional gappy bound. For orthonormal Q0 and full-rank AJ,

∥H−H~∥F≤γJ∥H(I−P0)∥F,γJ=∥AJ†∥2.

For a column x of HH, set P=Q0AJ†MJ. Then PQ0=Q0 and (I−P)x=(I−P)(I−P0)x. For a nontrivial projection, ∥I−P∥2=∥P∥2; selection with distinct rows and orthonormal Q0 gives ∥P∥2=∥AJ†∥2. Applying the vector inequality to all columns proves the Frobenius result. The identity-projection case has zero residual.

This bound separates missing spatial information from recovery amplification. The condition number κ(AJ) alone is not γJ: AJ=cI has condition number one for arbitrarily small |c|, but inverse norm 1/|c|. The implemented condition limit is a numerical guard, not an independent approximation certificate.

Distinguishing space and fit errors ​

For any full-rank parent, including a slightly nonorthogonal numerical one, define the full-domain oracle coefficients

C∗=HQ0(Q0HQ0)−1,E=H−C∗Q0H.

Since EQ0=0,

∥H−q^0Q0H∥F2=∥E∥F2+∥(q^0−C∗)Q0H∥F2.

This identity is rigorous; the implementation evaluates it on a small set of time rows over all masked voxels using a stable small solve. It is not a complete-time certificate. A large first term suggests insufficient space; a large second term suggests poor coefficient recovery. The thresholds and resource increments used to act on that evidence remain empirical choices.

Per-readout strategy ​

The Per-readout strategy uses prefixes QR=Q0[:,1:R] of the snapshot basis. For each fitting budget J and tested rank R, it computes

q^J,R=HMJT((MJQR)†)H.

This is the same gappy least-squares fit derived above, now applied to a snapshot prefix. During selection, only the required time rows of q^J,R are evaluated. Let Ti be the validation times in readout i and V the validation voxels. The reported error is

e^i(R)2=1|Ti||V|∑u∈Ti∑v∈V|Huv−(q^J,RQRH)uv|2.

The denominator is the exact squared Frobenius norm of H on that sampled submatrix, since its entries have unit modulus. Selection requires maxie^i(R)≤0.9shared_basis_tol, plus the analogous high-|B0| check only when joint_roi_tol is supplied. The implementation tests ranks 1, 8, 16, and so on, including the available rank limit. It tries at most the requested fitting count and twice that count, each clipped to the fitting pool. It does not search every integer rank or expand snapshots as the Global strategy does.

After selection, all actual time coefficients are fitted. A second sampled check of those completed factors uses shared_basis_tol without the 0.9 margin. Failure throws; it does not trigger another rank search. Both checks use Cartesian time/voxel submatrices, rather than Global's iid entry-pair design. Their voxel sets exclude the fitting pool but can overlap each other, and all masked voxels already participate in snapshot construction. The time sets are disjoint when enough unused samples exist; tiny problems can reuse times, recorded in disjoint_times. These checks support an empirical per-readout pass, not a full-H or probability bound.

For either strategy, the gappy bound above applies to a fixed orthonormal prefix when its sampled matrix has full column rank. The strategies differ in which prefixes they test and how they accept them. Only Global performs the all-time coefficient rotation and resource adaptation described next.

Full-time recompression and total error ​

For an orthonormal parent, take a stable QR/small SVD of all-time q^0=UqΣqVqH. Set

q^R=q^0Vq,R,SR=Q0Vq,R.

The implemented blocked QR merges triangular factors and takes the SVD of the resulting small matrix; it does not estimate weak tails by subtracting leading energy from a Gram total. TSQR provides the factorization background. [22]

The nonzero singular values of H~ equal those of q^0, so

∥H~−q^RSRH∥F2=∑h>Rσh(q^0)2.

This is the optimal rank-R approximation of H~, not necessarily of H. With e0=∥H−H~∥F/NNv, a conservative total bound is

eH(R)≤e0+∑h>Rσh(q^0)2NNv≤γJ∥H(I−P0)∥FNNv+∑h>Rσh(q^0)2NNv.

The first term is not measured exactly at full size, so the spectral tail alone cannot accept the final factors. A related conditional comparison with the best rank-R approximation HR∗ is

∥H−q^RSRH∥F≤∥H−HR∗∥F+2∥H−H~∥F.

Indeed the best rank-R truncation of H~ cannot have larger error to H~ than HR∗; applying the triangle inequality twice gives the claim. It is useful when the base approximation is already accurate, and does not establish a globally minimal selected rank.

Nonorthogonal factors and finite precision ​

For an exact spectral interpretation of existing full-column-rank factors, take a thin QR factorization S=QT with QHQ=I and replace their coefficients by q^TH. The prediction remains q^SH=(q^TH)QH, before spectral recompression. This algebra applies equally to local-rSVD/shared factors and joint factors; a fair comparison gives both the same final treatment. This is a change of basis one can apply to either representation; the legacy optional shared recompression does not perform this QR correction.

The current joint parent is numerically orthogonally corrected, not exactly orthogonal. For its actual factors the additional tail bound has multiplier ∥Q0∥2≤1+η if ∥Q0HQ0−I∥2≤η. Phase evaluation, fitting and output rotations introduce further numerical defects. Mathematical tail identities therefore do not certify the saved Float32 factors; the evaluator uses the actual Complex{T} outputs against independently evaluated phase entries.

Why the original-H error need not decrease at every prefix ​

For orthonormal Q0, write C=HQ0, Δ=q^0−C and ΠR=Vq,RVq,RH. Orthogonal row-space components give

∥H−q^0ΠRQ0H∥F2=∥H(I−P0)∥F2+∥C(I−ΠR)∥F2+∥ΔΠR∥F2.

The second term decreases with nested R, but the retained fitting-error term can increase. The gappy fit is not the full projection C, so base error and coefficient-tail error cannot generally be added in quadrature. The code checks ordered prefixes rather than assuming a monotone error and bisecting.

Global evaluation and rank selection ​

For fixed factors and R, independently draw row/voxel pairs uniformly with replacement over the complete H and define

za=|Huava−(q^RSRH)uava|2,eH2=E[za],e^H2=1m∑a=1mza.

The sample mean is unbiased for squared global error before adaptive selection; its square root is not exactly unbiased. Repeated draws count as repeated observations. Construction/evaluation coincidences are allowed and should be recorded; removing training entries changes the target population. A Cartesian submatrix is not a collection of independent entry draws. Readout, ROI and tail errors are separate diagnostics, not additional epsilon_H requirements.

The current builder evaluates all prefixes with two internal sample sets, by default 100,000 selection and 400,000 acceptance pairs. Their default random streams use separate seeds; user overrides can make the seeds equal, so independence is not enforced for every configuration. It chooses the first prefix passing sqrt(mean(loss)+4SE) < epsilon_H in both sets, where SE is the estimated standard error of the mean squared loss. Both sets therefore participate in R selection: the second is not an untouched final holdout. The 4SE margin has no general finite-sample coverage theorem and does not account for all adaptive queries.

For example, a population of one million entries with one squared loss of 1000 has eH=0.001, approximately 3.16%. A 400,000-pair sample misses that entry with probability (1−10−6)400000, approximately 67.0%; then its mean and SE are both zero. This artificial example is a limitation of the general heuristic, not an observed failure of a specific saved factor.

For a chosen rule and factor, freeze both before a new external evaluation. Record factor/input hashes, sampling scope, overlap, counts and uncertainty. A new empirical audit does not by itself become a deterministic full-matrix or high-probability certificate. The constructor leaves external_audit_status=:not_requested for this caller-owned step.

What a probabilistic certificate would additionally require ​

For a frozen factor, a fixed sample count m≥2, 0<δ<1, and iid losses in [0,Bz] from fresh uniform entry draws independent of that factor, the empirical Bernstein theorem gives, with probability at least 1−δ,

eH2≤z―+2sz2log⁡(2/δ)m+7Bzlog⁡(2/δ)3(m−1),

where sz2 is the unbiased sample variance. [29] A valid but potentially loose loss bound is Bz=(1+maxu∥q^R,u,:∥2maxv∥SR,v,:∥2)2. Here δ is a statistical failure probability, distinct from the accuracy target ϵH. For a finite collection of M candidates frozen before sampling, allocating δ/M to each yields a simultaneous bound even when they share evaluation draws. Candidates constructed using earlier evaluation results instead need a suitable uniform theorem, or fresh conditionally independent samples with a valid summable failure-probability budget at each query. Simply dividing by the observed number of adaptive queries does not repair data reuse. Optional stopping in the sample count also requires its own control. Numerical certification additionally needs a rounding budget for the loss, variance and bound computations.

The current implementation does not apply this certificate. A loose bound can be inconclusive even when empirical error is small, and does not justify automatically increasing R.

Resource adaptation and failure semantics ​

The initial budgets are at most 128 snapshots, 512 fit points and parent cap 32; they are resource starting points, not expected answers. Actual parent width r0 is read from the constructed space. Failed checks can expand J, the parent cap or K, subject to adaptive_options and shared_rank_max.

The current diagnostic uses selected time rows across all voxels. If spatial projection error is at most 0.9 * epsilon_H, or fitting error dominates, the policy first expands fitting. Otherwise it increases the parent when resolved snapshot directions remain beyond the cap, or expands snapshots. J/K growth, parent increments, condition limits and the diagnostic thresholds are engineering rules; they do not prove optimal resource allocation, monotone improvement or success for every input.

On exhaustion the factor-level function returns q=S=nothing, rank zero and a failure reason. The operator constructor records the report and throws; it does not silently install partial factors, relax epsilon_H, or change the NFFT backend. Time and memory budgets have the limitations stated in the generated API.

Guarantees and empirical strategies ​

ComponentWhat is establishedWhat is not established
Phase covariance distanceDerived upper bound on phase-row distance up to scalar phase.Complete-time coverage from the subsampled candidate rule.
Weighted snapshot PODOptimal truncation of the weighted snapshot matrix in exact arithmetic.Globally optimal parent for full H.
Gappy fitComplex least squares and a conditional error-amplification bound.Accuracy from condition number or J alone.
Full-time recompressionOptimal rank-R truncation of the fitted approximation for an orthonormal parent.Original-H accuracy from the coefficient tail alone.
Global paired samplingUnbiased squared-error estimator for fixed factors and independent uniform draws.General finite-sample coverage of the current 4SE rule after selection.
Adaptive K/J/capBounded error-diagnostic-driven policy with explicit failure.Globally minimal R, optimal budgets or guaranteed success.
H toleranceAn explicit target relative to the frozen input phase model.Correct B0, physical truth, worst-ROI accuracy or the same image-error percentage.

The shared theory page derives the weighted encoding-error relation and an illustrative conditioned Tikhonov perturbation bound. These apply to either factor construction; finite CG and NFFT errors remain separate.

Separable approximation of MRI field modulation predates either path; time segmentation and higher-order singular-vector separation are relevant foundations. [30] [2] Snapshot POD, gappy recovery, QR selection and SVD are established numerical components. Hierarchical POD and MRI group-patch compression provide additional shared-space context, with different algorithms and assumptions. [23] [20] Here the approximated matrix excludes receive sensitivities and all actual time rows use one final spatial basis; joint B0/RF compression of grouped encoding matrices addresses a different compression target.

Package construction choices ​

The implementation uses:

  1. a phase-aware representative space shared across actual readouts;
  2. one oversampled coefficient map applied to all actual time rows;
  3. full-time spectral recompression followed by original-H global residual evaluation, rather than accepting a snapshot or coefficient tail alone;
  4. bounded K/J/parent expansion guided by separate space and fit diagnostics.

These identify the implementation's algorithmic contribution and its distinction from local-rSVD sharing. They do not establish a first-in-literature claim for each ingredient or for all joint MRI compression. The phase-distance and error decompositions here are model-specific derivations, not claims of new general linear-algebra theorems. Comparative novelty requires method-level comparison with the cited literature; speed and memory advantages require measured matched-accuracy evidence. The global empirical criterion does not favor one front end in advance: local-rSVD factors can receive the same recompression and original-H evaluation.

Interface and interpretation ​

Given the matching grid, field model, mask and coil maps, select the opt-in path:

julia
op = HighOrderLowRankOp(grid, kspha, times;
    fieldmap, csm, mask,
    method=:direct_shared, strategy=:global,
    epsilon_H=0.01,
)

The experimental factor-level entry HighOrderMRI.joint_adaptive_spatial_basis creates no NFFT plans and returns host matrices even with GPU construction. epsilon_H is a scalar global H target; it does not automatically select local rSVD rank or prove an optimal sketch budget. joint_basis_report receives construction, empirical, external-audit and certification states without the large factor arrays. Its empirical pass should be reported with the evaluation design and actual factor precision.

HighOrderMRI.jl documentation · stable · v0.1.2 · code 9af532a · docs 9af532a