コード例 #1
0
ファイル: test_densesolve.py プロジェクト: PWJ1900/Rlearncirq
def test_cholesky_solve():
    x, y, z = Dummy('x'), Dummy('y'), Dummy('z')
    assert cholesky_solve(
        [[QQ(25), QQ(15), QQ(-5)], [QQ(15), QQ(18), QQ(0)],
         [QQ(-5), QQ(0), QQ(11)]], [[x], [y], [z]],
        [[QQ(2)], [QQ(3)], [QQ(1)]], QQ) == [[QQ(-1, 225)], [QQ(23, 135)],
                                             [QQ(4, 45)]]
コード例 #2
0
ファイル: test_densesolve.py プロジェクト: msgoff/sympy
def test_cholesky_solve():
    x, y, z = Dummy("x"), Dummy("y"), Dummy("z")
    assert cholesky_solve(
        [[QQ(25), QQ(15), QQ(-5)], [QQ(15), QQ(18), QQ(0)],
         [QQ(-5), QQ(0), QQ(11)]],
        [[x], [y], [z]],
        [[QQ(2)], [QQ(3)], [QQ(1)]],
        QQ,
    ) == [[QQ(-1, 225)], [QQ(23, 135)], [QQ(4, 45)]]
コード例 #3
0
def test_cholesky_solve():
    x, y, z = Dummy('x'), Dummy('y'), Dummy('z')
    assert cholesky_solve([[QQ(25), QQ(15), QQ(-5)], [QQ(15), QQ(18), QQ(0)], [QQ(-5), QQ(0), QQ(11)]], [[x], [y], [z]], [[QQ(2)], [QQ(3)], [QQ(1)]], QQ) == [[QQ(-1, 225)], [QQ(23, 135)], [QQ(4, 45)]]