# UpperTriangularMatrix

UpperTriangularMatrix[umat]

converts the upper triangular matrix umat to a structured array.

# Details and Options

• Upper triangular matrices, when represented as structured arrays, allow for efficient storage and more efficient operations, including Det, Inverse and LinearSolve.
• Upper triangular matrices occur when solving linear systems of equations, where they represent simple systems that can be solved by back substitution. Matrix decompositions that use upper and lower triangular matrices include LU, UU (Cholesky) and QR decompositions.
• An upper triangular matrix satisfies for .
• The elements uij need not be numerical.
• The inverse of an upper triangular matrix is also upper triangular.
• Upper triangular matrices are closed under matrix multiplication, so is again an upper triangular matrix.
• The determinant of an upper triangular matrix is given by the product of the diagonal elements .
• Operations that are accelerated for UpperTriangularMatrix include:
•  Det time Dot time LinearSolve time
• For an UpperTriangularMatrix sa, the following properties "prop" can be accessed as sa["prop"]:
•  "Matrix" upper 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[UpperTriangularMatrix[]] gives the upper triangular matrix as an ordinary matrix.
• UpperTriangularMatrix[,TargetStructure->struct] returns the upper 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
• is equivalent to UpperTriangularMatrix[,TargetStructure"Structured"].

# Examples

open allclose all

## Basic Examples(2)

Construct an upper triangular matrix:

Show the elements:

Normal can convert an UpperTriangularMatrix to its ordinary representation:

Construct an upper triangular matrix with symbolic entries:

Show the elements:

Get the determinant:

## Scope(5)

UpperTriangularMatrix objects include properties that give information about the matrix:

The "Summary" property gives a brief summary of information about the matrix:

The "StructuredAlgorithms" property lists the functions that have structured algorithms:

Structured algorithms are typically faster:

Compute the determinant:

Compute the inverse:

Solve a linear system:

Compute the eigenvalues:

When appropriate, structured algorithms return another UpperTriangularMatrix object:

Inverting ut gives another upper triangular matrix:

Transposing ut gives a lower triangular matrix:

The product of ut with its transpose is no longer a triangular matrix:

Construct an upper triangular matrix from a SparseArray with integer entries:

Show the elements:

Construct an upper triangular complex-valued matrix:

Compute the determinant:

Compute the inverse:

Solve a linear system:

Compute the eigenvalues:

## Options(1)

### TargetStructure(1)

Return the upper triangular matrix as a dense matrix:

Return the upper triangular matrix as a structured array:

Return the upper triangular matrix as a sparse array:

## Applications(3)

A function for explicitly computing the Cholesky factor of a Hilbert matrix:

Show that the matrix produced is the same as the result of applying CholeskyDecomposition to the Hilbert matrix:

Verify that multiplying the matrix with its transpose gives the Hilbert matrix:

Elements of the Heisenberg group can be represented by 3×3 upper triangular matrices with unit diagonal:

The product of two Heisenberg matrices is also Heisenberg:

The inverse of a Heisenberg matrix is also Heisenberg:

A function for computing the LU decomposition of a matrix:

Compute the decomposition:

Verify the decomposition:

## Properties & Relations(2)

Transposing an UpperTriangularMatrix yields a LowerTriangularMatrix:

The entries of an UpperTriangularMatrix are coerced to the lowest precision:

## Possible Issues(1)

A full matrix:

does not evaluate if a is not manifestly upper triangular:

Use to get the upper triangular part of a:

## Neat Examples(2)

An upper triangular matrix with the anti-Hadamard property:

The inverse matrix has integer entries that are unexpectedly large:

The Frobenius norm of the inverse is greater than the Frobenius norm of the original matrix:

Construct a Wilkinson triangular matrix:

It has unit determinant:

The matrix, however, is very ill conditioned:

Wolfram Research (2022), UpperTriangularMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/UpperTriangularMatrix.html (updated 2023).

#### Text

Wolfram Research (2022), UpperTriangularMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/UpperTriangularMatrix.html (updated 2023).

#### CMS

Wolfram Language. 2022. "UpperTriangularMatrix." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/UpperTriangularMatrix.html.

#### APA

Wolfram Language. (2022). UpperTriangularMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/UpperTriangularMatrix.html

#### BibTeX

@misc{reference.wolfram_2024_uppertriangularmatrix, author="Wolfram Research", title="{UpperTriangularMatrix}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/UpperTriangularMatrix.html}", note=[Accessed: 13-August-2024 ]}

#### BibLaTeX

@online{reference.wolfram_2024_uppertriangularmatrix, organization={Wolfram Research}, title={UpperTriangularMatrix}, year={2023}, url={https://reference.wolfram.com/language/ref/UpperTriangularMatrix.html}, note=[Accessed: 13-August-2024 ]}