Combines one or more LinearOperators in to a Block Diagonal matrix.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorBlockDiag
This operator combines one or more linear operators [op1,...,opJ], building a new LinearOperator, whose underlying matrix representation is square and has each operator opi on the main diagonal, and zero's elsewhere.
If opj acts like a [batch] square matrix Aj, then op_combined acts like the [batch] square matrix formed by having each matrix Aj on the main diagonal.
Each opj is required to represent a square matrix, and hence will have shape batch_shape_j + [M_j, M_j].
If opj has shape batch_shape_j + [M_j, M_j], then the combined operator has shape broadcast_batch_shape + [sum M_j, sum M_j], where broadcast_batch_shape is the mutual broadcast of batch_shape_j, j = 1,...,J, assuming the intermediate batch shapes broadcast. Even if the combined shape is well defined, the combined operator's methods may fail due to lack of broadcasting ability in the defining operators' methods.
Arguments to matmul, matvec, solve, and solvevec may either be single Tensors or lists of Tensors that are interpreted as blocks. The jth element of a blockwise list of Tensors must have dimensions that match opj for the given method. If a list of blocks is input, then a list of blocks is returned as well.
The performance of LinearOperatorBlockDiag on any operation is equal to the sum of the individual operators' operations.
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, square. These have the following meaning:
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to x. Equivalent to A + x.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source


Combines LinearOperators into a blockwise lower-triangular matrix.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorBlockLowerTriangular
This operator is initialized with a nested list of linear operators, which are combined into a new LinearOperator whose underlying matrix representation is square and has each operator on or below the main diagonal, and zero's elsewhere. Each element of the outer list is a list of LinearOperators corresponding to a row-partition of the blockwise structure. The number of LinearOperators in row-partion i must be equal to i.
For example, a blockwise 3 x 3 LinearOperatorBlockLowerTriangular is initialized with the list [[op_00], [op_10, op_11], [op_20, op_21, op_22]], where the op_ij, i < 3, j <= i, are LinearOperator instances. The LinearOperatorBlockLowerTriangular behaves as the following blockwise matrix, where 0 represents appropriately-sized [batch] matrices of zeros:
Each op_jj on the diagonal is required to represent a square matrix, and hence will have shape batch_shape_j + [M_j, M_j]. LinearOperators in row j of the blockwise structure must have range_dimension equal to that of op_jj, and LinearOperators in column j must have domain_dimension equal to that of op_jj.
If each op_jj on the diagonal has shape batch_shape_j + [M_j, M_j], then the combined operator has shape broadcast_batch_shape + [sum M_j, sum M_j], where broadcast_batch_shape is the mutual broadcast of batch_shape_j, j = 0, 1, ..., J, assuming the intermediate batch shapes broadcast. Even if the combined shape is well defined, the combined operator's methods may fail due to lack of broadcasting ability in the defining operators' methods.
For example, to create a 4 x 4 linear operator combined of three 2 x 2 operators:
The above matmul is equivalent to:
This operator acts on [batch] matrix with compatible shape. x is a batch matrix with compatible shape for matmul and solve if
Create a [2, 3] batch of 4 x 4 linear operators:
Create a [1, 3] batch of 5 x 4 linear operators:
Create a [1, 3] batch of 5 x 5 linear operators:
Combine to create a [2, 3] batch of 9 x 9 operators:
Create a shape [2, 1, 9] batch of vectors and apply the operator to it.
Create a blockwise list of vectors and apply the operator to it. A blockwise list is returned.
Suppose operator is a LinearOperatorBlockLowerTriangular consisting of D row-partitions and D column-partitions, such that the total number of operators is N = D * (D + 1) // 2.
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, square. These have the following meaning:
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to x. Equivalent to A + x.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
Given the blockwise n + 1-by-n + 1 linear operator:
op = [[A_00 0 ... 0 ... 0], [A_10 A_11 ... 0 ... 0], ... [A_k0 A_k1 ... A_kk ... 0], ... [A_n0 A_n1 ... A_nk ... A_nn]]
we find x = op.solve(y) by observing that
y_k = A_k0.matmul(x_0) + A_k1.matmul(x_1) + ... + A_kk.matmul(x_k)
and therefore
x_k = A_kk.solve(y_k - A_k0.matmul(x_0) - ... - A_k(k-1).matmul(x_(k-1)))
where x_k and y_k are the kth blocks obtained by decomposing x and y along their appropriate axes.
We first solve x_0 = A_00.solve(y_0). Proceeding inductively, we solve for x_k, k = 1..n, given x_0..x_(k-1).
The adjoint case is solved similarly, beginning with x_n = A_nn.solve(y_n, adjoint=True) and proceeding backwards.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source


