Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

NewLinearAlgebraPaclet

Guides

  • Matrices

Symbols

  • AntidiagonallySymmetrizableMatrixQ
  • AntidiagonalMatrix
  • AntidiagonalMatrixQ
  • Antidiagonal
  • AntidiagonalTranspose
  • DesymmetrizedMatrix
  • DeTriangularizableMatrixQ
  • DeTriangularizeMatrix
  • HessianMatrix
  • JacobianMatrix
  • LeftArrowMatrix
  • LowerArrowMatrix
  • LowerRightTriangularize
  • LowerRightTriangularMatrixQ
  • MatrixSymmetrizability
  • PyramidMatrix
  • ReflectedDiagonalMatrix
  • RightArrowMatrix
  • TopArrowMatrix
  • UlamMatrix
  • UpperLeftTriangularize
  • UpperLeftTriangularMatrixQ
PeterBurbery`NewLinearAlgebraPaclet`
DeTriangularizeMatrix
​
DeTriangularizeMatrix
[matrix]
detriangularizes the upper triangular or lower triangular matrix
matrix
into a symmetric matrix.
​
Details and Options

Examples  
(1)
Basic Examples  
(1)
Detriangularize a lower-triangularized pyramid matrix:
To get a lower-triangularized or upper-triangularized matrix, use the functions
LowerTriangularize
and
UpperTriangularize
, respectively.
In[1]:=
MatrixFormpyramidMatrix=
PyramidMatrix
[7]
Out[1]//MatrixForm=
1
1
1
1
1
1
1
1
2
2
2
2
2
1
1
2
3
3
3
2
1
1
2
3
4
3
2
1
1
2
3
3
3
2
1
1
2
2
2
2
2
1
1
1
1
1
1
1
1
The matrix that you triangularize should be symmetric:
In[2]:=
SymmetricMatrixQ[pyramidMatrix]
Out[2]=
True
In[3]:=
MatrixForm[lowerTriangularMatrix=LowerTriangularize[pyramidMatrix]]
Out[3]//MatrixForm=
1
0
0
0
0
0
0
1
2
0
0
0
0
0
1
2
3
0
0
0
0
1
2
3
4
0
0
0
1
2
3
3
3
0
0
1
2
2
2
2
2
0
1
1
1
1
1
1
1
In[4]:=
MatrixForm
DeTriangularizeMatrix
[LowerTriangularize[pyramidMatrix]]
Out[4]//MatrixForm=
1
1
1
1
1
1
1
1
2
2
2
2
2
1
1
2
3
3
3
2
1
1
2
3
4
3
2
1
1
2
3
3
3
2
1
1
2
2
2
2
2
1
1
1
1
1
1
1
1
We have recovered the original matrix:
In[5]:=
pyramidMatrix===
DeTriangularizeMatrix
[LowerTriangularize[pyramidMatrix]]
Out[5]=
True
This would not have worked if the matrix was not symmetric:
In[6]:=
MatrixForm[nonSymmetricMatrix=Partition[Range[49],7]]
Out[6]//MatrixForm=
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
In[7]:=
SymmetricMatrixQ[nonSymmetricMatrix]
Out[7]=
False
In[8]:=
MatrixForm[lowerTriangularizedNonSymmetricMatrix=LowerTriangularize[nonSymmetricMatrix]]
Out[8]//MatrixForm=
1
0
0
0
0
0
0
8
9
0
0
0
0
0
15
16
17
0
0
0
0
22
23
24
25
0
0
0
29
30
31
32
33
0
0
36
37
38
39
40
41
0
43
44
45
46
47
48
49
In[9]:=
MatrixForm
DeTriangularizeMatrix
[lowerTriangularizedNonSymmetricMatrix]
Out[9]//MatrixForm=
1
8
15
22
29
36
43
8
9
16
23
30
37
44
15
16
17
24
31
38
45
22
23
24
25
32
39
46
29
30
31
32
33
40
47
36
37
38
39
40
41
48
43
44
45
46
47
48
49
In[10]:=
DeTriangularizeMatrix
[lowerTriangularizedNonSymmetricMatrix]===matrix
Out[10]=
False
Here is an example of doing it with an upper triangular matrix:
In[11]:=
MatrixForm[upperTriangularMatrix=UpperTriangularize[pyramidMatrix]]
Out[11]//MatrixForm=
1
1
1
1
1
1
1
0
2
2
2
2
2
1
0
0
3
3
3
2
1
0
0
0
4
3
2
1
0
0
0
0
3
2
1
0
0
0
0
0
2
1
0
0
0
0
0
0
1
In[12]:=
MatrixForm
DeTriangularizeMatrix
[upperTriangularMatrix]
Out[12]//MatrixForm=
1
1
1
1
1
1
1
1
2
2
2
2
2
1
1
2
3
3
3
2
1
1
2
3
4
3
2
1
1
2
3
3
3
2
1
1
2
2
2
2
2
1
1
1
1
1
1
1
1
In[13]:=
DeTriangularizeMatrix
[upperTriangularMatrix]===pyramidMatrix
Out[13]=
True
Here is another example of it not working, but with an upper triangular matrix this time.
In[14]:=
MatrixForm[upperTriangularizedNonSymmetricMatrix=UpperTriangularize[nonSymmetricMatrix]]
Out[14]//MatrixForm=
1
2
3
4
5
6
7
0
9
10
11
12
13
14
0
0
17
18
19
20
21
0
0
0
25
26
27
28
0
0
0
0
33
34
35
0
0
0
0
0
41
42
0
0
0
0
0
0
49
In[15]:=
MatrixForm
DeTriangularizeMatrix
[upperTriangularizedNonSymmetricMatrix]
Out[15]//MatrixForm=
1
2
3
4
5
6
7
2
9
10
11
12
13
14
3
10
17
18
19
20
21
4
11
18
25
26
27
28
5
12
19
26
33
34
35
6
13
20
27
34
41
42
7
14
21
28
35
42
49
In[16]:=
DeTriangularizeMatrix
[upperTriangularizedNonSymmetricMatrix]===matrix
Out[16]=
False
The subdiagonals are below the main diagonal and the super diagonals are above the main diagonal.
The function will work if a symmetric matrix was upper triangularized on a superdiagonal or lower-triangularized on a subdiagonal. The function will not work if a symmetric matrix was upper triangularized on a subdiagonal or lower triangularized on a super diagonal.
In[17]:=
MatrixForm[upperTriangularizedOnASuperDiagonal=UpperTriangularize[pyramidMatrix,2]]
Out[17]//MatrixForm=
0
0
1
1
1
1
1
0
0
0
2
2
2
1
0
0
0
0
3
2
1
0
0
0
0
0
2
1
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
In[18]:=
MatrixForm
DeTriangularizeMatrix
[upperTriangularizedOnASuperDiagonal]
Out[18]//MatrixForm=
0
0
1
1
1
1
1
0
0
0
2
2
2
1
1
0
0
0
3
2
1
1
2
0
0
0
2
1
1
2
3
0
0
0
1
1
2
2
2
0
0
0
1
1
1
1
1
0
0
In this case, we don't compare this to the original matrix because its different than the original matrix.
Let's look at a matrix that is upper-triangularized on a subdiagonal
Let's do the same thing but with a lower-triangularized matrix.

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com