Conjugate transpose: Difference between revisions

m
m (Added PowerShell)
Line 1,360:
}
 
function complex-multarrays-complex($a, $b) {
$c = @()
if($a -and $b) {
Line 1,377:
}
 
function identity-complex($n) {
if(0 -lt $n) {
$array = @(0) * $n
foreach ($i in 0..($n-1)) {
$array[$i] = @([System.Numerics.complex]::new(0,0)) * $n
$array[$i][$i] = [System.Numerics.complex]::new(1,0)
}
$array
Line 1,397:
function complex($a,$b) {[System.Numerics.complex]::new($a,$b)}
$id2 = identity-complex 2
$m = @(@((complex 2 7), (complex 9 -5)),@((complex 3 4), (complex 8 -6)))
$hm = conjugate-transpose $m
$mhm = complex-multarrays-complex $m $hm
$hmm = complex-multarrays-complex $hm $m
"`$m ="
show $m
678

edits