LinearOperator acting like a circulant matrix.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorCirculant
This operator acts like a circulant matrix A with shape [B1,...,Bb, N, N] for some b >= 0. The first b indices index a batch member. For every batch index (i1,...,ib), A[i1,...,ib, : :] is an N x N matrix. This matrix A is not materialized, but for purposes of broadcasting this shape will be relevant.
Circulant means the entries of A are generated by a single vector, the convolution kernel h: A_{mn} := h_{m-n mod N}. With h = [w, x, y, z],
This means that the result of matrix multiplication v = Au has Lth column given circular convolution between h with the Lth column of u.
There is an equivalent description in terms of the [batch] spectrum H and Fourier transforms. Here we consider A.shape = [N, N] and ignore batch dimensions. Define the discrete Fourier transform (DFT) and its inverse by
From these definitions, we see that
Loosely speaking, with * element-wise multiplication, matrix multiplication is equal to the action of a Fourier multiplier: A u = IDFT[ H * DFT[u] ]. Precisely speaking, given [N, R] matrix u, let DFT[u] be the [N, R] matrix with rth column equal to the DFT of the rth column of u. Define the IDFT similarly. Matrix multiplication may be expressed columnwise:
(A u)_r = IDFT[ H * (DFT[u])_r ]
Letting U be the kth Euclidean basis vector, and U = IDFT[u]. The above formulas show thatA U = H_k * U. We conclude that the elements of H are the eigenvalues of this operator. Therefore
A general property of Fourier transforms is the correspondence between Hermitian functions and real valued transforms.
Suppose H.shape = [B1,...,Bb, N]. We say that H is a Hermitian spectrum if, with % meaning modulus division,
H[..., n % N] = ComplexConjugate[ H[..., (-n) % N] ]
See e.g. "Discrete-Time Signal Processing", Oppenheim and Schafer.
Suppose operator is a LinearOperatorCirculant of shape [N, N], and x.shape = [N, R]. Then
If instead operator and x have shape [B1,...,Bb, N, N] and [B1,...,Bb, N, R], every operation increases in complexity by B1*...*Bb.
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, square. These have the following meaning:
Toeplitz and Circulant Matrices - A Review: Gray, 2006 (pdf)
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
With A the dense representation of this Operator,
block_depth = 1 means A is symmetric circulant. For example,
block_depth = 2 means A is block symmetric circulant with symmetric circulant blocks. For example, with W, X, Y, Z symmetric circulant,
block_depth = 3 means A is block symmetric circulant with block symmetric circulant blocks.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to x. Equivalent to A + x.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator has Hermitian spectrum.
This operator corresponds to a real-valued matrix if and only if its spectrum is Hermitian.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Shape of the block dimensions of self.spectrum.
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Convolution kernel corresponding to self.spectrum.
The D dimensional DFT of this kernel is the frequency domain spectrum of this operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source


