linop.ComponentDiagonal#
- class bartorch.linop.ComponentDiagonal#
Bases:
LinearOperatorA diagonal on the real part and another on the imaginary part.
BART’s
linop_rdiag, which ismd_zrmul: the real part of the input is scaled by the real part ofdiagand the imaginary part by the imaginary part, each on its own. It is the operator for treating a complex array as two real channels, not the real-valued diagonal its BART name suggests: that isDiagonalgiven a real diagonal, adjoint included, since conjugating a real number does nothing.So
ComponentDiagonal(w)with a realwscales the real part bywand annihilates the imaginary part; scaling both takesw + 1j * w, orDiagonal.Scaling two components separately is linear over the reals and not over the complex numbers, as
ConjandRealare: it is self-adjoint for a real inner product and does not pass a complex dot test on its own.- Parameters:
diag (tensor) – Its real part scales real parts and its imaginary part scales imaginary parts. Every axis is either the operator’s size along that axis or one, and the ones are broadcast.
shape (tuple of int) – The shape the operator works on, C order.
Also has the methods and properties of LinearOperator.