Conjugate transpose: Difference between revisions

Content added Content deleted
m (→‎{{header|Tcl}}: some notes)
(Add {{incorrect}} Factor code.)
Line 15: Line 15:


* MathWorld: [http://mathworld.wolfram.com/ConjugateTranspose.html conjugate transpose], [http://mathworld.wolfram.com/HermitianMatrix.html Hermitian matrix], [http://mathworld.wolfram.com/NormalMatrix.html normal matrix], [http://mathworld.wolfram.com/UnitaryMatrix.html unitary matrix]
* MathWorld: [http://mathworld.wolfram.com/ConjugateTranspose.html conjugate transpose], [http://mathworld.wolfram.com/HermitianMatrix.html Hermitian matrix], [http://mathworld.wolfram.com/NormalMatrix.html normal matrix], [http://mathworld.wolfram.com/UnitaryMatrix.html unitary matrix]

=={{header|Factor}}==
{{incorrect|Factor|By using <code>m.</code> for [[matrix multiplication]], this code encounters a bug in Factor: see [[{{TALKPAGENAME}}#Bug in Factor]].}}
<lang factor>USING: kernel math.functions math.matrices sequences ;
IN: rosetta.hermitian

: conj-t ( matrix -- conjugate-transpose )
flip [ [ conjugate ] map ] map ;

: hermitian-matrix? ( matrix -- ? )
dup conj-t = ;

: normal-matrix? ( matrix -- ? )
dup conj-t [ m. ] [ swap m. ] 2bi = ;

: unitary-matrix? ( matrix -- ? )
[ dup conj-t m. ] [ length identity-matrix ] bi = ;</lang>


=={{header|Go}}==
=={{header|Go}}==