gives a matrix in which all but the lower triangular elements of m are replaced with zeros.
LowerTriangularize[m,k]
replaces with zeros only the elements above the k
subdiagonal of m.
LowerTriangularize
gives a matrix in which all but the lower triangular elements of m are replaced with zeros.
LowerTriangularize[m,k]
replaces with zeros only the elements above the k
subdiagonal of m.
Details and Options
- LowerTriangularize[m] works even if m is not a square matrix.
- In LowerTriangularize[m,k], positive k refers to subdiagonals above the main diagonal and negative k refers to subdiagonals below the main diagonal.
- LowerTriangularize works with SparseArray objects.
- LowerTriangularize[…,TargetStructure->struct] returns the lower triangular matrix in the format specified by struct. Possible settings include:
-
Automatic automatically choose the representation returned "Dense" represent the matrix as a dense matrix "Sparse" represent the matrix as a sparse array "Structured" represent the matrix as a LowerTriangularMatrix - With LowerTriangularize[…,TargetStructureAutomatic], the structure of the resulting lower triangular matrix is the same as that of the original matrix, if the original matrix is a dense matrix, a sparse array, a structured DiagonalMatrix or a structured LowerTriangularMatrix. Otherwise, a dense matrix is returned.
Examples
open all close allBasic Examples (3)
Get the lower triangular part of a matrix:
MatrixForm[LowerTriangularize[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}]]Get the strictly lower triangular part of a matrix:
MatrixForm[LowerTriangularize[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, -1]]Get the lower triangular part of a matrix plus the diagonal above the main diagonal:
MatrixForm[LowerTriangularize[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, 1]]Scope (12)
Basic Uses (8)
Get the lower triangular part of nonsquare matrices:
MatrixForm[LowerTriangularize[{{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}}]]MatrixForm[LowerTriangularize[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}}]]Find the lower triangular part of a machine-precision matrix:
LowerTriangularize[{{1.25, 3.2, 3.2}, {7.9, -1.4, 5.1}, {1., -1.5, 3.2}}]//MatrixFormLower triangular part of a complex matrix:
LowerTriangularize[{{1. + I, 2, 3 - 2 I}, {0, 4, 5I}, {1 + I, 6, 3 + 3I}}]//MatrixFormLower triangular part of an exact matrix:
LowerTriangularize[{{2, 3}, {3, 1}, {2, 4}, {2, 3}}]//MatrixFormLower triangular part of an arbitrary-precision matrix:
LowerTriangularize[RandomReal[4, {2, 2}, WorkingPrecision -> 20]]//MatrixFormCompute the lower triangular part of a symbolic matrix:
LowerTriangularize[{{a, b, c, d}, {e, f, g, h}}]//MatrixFormLarge matrices are handled efficiently:
mat = RandomReal[{0, 10}, {800, 800}];LowerTriangularize[mat]; //TimingThe number of rows or columns limits the meaningful values of the parameter k:
Table[MatrixForm[LowerTriangularize[{{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}, k]], {k, -4, 3}]Special Matrices (4)
The lower triangular part of a sparse matrix is returned as a sparse matrix:
SparseArray[{{1, 3} -> 1, {2, 2} -> 2, {3, 1} -> 3}, {3, 4}]LowerTriangularize[%]%//MatrixFormThe lower triangular part of structured matrices:
SymmetrizedArray[{{1, 1} -> 3, {2, 2} -> 1, {3, 1} -> -5}, {3, 3}, Symmetric[All]]LowerTriangularize[%]QuantityArray[{{1, 2}, {3, 4}, {5, 6}}, {"Meters", "Seconds"}]LowerTriangularize[%, -1]The lower triangular part of an identity matrix is the matrix itself:
LowerTriangularize[IdentityMatrix[3]]This is true of any diagonal matrix:
LowerTriangularize[DiagonalMatrix[{1, 2, 3}]]//MatrixFormCompute the lower triangular part, including the superdiagonal, for HilbertMatrix:
LowerTriangularize[HilbertMatrix[{3, 4}], 1]//MatrixFormOptions (2)
TargetStructure (2)
m = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};Return the result as a dense matrix:
LowerTriangularize[m, TargetStructure -> "Dense"]Return the result as a sparse matrix:
LowerTriangularize[m, TargetStructure -> "Sparse"]Return the result as a LowerTriangularMatrix:
LowerTriangularize[m, TargetStructure -> "Structured"]sa = SparseArray[{{1, 3} -> 1, {2, 2} -> 2, {3, 1} -> 3}, {3, 3}]The setting TargetStructureAutomatic gives a sparse result:
LowerTriangularize[sa, TargetStructure -> Automatic]Convert the sparse array to a dense matrix:
dsa = Normal[sa, SparseArray]The setting TargetStructureAutomatic gives a dense result:
LowerTriangularize[dsa, TargetStructure -> Automatic]Applications (1)
JordanDecomposition relates any matrix to an upper triangular matrix via a similarity transformation
:
m = {{1, 0, 0, 0}, {0, 1, 0, 0}, {1, -1, 1, 0}, {1, -1, 1, 1}};
{s, j} = JordanDecomposition[m];MatrixForm /@ {m, j, s}Verify that the Jordan matrix is upper triangular and similar to the original matrix:
{UpperTriangularMatrixQ[j], m == s.j.Inverse[s]}The matrix
is diagonalizable iff its Jordan matrix
is also lower triangular:
{LowerTriangularize[j] == j, DiagonalizableMatrixQ[m]}Properties & Relations (6)
Matrices returned by LowerTriangularize satisfy LowerTriangularMatrixQ:
LowerTriangularMatrixQ[LowerTriangularize[{{a, b}, {c, d}}]]LowerTriangularMatrixQ[LowerTriangularize[{{a, b}, {c, d}}, 1], 1]The inverse of a lower triangular matrix is lower triangular:
mat = LowerTriangularize[RandomInteger[{1, 10}, {5, 5}]];LowerTriangularMatrixQ[Inverse[mat]]This extends to arbitrary powers and functions:
LowerTriangularMatrixQ[MatrixPower[mat, n]]LowerTriangularMatrixQ[MatrixFunction[f, mat]]The product of two (or more) lower triangular matrices is lower triangular:
m1 = LowerTriangularize[RandomReal[1., {5, 5}]];
m2 = LowerTriangularize[RandomReal[1., {5, 5}]];LowerTriangularMatrixQ[m1.m2]The determinant of a triangular matrix equals the product of the diagonal entries:
m = LowerTriangularize[RandomReal[1., {5, 5}]];Det[m] == Apply[Times, Diagonal[m]]Eigenvalues of a triangular matrix equal its diagonal elements:
m = LowerTriangularize[RandomReal[1., {5, 5}]];Eigenvalues[m] == Reverse@Sort@Diagonal[m]LowerTriangularize[m,k] is equivalent to Transpose[UpperTriangularize[Transpose[m], -k]]:
m = RandomReal[1, {3, 5}];
k = RandomInteger[{-2, 4}];
{MatrixForm[l = LowerTriangularize[m, k]], l === Transpose[UpperTriangularize[Transpose[m], -k]]}Related Guides
Text
Wolfram Research (2008), LowerTriangularize, Wolfram Language function, https://reference.wolfram.com/language/ref/LowerTriangularize.html (updated 2023).
CMS
Wolfram Language. 2008. "LowerTriangularize." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/LowerTriangularize.html.
APA
Wolfram Language. (2008). LowerTriangularize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LowerTriangularize.html
BibTeX
@misc{reference.wolfram_2026_lowertriangularize, author="Wolfram Research", title="{LowerTriangularize}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/LowerTriangularize.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_lowertriangularize, organization={Wolfram Research}, title={LowerTriangularize}, year={2023}, url={https://reference.wolfram.com/language/ref/LowerTriangularize.html}, note=[Accessed: 13-June-2026]}