Example #1
0
 def test2by2(self):
     a = 2e0
     S11 = 1e0
     S12 = (1 + a) * exp(-a)
     S = array([[S11, S12], [S12, S11]])
     V, Vdag, Vinv = part_a(S)
     print reduce(dot, (Vdag, S, V))
     print Vinv
     print inv(V)
     print Vdag
     print(dot(Vinv, V))
     print(dot(V, Vinv))
Example #2
0
 def test2by2(self):
     a = 2e0
     S11 = 1e0
     S12 = (1 + a) * exp(-a)
     S = array([[S11, S12], [S12, S11]])
     V, Vdag, Vinv = part_a(S)
     print reduce(dot, (Vdag, S, V))
     print Vinv
     print inv(V)
     print Vdag
     print(dot(Vinv, V))
     print(dot(V, Vinv))
Example #3
0
 def test5by5(self):
     print('Test 5 by 5')
     S = array([[1.06666667, 0., 0.15238095, 0., .05079365],
                [0., 0.15238095, 0., 0.05079365, 0.],
                [0.15238095, 0., 0.05079365, 0., 0.02308802],
                [0., 0.05079365, 0., 0.02308802, 0.],
                [0.05079365, 0., 0.02308802, 0., 0.01243201]])
     V, Vdag, Vinv = part_a(S)
     print reduce(dot, (Vdag, S, V))
     print Vinv
     print inv(V)
     print Vdag
     print(dot(Vinv, V))
     print(dot(V, Vinv))
Example #4
0
 def test5by5(self):
     print('Test 5 by 5')
     S = array([[ 1.06666667, 0., 0.15238095, 0., .05079365],
                [ 0., 0.15238095, 0., 0.05079365, 0.],
                [ 0.15238095, 0., 0.05079365, 0., 0.02308802],
                [ 0., 0.05079365, 0., 0.02308802, 0.],
                [ 0.05079365, 0., 0.02308802, 0., 0.01243201]])
     V, Vdag, Vinv = part_a(S)
     print reduce(dot, (Vdag, S, V))
     print Vinv
     print inv(V)
     print Vdag
     print(dot(Vinv, V))
     print(dot(V, Vinv))