Re: Creating a symmetric matrix

• To: mathgroup at smc.vnet.net
• Subject: [mg46878] Re: Creating a symmetric matrix
• From: Roland Franzius <roland.franzius at uos.de>
• Date: Fri, 12 Mar 2004 23:39:24 -0500 (EST)
• Organization: Universitaet Hannover
• References: <200403110850.DAA13986@smc.vnet.net> <c2rnhu\$p0s\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Andrzej Kozlowski wrote:
> On 11 Mar 2004, at 09:50, Mark Coleman wrote:
>
>
>>Greetings,
>>
>>How can I efficiently build a symmetric matrix from an upper triangular
>>one, i.e., extract the upper triangular elements and insert them into
>>the lower triangle in such a way as to make the resulting square matrix
>>symmetric?
>>
>>Thanks,
>>
>>Mark
>>
>>
>>
>
>
> The most natural way must be
>
> A+Tranpose[A]
>
> e.g.
>
> A = Array[KroneckerDelta[#1 < #2, True] & , {3, 3}];
>
>
> {{0, 1, 1}, {0, 0, 1}, {0, 0, 0}}
>
>
> A + Transpose[A]
>
>
> {{0, 1, 1}, {1, 0, 1}, {1, 1, 0}}

Very good compared to the other sugestions!

If the diagonal of A contains elements !=0 the formula is of course for
every  Matrix A

Symmetric part:
A_s =1/2 (A+Transpose[A])

antisymmetric trace free part
A_a = 1/2 (a-Transpose[A])

--

Roland Franzius

```

• Prev by Date: Re: Undiscovered Bug?
• Next by Date: Re: Undiscovered Bug?
• Previous by thread: Re: Creating a symmetric matrix
• Next by thread: Re: Creating a symmetric matrix