Have I gotten all the definitions correct? The only one that consistently works on a random matrix provided by Kip was provided by Raul
ishermitian =: -: +@|: ]K=:hermy=. (([: <: [: +: 0 ?@$~ ,~) j. [: <: [: +: 0 ?@$~ ,~) 3 0.681691j_0.530679 0.105724j0.221189 0.140368j_0.982508 _0.469356j_0.623093 0.71661j0.893344 _0.125895j0.532656 _0.882974j_0.727597 0.0632899j_0.0448332 _0.975941j_0.730788 hft =: + +@|:@(- ] * =@i.@#) NB. Kip ishermitian hft K 0 hft=: (+ +@|: * >/~@i.@#) NB. Ai ishermitian hft K 0 hft=: (% 1 + =@i.@#)@:+ +@|: NB. Raul ishermitian hft K 1 hft=:((23 b.&.(a.&i.)&.(2&(3!:5))&.+. +@|:)) NB. Henry ishermitian hft K 0 hft=: 0&=`(,: +@|:)} ishermitian hft K 0 Linda -----Original Message----- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Henry Rich Sent: Tuesday, January 15, 2013 6:21 PM To: programm...@jsoftware.com Subject: Re: [Jprogramming] Hermitian from triangular Nah, that's not beyond impish. The devilish solution is to take the bitwise OR of the matrix with its conjugate transpose (but that's easier in assembler language than in J: (23 b.&.(a.&i.)&.(2&(3!:5))&.+. +@|:)) ). And you need to be sure that the zeros on the lower diagonal and below are true zeros! Henry Rich On 1/15/2013 6:03 PM, km wrote: > Oh, boy! (v1`v2) } y <--> (v1 y) } (v2 y) > > Brief and devilish, take care for your soul, Henry! > > --Kip > > Sent from my iPad > > > On Jan 15, 2013, at 3:39 PM, Henry Rich <henryhr...@nc.rr.com> wrote: > >> hft =: 0&=`(,: +@|:)} >> >> Henry Rich >> >> On 1/15/2013 5:25 AM, km wrote: >>> This is an easy one. A Hermitian matrix matches its conjugate transpose. Write a verb hft that creates a Hermitian matrix from a triangular one that has a real diagonal. >>> >>> ishermitian =: -: +@|: >>> ]A =: 2 2 $ 1 2j3 0 4 >>> 1 2j3 >>> 0 4 >>> ]B =: hft A >>> 1 2j3 >>> 2j_3 4 >>> ishermitian A >>> 0 >>> ishermitian B >>> 1 >>> >>> Kip Murray >>> >>> Sent from my iPad >>> -------------------------------------------------------------------- >>> -- For information about J forums see >>> http://www.jsoftware.com/forums.htm >> --------------------------------------------------------------------- >> - For information about J forums see >> http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm