Did I find the right examples for you? yes no

All Samples(54)  |  Call(44)  |  Derive(0)  |  Import(10)

src/s/y/sympy-0.7.5/sympy/matrices/expressions/tests/test_matrix_exprs.py   sympy(Download)
from sympy.core import S, symbols, Add, Mul
from sympy.functions import transpose, sin, cos, sqrt
from sympy.simplify import simplify
from sympy.matrices import (Identity, ImmutableMatrix, Inverse, MatAdd, MatMul,
        MatPow, Matrix, MatrixExpr, MatrixSymbol, ShapeError, ZeroMatrix,
    assert Z.conjugate() == Z
 
    assert ZeroMatrix(n, n)**0 == Identity(n)
    with raises(ShapeError):
        Z**0
def test_Identity():
    A = MatrixSymbol('A', n, m)
    In = Identity(n)
    Im = Identity(m)
 
def test_Identity_doit():
    Inn = Identity(Add(n, n, evaluate=False))
    assert isinstance(Inn.rows, Add)
    assert Inn.doit() == Identity(2*n)
    assert isinstance(Inn.doit().rows, Mul)

src/s/y/sympy-HEAD/sympy/matrices/expressions/tests/test_matrix_exprs.py   sympy(Download)
from sympy.core import S, symbols, Add, Mul
from sympy.functions import transpose, sin, cos, sqrt
from sympy.simplify import simplify
from sympy.matrices import (Identity, ImmutableMatrix, Inverse, MatAdd, MatMul,
        MatPow, Matrix, MatrixExpr, MatrixSymbol, ShapeError, ZeroMatrix,
    assert Z.conjugate() == Z
 
    assert ZeroMatrix(n, n)**0 == Identity(n)
    with raises(ShapeError):
        Z**0
def test_Identity():
    A = MatrixSymbol('A', n, m)
    In = Identity(n)
    Im = Identity(m)
 
def test_Identity_doit():
    Inn = Identity(Add(n, n, evaluate=False))
    assert isinstance(Inn.rows, Add)
    assert Inn.doit() == Identity(2*n)
    assert isinstance(Inn.doit().rows, Mul)

src/s/y/sympy-0.7.5/sympy/matrices/expressions/tests/test_matmul.py   sympy(Download)
from sympy.core import I, symbols
from sympy.functions import adjoint, transpose
from sympy.matrices import Identity, Inverse, Matrix, MatrixSymbol, ZeroMatrix
from sympy.matrices.expressions import Adjoint, Transpose, det
from sympy.matrices.expressions.matmul import (factor_in_front, remove_ids,
def test_remove_ids():
    assert remove_ids(MatMul(A, Identity(m), B, evaluate=False)) == \
                      MatMul(A, B, evaluate=False)
    assert null_safe(remove_ids)(MatMul(Identity(n), evaluate=False)) == \
                                 MatMul(Identity(n), evaluate=False)
 
def test_xxinv():
    assert xxinv(MatMul(D, Inverse(D), D, evaluate=False)) == \
                 MatMul(Identity(n), D, evaluate=False)

src/s/y/sympy-HEAD/sympy/matrices/expressions/tests/test_matmul.py   sympy(Download)
from sympy.core import I, symbols
from sympy.functions import adjoint, transpose
from sympy.matrices import Identity, Inverse, Matrix, MatrixSymbol, ZeroMatrix
from sympy.matrices.expressions import Adjoint, Transpose, det
from sympy.matrices.expressions.matmul import (factor_in_front, remove_ids,
def test_remove_ids():
    assert remove_ids(MatMul(A, Identity(m), B, evaluate=False)) == \
                      MatMul(A, B, evaluate=False)
    assert null_safe(remove_ids)(MatMul(Identity(n), evaluate=False)) == \
                                 MatMul(Identity(n), evaluate=False)
 
def test_xxinv():
    assert xxinv(MatMul(D, Inverse(D), D, evaluate=False)) == \
                 MatMul(Identity(n), D, evaluate=False)

src/s/y/sympy-0.7.5/sympy/matrices/tests/test_interactions.py   sympy(Download)
 
from sympy import symbols
from sympy.matrices import (Matrix, MatrixSymbol, eye, Identity,
        ImmutableMatrix)
from sympy.matrices.expressions import MatrixExpr, MatAdd
meye = eye(3)
imeye = ImmutableMatrix(eye(3))
ideye = Identity(3)
a, b, c = symbols('a,b,c')
 
def test_ME_MM():
    assert isinstance(Identity(3) + MM, MatrixExpr)
    assert isinstance(SM + MM, MatAdd)
    assert isinstance(MM + SM, MatAdd)
    assert (Identity(3) + MM)[1, 1] == 6
 
 
def test_equality():
    a, b, c = Identity(3), eye(3), ImmutableMatrix(eye(3))

src/s/y/sympy-HEAD/sympy/matrices/tests/test_interactions.py   sympy(Download)
 
from sympy import symbols
from sympy.matrices import (Matrix, MatrixSymbol, eye, Identity,
        ImmutableMatrix)
from sympy.matrices.expressions import MatrixExpr, MatAdd
meye = eye(3)
imeye = ImmutableMatrix(eye(3))
ideye = Identity(3)
a, b, c = symbols('a,b,c')
 
def test_ME_MM():
    assert isinstance(Identity(3) + MM, MatrixExpr)
    assert isinstance(SM + MM, MatAdd)
    assert isinstance(MM + SM, MatAdd)
    assert (Identity(3) + MM)[1, 1] == 6
 
 
def test_equality():
    a, b, c = Identity(3), eye(3), ImmutableMatrix(eye(3))

src/s/y/sympy-0.7.5/sympy/matrices/expressions/tests/test_inverse.py   sympy(Download)
from sympy.core import symbols, S
from sympy.functions import adjoint, conjugate, transpose
from sympy.matrices.expressions import MatrixSymbol, Inverse
from sympy.matrices import eye, Identity, Matrix, ShapeError
from sympy.utilities.pytest import raises
    assert C.inverse().inverse() == C
 
    assert C.inverse()*C == Identity(C.rows)
 
    assert Identity(n).inverse() == Identity(n)
    assert (3*Identity(n)).inverse() == Identity(n)/3

src/s/y/sympy-HEAD/sympy/matrices/expressions/tests/test_inverse.py   sympy(Download)
from sympy.core import symbols, S
from sympy.functions import adjoint, conjugate, transpose
from sympy.matrices.expressions import MatrixSymbol, Inverse
from sympy.matrices import eye, Identity, Matrix, ShapeError
from sympy.utilities.pytest import raises
    assert C.inverse().inverse() == C
 
    assert C.inverse()*C == Identity(C.rows)
 
    assert Identity(n).inverse() == Identity(n)
    assert (3*Identity(n)).inverse() == Identity(n)/3

src/s/y/sympy-0.7.5/sympy/matrices/expressions/tests/test_fourier.py   sympy(Download)
from sympy import S, I, ask, Q, Abs, simplify, exp, sqrt
from sympy.matrices.expressions.fourier import DFT, IDFT
from sympy.matrices import det, Matrix, Identity
from sympy.abc import n, i, j
def test_dft():
    assert DFT(4).shape == (4, 4)
    assert ask(Q.unitary(DFT(4)))
    assert Abs(simplify(det(Matrix(DFT(4))))) == 1
    assert DFT(n)*IDFT(n) == Identity(n)

src/s/y/sympy-HEAD/sympy/matrices/expressions/tests/test_fourier.py   sympy(Download)
from sympy import S, I, ask, Q, Abs, simplify, exp, sqrt
from sympy.matrices.expressions.fourier import DFT, IDFT
from sympy.matrices import det, Matrix, Identity
from sympy.abc import n, i, j
def test_dft():
    assert DFT(4).shape == (4, 4)
    assert ask(Q.unitary(DFT(4)))
    assert Abs(simplify(det(Matrix(DFT(4))))) == 1
    assert DFT(n)*IDFT(n) == Identity(n)