bartorch.linop.ComponentDiagonal#
- class bartorch.linop.ComponentDiagonal(diag, shape)#
A 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 a real-valued diagonal, which is what its BART name suggests and whatDiagonalalready is when given 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, and it takesw + 1j * wto scale both. If that is what you want, reach forDiagonal.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.
- __init__(diag, shape)#
Methods
A(x, **kwargs)A x, underdeepinv's name.A_adjoint(y, **kwargs)A^H y, underdeepinv's name, recorded for autograd.A_adjoint_A(x, **kwargs)A^H A x, underdeepinv's name, recorded for autograd.A_dagger(y, **kwargs)The pseudo-inverse, under
deepinv's name.__init__(diag, shape)adjoint(y[, out])A^H y, without recording for autograd.cogram()A A^Has an operator.conj()conj(A): conjugate the input, apply, conjugate the output.forward(x[, out])A x, without recording for autograd.gram()A^H Aas an operator.normal(x[, out])A^H A x.opnorm()The spectral norm, by BART's power iteration on
A^H A.pinv(y[, damp])(A^H A + damp I)^-1 A^H y, the damped least-squares solution.to_nonlinear()The same operator as a
NonlinearOperator.Attributes
HA^H, from BART's own adjoint constructor.TA^T, the adjoint without the conjugation, asconj(A).H.codim_rankHow many axes the codomain has.
codim_shapeThe codomain, under pyxu's name for it; the same as
oshape.codim_sizeHow many elements the codomain holds.
devicedim_rankHow many axes the domain has.
dim_shapeThe domain, under pyxu's name for it; the same as
ishape.dim_sizeHow many elements the domain holds.
ishapeoshape