Пример #1
0
def test_QobjDiagonals():
    "Qobj diagonals"
    data = np.random.random(
        (5, 5)) + 1j * np.random.random((5, 5)) - (0.5 + 0.5j)
    A = Qobj(data)
    b = A.diag()
    assert_(np.all(b - np.diag(data) == 0))
Пример #2
0
def test_QobjDiagonals():
    "Qobj diagonals"
    data = np.random.random(
        (5, 5)) + 1j * np.random.random((5, 5)) - (0.5 + 0.5j)
    A = Qobj(data)
    b = A.diag()
    assert_(np.all(b - np.diag(data) == 0))
Пример #3
0
def test_QobjDiagonals():
    "Qobj diagonals"
    data = _random_not_singular(5)
    A = Qobj(data)
    b = A.diag()
    assert np.all(b - np.diag(data) == 0)