LinearOperator acting like a block circulant matrix.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorCirculant2D
This operator acts like a block circulant matrix A with shape [B1,...,Bb, N, N] for some b >= 0. The first b indices index a batch member. For every batch index (i1,...,ib), A[i1,...,ib, : :] is an N x N matrix. This matrix A is not materialized, but for purposes of broadcasting this shape will be relevant.
If A is block circulant, with block sizes N0, N1 (N0 * N1 = N): A has a block circulant structure, composed of N0 x N0 blocks, with each block an N1 x N1 circulant matrix.
For example, with W, X, Y, Z each circulant,
Note that A itself will not in general be circulant.
There is an equivalent description in terms of the [batch] spectrum H and Fourier transforms. Here we consider A.shape = [N, N] and ignore batch dimensions.
If H.shape = [N0, N1], (N0 * N1 = N): Loosely speaking, matrix multiplication is equal to the action of a Fourier multiplier: A u = IDFT2[ H DFT2[u] ]. Precisely speaking, given [N, R] matrix u, let DFT2[u] be the [N0, N1, R] Tensor defined by re-shaping u to [N0, N1, R] and taking a two dimensional DFT across the first two dimensions. Let IDFT2 be the inverse of DFT2. Matrix multiplication may be expressed columnwise:
(A u)_r = IDFT2[ H * (DFT2[u])_r ]
A general property of Fourier transforms is the correspondence between Hermitian functions and real valued transforms.
Suppose H.shape = [B1,...,Bb, N0, N1], we say that H is a Hermitian spectrum if, with % indicating modulus division,
See e.g. "Discrete-Time Signal Processing", Oppenheim and Schafer.
Suppose operator is a LinearOperatorCirculant of shape [N, N], and x.shape = [N, R]. Then
If instead operator and x have shape [B1,...,Bb, N, N] and [B1,...,Bb, N, R], every operation increases in complexity by B1*...*Bb.
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, square. These have the following meaning
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
With A the dense representation of this Operator,
block_depth = 1 means A is symmetric circulant. For example,
block_depth = 2 means A is block symmetric circulant with symmetric circulant blocks. For example, with W, X, Y, Z symmetric circulant,
block_depth = 3 means A is block symmetric circulant with block symmetric circulant blocks.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to x. Equivalent to A + x.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator has Hermitian spectrum.
This operator corresponds to a real-valued matrix if and only if its spectrum is Hermitian.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Shape of the block dimensions of self.spectrum.
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Convolution kernel corresponding to self.spectrum.
The D dimensional DFT of this kernel is the frequency domain spectrum of this operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source


LinearOperator acting like a nested block circulant matrix.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorCirculant3D
This operator acts like a block circulant matrix A with shape [B1,...,Bb, N, N] for some b >= 0. The first b indices index a batch member. For every batch index (i1,...,ib), A[i1,...,ib, : :] is an N x N matrix. This matrix A is not materialized, but for purposes of broadcasting this shape will be relevant.
If A is nested block circulant, with block sizes N0, N1, N2 (N0 * N1 * N2 = N): A has a block structure, composed of N0 x N0 blocks, with each block an N1 x N1 block circulant matrix.
For example, with W, X, Y, Z each block circulant,
Note that A itself will not in general be circulant.
There is an equivalent description in terms of the [batch] spectrum H and Fourier transforms. Here we consider A.shape = [N, N] and ignore batch dimensions.
If H.shape = [N0, N1, N2], (N0 * N1 * N2 = N): Loosely speaking, matrix multiplication is equal to the action of a Fourier multiplier: A u = IDFT3[ H DFT3[u] ]. Precisely speaking, given [N, R] matrix u, let DFT3[u] be the [N0, N1, N2, R] Tensor defined by re-shaping u to [N0, N1, N2, R] and taking a three dimensional DFT across the first three dimensions. Let IDFT3 be the inverse of DFT3. Matrix multiplication may be expressed columnwise:
(A u)_r = IDFT3[ H * (DFT3[u])_r ]
A general property of Fourier transforms is the correspondence between Hermitian functions and real valued transforms.
Suppose H.shape = [B1,...,Bb, N0, N1, N2], we say that H is a Hermitian spectrum if, with % meaning modulus division,
See e.g. "Discrete-Time Signal Processing", Oppenheim and Schafer.
See LinearOperatorCirculant and LinearOperatorCirculant2D for examples.
Suppose operator is a LinearOperatorCirculant of shape [N, N], and x.shape = [N, R]. Then
If instead operator and x have shape [B1,...,Bb, N, N] and [B1,...,Bb, N, R], every operation increases in complexity by B1*...*Bb.
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, square. These have the following meaning
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
With A the dense representation of this Operator,
block_depth = 1 means A is symmetric circulant. For example,
block_depth = 2 means A is block symmetric circulant with symmetric circulant blocks. For example, with W, X, Y, Z symmetric circulant,
block_depth = 3 means A is block symmetric circulant with block symmetric circulant blocks.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to x. Equivalent to A + x.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator has Hermitian spectrum.
This operator corresponds to a real-valued matrix if and only if its spectrum is Hermitian.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Shape of the block dimensions of self.spectrum.
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Convolution kernel corresponding to self.spectrum.
The D dimensional DFT of this kernel is the frequency domain spectrum of this operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source


