Conjugate transpose: Difference between revisions
Content deleted Content added
m →{{header|Factor}}: Link to Factor bug #484. |
→{{header|Factor}}: Factor bug #484 has a fix in git now, in development builds soon. |
||
Line 100: | Line 100: | ||
=={{header|Factor}}== |
=={{header|Factor}}== |
||
Before the fix to [https://github.com/slavapestov/factor/issues/484 Factor bug #484], <code>m.</code> gave the wrong answer and this code failed. Factor 0.94 is too old to work. |
|||
{{works with|Factor|development (future 0.95)}} |
|||
<lang factor>USING: kernel math.functions math.matrices sequences ; |
<lang factor>USING: kernel math.functions math.matrices sequences ; |
||
IN: rosetta.hermitian |
IN: rosetta.hermitian |
||
Line 115: | Line 117: | ||
: unitary-matrix? ( matrix -- ? ) |
: unitary-matrix? ( matrix -- ? ) |
||
[ dup conj-t m. ] [ length identity-matrix ] bi = ;</lang> |
[ dup conj-t m. ] [ length identity-matrix ] bi = ;</lang> |
||
Usage: |
|||
'''USE: rosetta.hermitian''' |
|||
IN: scratchpad '''{ { C{ 1 2 } 0 }''' |
|||
''' { 0 C{ 3 4 } } }''' |
|||
'''[ hermitian-matrix? . ]''' |
|||
'''[ normal-matrix? . ]''' |
|||
'''[ unitary-matrix? . ] tri''' |
|||
f |
|||
t |
|||
f |
|||
=={{header|Go}}== |
=={{header|Go}}== |