LowerTriangularMatrix[lmat]
converts the lower triangular matrix lmat to a structured array.
LowerTriangularMatrix
LowerTriangularMatrix[lmat]
converts the lower triangular matrix lmat to a structured array.
Details and Options
- Lower triangular matrices, when represented as structured arrays, allow for efficient storage and more efficient operations, including Det, Inverse and LinearSolve.
- Lower triangular matrices occur when solving linear systems of equations, where they represent simple systems that can be solved by forward substitution. Matrix decompositions that use lower and upper triangular matrices include LU, LDL, LL (Cholesky) and LQ decompositions.
- A lower triangular matrix
satisfies
for
. - The elements lij need not be numerical.
- The inverse of a lower triangular matrix is another lower triangular matrix.
- Lower triangular matrices are closed under matrix multiplication, so
is again a lower triangular matrix. - The determinant of a lower triangular matrix is given by the product of the diagonal elements
. - Operations that are accelerated for LowerTriangularMatrix include:
-
Det time 
Dot time 
LinearSolve time 
- For a LowerTriangularMatrix sa, the following properties "prop" can be accessed as sa["prop"]:
-
"Matrix" lower triangular matrix, represented as a full array "Properties" list of supported properties "Structure" type of structured array "StructuredData" internal data stored by the structured array "StructuredAlgorithms" list of functions with special methods for the structured array "Summary" summary information, represented as a Dataset - Normal[LowerTriangularMatrix[…]] gives the lower triangular matrix as an ordinary matrix.
- LowerTriangularMatrix[…,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 structured array - LowerTriangularMatrix[…,TargetStructureAutomatic] is equivalent to LowerTriangularMatrix[…,TargetStructure"Structured"].
Examples
open all close allBasic Examples (2)
Construct a lower triangular matrix:
lt = LowerTriangularMatrix[{{2, 0, 0}, {1, -5, 0}, {-3, 2, 4}}]MatrixForm[lt]Normal can convert a LowerTriangularMatrix to its ordinary representation:
Normal[lt]Construct a lower triangular matrix with symbolic entries:
lt = LowerTriangularMatrix[(| | | |
| --- | --- | --- |
| ℓ11 | 0 | 0 |
| ℓ21 | ℓ22 | 0 |
| ℓ31 | ℓ32 | ℓ33 |)]MatrixForm[lt]Det[lt]Scope (5)
LowerTriangularMatrix objects include properties that give information about the matrix:
lt = LowerTriangularMatrix[(| | | | | |
| -- | -- | -- | -- | -- |
| 11 | 0 | 0 | 0 | 0 |
| 21 | 22 | 0 | 0 | 0 |
| 31 | 32 | 33 | 0 | 0 |
| 41 | 42 | 43 | 44 | 0 |
| 51 | 52 | 53 | 54 | 55 |)]lt["Properties"]The "Summary" property gives a brief summary of information about the matrix:
lt["Summary"]The "StructuredAlgorithms" property lists the functions that have structured algorithms:
lt["StructuredAlgorithms"]Structured algorithms are typically faster:
ln = Normal[SparseArray[{{i_, i_} :> (i + 1.) / i, {i_, j_} /; i > j :> RandomReal[] / (i - j)}, {1234, 1234}]];
lt = LowerTriangularMatrix[ln];AbsoluteTiming[Det[ln]]AbsoluteTiming[Det[lt]]AbsoluteTiming[Inverse[ln];]AbsoluteTiming[Inverse[lt];]x = RandomReal[{-9, 9}, 1234];
b = ln.x;AbsoluteTiming[Norm[x - LinearSolve[ln, b]]]AbsoluteTiming[Norm[x - LinearSolve[lt, b]]]AbsoluteTiming[Eigenvalues[ln];]AbsoluteTiming[Eigenvalues[lt];]When appropriate, structured algorithms return another LowerTriangularMatrix object:
lt = LowerTriangularMatrix[N[Array[Binomial, {4, 4}, {0, 0}], 25]]Inverting lt gives another lower triangular matrix:
Inverse[lt]Transposing lt gives an upper triangular matrix:
Transpose[lt]The product of lt with its transpose is no longer a triangular matrix:
lt.Transpose[lt]Construct a lower triangular matrix from a SparseArray with integer entries:
lt = LowerTriangularMatrix[SparseArray[{Band[{2, 1}] -> 1, Band[{1, 1}] -> -2}, {5, 5}]]MatrixForm[lt]Construct a lower triangular complex-valued matrix:
MatrixForm[tr = LowerTriangularMatrix[LowerTriangularize[RandomVariate[NormalDistribution[], {4, 4}] + I RandomVariate[NormalDistribution[], {4, 4}]]]]Det[tr]Inverse[tr]//MatrixFormLinearSolve[tr, {2, 1, 9, 4}]Eigenvalues[tr]Options (1)
TargetStructure (1)
Return the lower triangular matrix as a dense matrix:
LowerTriangularMatrix[(| | | |
| - | - | - |
| 1 | 0 | 0 |
| 2 | 3 | 0 |
| 4 | 5 | 6 |), TargetStructure -> "Dense"]Return the lower triangular matrix as a structured array:
LowerTriangularMatrix[(| | | |
| - | - | - |
| 1 | 0 | 0 |
| 2 | 3 | 0 |
| 4 | 5 | 6 |), TargetStructure -> "Structured"]Return the lower triangular matrix as a sparse array:
LowerTriangularMatrix[(| | | |
| - | - | - |
| 1 | 0 | 0 |
| 2 | 3 | 0 |
| 4 | 5 | 6 |), TargetStructure -> "Sparse"]Applications (2)
LUDecomposition by default uses LowerTriangularMatrix for the lower triangular matrix it returns:
a = {{4, 9, 2}, {2, 3, 2}, {7, 2, 4}};
{l, u, p, c} = LUDecomposition[a]l.u == p.aMatrixForm /@ {l, u, p}n = 3;
Map[MatrixForm, {m1, m2} = {Array[, {n, n}], Array[, {n, n}]}]Form a unit lower triangular matrix of size 3n×3n that has the two matrices as blocks:
id = IdentityMatrix[n];
lt = LowerTriangularMatrix[ArrayFlatten[{{id, 0, 0}, {m2, id, 0}, {0, m1, id}}]]The n×n lower-left submatrix of the inverse is equivalent to the product of the two original matrices:
Take[Inverse[lt], -n, n] == m1.m2Properties & Relations (2)
Transposing a LowerTriangularMatrix yields an UpperTriangularMatrix:
lt = LowerTriangularMatrix[LowerTriangularize@Array[10#1 + #2&, {7, 7}]]ut = Transpose[lt]MatrixForm[ut]The entries of a LowerTriangularMatrix are coerced to the lowest precision:
lt = LowerTriangularMatrix[(| | | | | |
| --- | ----- | ----- | -- | -- |
| 11. | 0 | 0 | 0 | 0 |
| 21 | 22 | 0 | 0 | 0 |
| 31 | 32`16 | 33`20 | 0 | 0 |
| 41 | 42 | 43 | 44 | 0 |
| 51 | 52 | 53 | 54 | 55 |)]lt["Matrix"]Possible Issues (1)
MatrixForm[a = Array[10#1 + #2&, {7, 7}]]LowerTriangularMatrix[a] does not evaluate if a is not manifestly lower triangular:
LowerTriangularMatrix[a]
Use LowerTriangularMatrix[LowerTriangularize[a]] to get the lower triangular part of a:
LowerTriangularMatrix[LowerTriangularize[a]]MatrixForm[%]Neat Examples (2)
A Stirling matrix of the first kind:
n = 8;
MatrixForm[s1 = LowerTriangularMatrix[Table[StirlingS1[j, k], {j, 0, n}, {k, 0, n}]]]A Stirling matrix of the second kind:
MatrixForm[s2 = LowerTriangularMatrix[Table[StirlingS2[j, k], {j, 0, n}, {k, 0, n}]]]The two kinds of Stirling matrices are inverses of each other:
s1.s2 == IdentityMatrix[n + 1]A variant of the Pascal matrix with alternating column signs:
n = 7;MatrixForm[pascal = LowerTriangularMatrix[Table[(-1) ^ k Binomial[j, k], {j, 0, n}, {k, 0, n}]]]Verify that the matrix is involutory (gives the identity matrix when squared):
MatrixPower[pascal, 2] == IdentityMatrix[n + 1]Related Guides
Text
Wolfram Research (2022), LowerTriangularMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/LowerTriangularMatrix.html (updated 2023).
CMS
Wolfram Language. 2022. "LowerTriangularMatrix." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/LowerTriangularMatrix.html.
APA
Wolfram Language. (2022). LowerTriangularMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LowerTriangularMatrix.html
BibTeX
@misc{reference.wolfram_2026_lowertriangularmatrix, author="Wolfram Research", title="{LowerTriangularMatrix}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/LowerTriangularMatrix.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_lowertriangularmatrix, organization={Wolfram Research}, title={LowerTriangularMatrix}, year={2023}, url={https://reference.wolfram.com/language/ref/LowerTriangularMatrix.html}, note=[Accessed: 12-June-2026]}