Composes one or more LinearOperators.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorComposition
This operator composes one or more linear operators [op1,...,opJ], building a new LinearOperator with action defined by:
If opj acts like [batch] matrix Aj, then op_composed acts like the [batch] matrix formed with the multiplication A1 A2...AJ.
If opj has shape batch_shape_j + [M_j, N_j], then we must have N_j = M_{j+1}, in which case the composed operator has shape equal to broadcast_batch_shape + [M_1, N_J], where broadcast_batch_shape is the mutual broadcast of batch_shape_j, j = 1,...,J, assuming the intermediate batch shapes broadcast. Even if the composed shape is well defined, the composed operator's methods may fail due to lack of broadcasting ability in the defining operators' methods.
The performance of LinearOperatorComposition on any operation is equal to the sum of the individual operators' operations.
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, square. These have the following meaning:
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to x. Equivalent to A + x.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source


LinearOperator acting like a [batch] square diagonal matrix.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorDiag
This operator acts like a [batch] diagonal matrix A with shape [B1,...,Bb, N, N] for some b >= 0. The first b indices index a batch member. For every batch index (i1,...,ib), A[i1,...,ib, : :] is an N x N matrix. This matrix A is not materialized, but for purposes of broadcasting this shape will be relevant.
LinearOperatorDiag is initialized with a (batch) vector.
This operator acts on [batch] matrix with compatible shape. x is a batch matrix with compatible shape for matmul and solve if
Suppose operator is a LinearOperatorDiag of shape [N, N], and x.shape = [N, R]. Then
If instead operator and x have shape [B1,...,Bb, N, N] and [B1,...,Bb, N, R], every operation increases in complexity by B1*...*Bb.
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, square. These have the following meaning:
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to x. Equivalent to A + x.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source


LinearOperator that wraps a [batch] matrix.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorFullMatrix
This operator wraps a [batch] matrix A (which is a Tensor) with shape [B1,...,Bb, M, N] for some b >= 0. The first b indices index a batch member. For every batch index (i1,...,ib), A[i1,...,ib, : :] is an M x N matrix.
This operator acts on [batch] matrix with compatible shape. x is a batch matrix with compatible shape for matmul and solve if
LinearOperatorFullMatrix has exactly the same performance as would be achieved by using standard TensorFlow matrix ops. Intelligent choices are made based on the following initialization hints.
In all cases, suppose operator is a LinearOperatorFullMatrix of shape [M, N], and x.shape = [N, R]. Then
If instead operator and x have shape [B1,...,Bb, M, N] and [B1,...,Bb, N, R], every operation increases in complexity by B1*...*Bb.
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, square. These have the following meaning:
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to x. Equivalent to A + x.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source


LinearOperator acting like a [batch] of Householder transformations.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorHouseholder
This operator acts like a [batch] of householder reflections with shape [B1,...,Bb, N, N] for some b >= 0. The first b indices index a batch member. For every batch index (i1,...,ib), A[i1,...,ib, : :] is an N x N matrix. This matrix A is not materialized, but for purposes of broadcasting this shape will be relevant.
LinearOperatorHouseholder is initialized with a (batch) vector.
A Householder reflection, defined via a vector v, which reflects points in R^n about the hyperplane orthogonal to v and through the origin.
This operator acts on [batch] matrix with compatible shape. x is a batch matrix with compatible shape for matmul and solve if
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, square. These have the following meaning:
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to x. Equivalent to A + x.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source


