def test_ZeroMatrix(): A = MatrixSymbol('A', n, m) Z = ZeroMatrix(n, m) assert A + Z == A assert A * Z.T == ZeroMatrix(n, n) assert Z * A.T == ZeroMatrix(n, n) assert A - A == ZeroMatrix(*A.shape) assert Transpose(Z) == ZeroMatrix(m, n) assert Z.conjugate() == Z
def test_ZeroMatrix(): A = MatrixSymbol('A', n, m) Z = ZeroMatrix(n, m) assert A + Z == A assert A*Z.T == ZeroMatrix(n, n) assert Z*A.T == ZeroMatrix(n, n) assert A - A == ZeroMatrix(*A.shape) assert Transpose(Z) == ZeroMatrix(m, n) assert Z.conjugate() == Z
def test_ZeroMatrix(): n, m = symbols('n m', integer=True) A = MatrixSymbol('A', n, m) Z = ZeroMatrix(n, m) assert A + Z == A assert A * Z.T == ZeroMatrix(n, n) assert Z * A.T == ZeroMatrix(n, n) assert A - A == ZeroMatrix(*A.shape) assert Transpose(Z) == ZeroMatrix(m, n) assert Z.conjugate() == Z
def test_ZeroMatrix(): n, m = symbols("n m", integer=True) A = MatrixSymbol("A", n, m) Z = ZeroMatrix(n, m) assert A + Z == A assert A * Z.T == ZeroMatrix(n, n) assert Z * A.T == ZeroMatrix(n, n) assert A - A == ZeroMatrix(*A.shape) assert Transpose(Z) == ZeroMatrix(m, n) assert Z.conjugate() == Z
def test_ZeroMatrix(): A = MatrixSymbol('A', n, m) Z = ZeroMatrix(n, m) assert A + Z == A assert A*Z.T == ZeroMatrix(n, n) assert Z*A.T == ZeroMatrix(n, n) assert A - A == ZeroMatrix(*A.shape) assert transpose(Z) == ZeroMatrix(m, n) assert Z.conjugate() == Z assert ZeroMatrix(n, n)**0 == Identity(n) with raises(ShapeError): Z**0 with raises(ShapeError): Z**2
def test_ZeroMatrix(): A = MatrixSymbol('A', n, m) Z = ZeroMatrix(n, m) assert A + Z == A assert A * Z.T == ZeroMatrix(n, n) assert Z * A.T == ZeroMatrix(n, n) assert A - A == ZeroMatrix(*A.shape) assert transpose(Z) == ZeroMatrix(m, n) assert Z.conjugate() == Z assert ZeroMatrix(n, n)**0 == Identity(n) with raises(ShapeError): Z**0 with raises(ShapeError): Z**2
def test_ZeroMatrix(): A = MatrixSymbol('A', n, m) Z = ZeroMatrix(n, m) assert A + Z == A assert A*Z.T == ZeroMatrix(n, n) assert Z*A.T == ZeroMatrix(n, n) assert A - A == ZeroMatrix(*A.shape) assert Z assert transpose(Z) == ZeroMatrix(m, n) assert Z.conjugate() == Z assert ZeroMatrix(n, n)**0 == Identity(n) with raises(NonSquareMatrixError): Z**0 with raises(NonSquareMatrixError): Z**1 with raises(NonSquareMatrixError): Z**2 assert ZeroMatrix(3, 3).as_explicit() == ImmutableMatrix.zeros(3, 3)