LinearOperator acting like a [batch] square identity matrix.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorIdentity
This operator acts like a [batch] identity matrix A with shape [B1,...,Bb, N, N] for some b >= 0. The first b indices index a batch member. For every batch index (i1,...,ib), A[i1,...,ib, : :] is an N x N matrix. This matrix A is not materialized, but for purposes of broadcasting this shape will be relevant.
LinearOperatorIdentity is initialized with num_rows, and optionally batch_shape, and dtype arguments. If batch_shape is None, this operator efficiently passes through all arguments. If batch_shape is provided, broadcasting may occur, which will require making copies.
This operator acts on [batch] matrix with compatible shape. x is a batch matrix with compatible shape for matmul and solve if
If batch_shape initialization arg is None:
If batch_shape initialization arg is provided, and static checks cannot rule out the need to broadcast:
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, square. These have the following meaning:
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to mat. Equiv to I + mat.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source


LinearOperator representing the inverse of another operator.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorInversion
This operator represents the inverse of another operator.
The performance of LinearOperatorInversion depends on the underlying operators performance: solve and matmul are swapped, and determinant is inverted.
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, square. These have the following meaning:
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to x. Equivalent to A + x.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source


Kronecker product between two LinearOperators.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorKronecker
This operator composes one or more linear operators [op1,...,opJ], building a new LinearOperator representing the Kronecker product: op1 x op2 x .. opJ (we omit parentheses as the Kronecker product is associative).
If opj has shape batch_shape_j + [M_j, N_j], then the composed operator will have shape equal to broadcast_batch_shape + [prod M_j, prod N_j], where the product is over all operators.
The performance of LinearOperatorKronecker on any operation is equal to the sum of the individual operators' operations.
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, square. These have the following meaning:
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to x. Equivalent to A + x.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source


LinearOperator acting like a [batch] square lower triangular matrix.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorLowerTriangular
This operator acts like a [batch] lower triangular matrix A with shape [B1,...,Bb, N, N] for some b >= 0. The first b indices index a batch member. For every batch index (i1,...,ib), A[i1,...,ib, : :] is an N x N matrix.
LinearOperatorLowerTriangular is initialized with a Tensor having dimensions [B1,...,Bb, N, N]. The upper triangle of the last two dimensions is ignored.
This operator acts on [batch] matrix with compatible shape. x is a batch matrix with compatible shape for matmul and solve if
Suppose operator is a LinearOperatorLowerTriangular of shape [N, N], and x.shape = [N, R]. Then
If instead operator and x have shape [B1,...,Bb, N, N] and [B1,...,Bb, N, R], every operation increases in complexity by B1*...*Bb.
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, square. These have the following meaning:
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to x. Equivalent to A + x.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source


Perturb a LinearOperator with a rank K update.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorLowRankUpdate
This operator acts like a [batch] matrix A with shape [B1,...,Bb, M, N] for some b >= 0. The first b indices index a batch member. For every batch index (i1,...,ib), A[i1,...,ib, : :] is an M x N matrix.
LinearOperatorLowRankUpdate represents A = L + U D V^H, where
If M = N, determinants and solves are done using the matrix determinant lemma and Woodbury identities, and thus require L and D to be non-singular.
Solves and determinants will be attempted unless the "is_non_singular" property of L and D is False.
In the event that L and D are positive-definite, and U = V, solves and determinants can be done using a Cholesky factorization.
This operator acts on [batch] matrix with compatible shape. x is a batch matrix with compatible shape for matmul and solve if
Suppose operator is a LinearOperatorLowRankUpdate of shape [M, N], made from a rank K update of base_operator which performs .matmul(x) on x having x.shape = [N, R] with O(L_matmul*N*R) complexity (and similarly for solve, determinant. Then, if x.shape = [N, R],
and if M = N,
If instead operator and x have shape [B1,...,Bb, M, N] and [B1,...,Bb, N, R], every operation increases in complexity by B1*...*Bb.
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, diag_update_positive and square. These have the following meaning:
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to x. Equivalent to A + x.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source


LinearOperator acting like a [batch] of permutation matrices.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorPermutation
This operator acts like a [batch] of permutations with shape [B1,...,Bb, N, N] for some b >= 0. The first b indices index a batch member. For every batch index (i1,...,ib), A[i1,...,ib, : :] is an N x N matrix. This matrix A is not materialized, but for purposes of broadcasting this shape will be relevant.
LinearOperatorPermutation is initialized with a (batch) vector.
A permutation, is defined by an integer vector v whose values are unique and are in the range [0, ... n]. Applying the permutation on an input matrix has the folllowing meaning: the value of v at index i says to move the v[i]-th row of the input matrix to the i-th row. Because all values are unique, this will result in a permutation of the rows the input matrix. Note, that the permutation vector v has the same semantics as tf.transpose.
This operator acts on [batch] matrix with compatible shape. x is a batch matrix with compatible shape for matmul and solve if
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, square. These have the following meaning:
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to x. Equivalent to A + x.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source


LinearOperator acting like a scaled [batch] identity matrix A = c I.
Inherits From: LinearOperator, Module
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.linalg.LinearOperatorScaledIdentity
This operator acts like a scaled [batch] identity matrix A with shape [B1,...,Bb, N, N] for some b >= 0. The first b indices index a batch member. For every batch index (i1,...,ib), A[i1,...,ib, : :] is a scaled version of the N x N identity matrix.
LinearOperatorIdentity is initialized with num_rows, and a multiplier (a Tensor) of shape [B1,...,Bb]. N is set to num_rows, and the multiplier determines the scale for each batch member.
This operator acts on [batch] matrix with compatible shape. x is a batch matrix with compatible shape for matmul and solve if
This LinearOperator is initialized with boolean flags of the form is_X, for X = non_singular, self_adjoint, positive_definite, square. These have the following meaning
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb]), equivalent to A.shape[:-2]
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns TensorShape([B1,...,Bb, M, N]), equivalent to A.shape.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Add matrix represented by this operator to mat. Equiv to I + mat.
View source
Returns the adjoint of the current LinearOperator.
Given A representing this LinearOperator, return A*. Note that calling self.adjoint() and self.H are equivalent.
View source
Returns an Op that asserts this operator is non singular.
This operator is considered non-singular if
View source
Returns an Op that asserts this operator is positive definite.
Here, positive definite means that the quadratic form x^H A x has positive real part for all nonzero x. Note that we do not require the operator to be self-adjoint to be positive definite.
View source
Returns an Op that asserts this operator is self-adjoint.
Here we check that this operator is exactly equal to its hermitian transpose.
View source
Shape of batch dimensions of this operator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb].
View source
Returns a Cholesky factor as a LinearOperator.
Given A representing this LinearOperator, if A is positive definite self-adjoint, return L, where A = L L^T, i.e. the cholesky decomposition.
View source
Returns the condition number of this linear operator.
View source
Determinant for every batch member.
View source
Efficiently get the [batch] diagonal part of this operator.
If this operator has shape [B1,...,Bb, M, N], this returns a Tensor diagonal, of shape [B1,...,Bb, min(M, N)], where diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i].
View source
Dimension (in the sense of vector spaces) of the domain of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns N.
View source
Returns the eigenvalues of this linear operator.
If the operator is marked as self-adjoint (via is_self_adjoint) this computation can be more efficient.
View source
Returns the Inverse of this LinearOperator.
Given A representing this LinearOperator, return a LinearOperator representing A^-1.
View source
Log absolute value of determinant for every batch member.
View source
Transform [batch] matrix x with left multiplication: x --> Ax.
View source
Transform [batch] vector x with left multiplication: x --> Ax.
View source
Dimension (in the sense of vector spaces) of the range of this operator.
Determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns M.
View source
Shape of this LinearOperator, determined at runtime.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns a Tensor holding [B1,...,Bb, M, N], equivalent to tf.shape(A).
View source
Solve (exact or approx) R (batch) systems of equations: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Solve single equation with best effort: A X = rhs.
The returned Tensor will be close to an exact solution if A is well conditioned. Otherwise closeness will vary. See class docstring for details.
View source
Rank (in the sense of tensors) of matrix corresponding to this operator.
If this operator acts like the batch matrix A with A.shape = [B1,...,Bb, M, N], then this returns b + 2.
View source
Return a dense (batch) matrix representing this operator.
View source
Trace of the linear operator, equal to sum of self.diag_part().
If the operator is square, this is also the sum of the eigenvalues.
View source