Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(18)  |  Call(14)  |  Derive(0)  |  Import(4)

src/s/y/sympy-0.7.5/sympy/matrices/expressions/tests/test_determinant.py   sympy(Download)
from sympy.core import Lambda, S, symbols
from sympy.functions import adjoint, conjugate, transpose
from sympy.matrices import eye, Matrix, ShapeError
from sympy.matrices.expressions import (
    Adjoint, Identity, FunctionMatrix, MatrixExpr, MatrixSymbol, Determinant,
def test_det():
    assert isinstance(Determinant(A), Determinant)
    assert not isinstance(Determinant(A), MatrixExpr)
    raises(ShapeError, lambda: Determinant(C))
    assert det(eye(3)) == 1
    assert det(Matrix(3, 3, [1, 3, 2, 4, 1, 3, 2, 5, 2])) == 17
    A / det(A)  # Make sure this is possible
 
    raises(TypeError, lambda: Determinant(S.One))

src/s/y/sympy-HEAD/sympy/matrices/expressions/tests/test_determinant.py   sympy(Download)
from sympy.core import Lambda, S, symbols
from sympy.functions import adjoint, conjugate, transpose
from sympy.matrices import eye, Matrix, ShapeError
from sympy.matrices.expressions import (
    Adjoint, Identity, FunctionMatrix, MatrixExpr, MatrixSymbol, Determinant,
def test_det():
    assert isinstance(Determinant(A), Determinant)
    assert not isinstance(Determinant(A), MatrixExpr)
    raises(ShapeError, lambda: Determinant(C))
    assert det(eye(3)) == 1
    assert det(Matrix(3, 3, [1, 3, 2, 4, 1, 3, 2, 5, 2])) == 17
    A / det(A)  # Make sure this is possible
 
    raises(TypeError, lambda: Determinant(S.One))

src/s/y/sympy-0.7.5/sympy/assumptions/tests/test_matrices.py   sympy(Download)
from sympy import Q, ask, Symbol
from sympy.matrices.expressions import (MatrixSymbol, Identity, ZeroMatrix,
        Trace, MatrixSlice, Determinant)
from sympy.matrices.expressions.factorizations import LofLU
from sympy.utilities.pytest import XFAIL
def test_det_trace_positive():
    X = MatrixSymbol('X', 4, 4)
    assert ask(Q.positive(Trace(X)), Q.positive_definite(X))
    assert ask(Q.positive(Determinant(X)), Q.positive_definite(X))
 
    assert ask(Q.real_elements(X.I), Q.real_elements(X) & Q.invertible(X))
    assert ask(Q.real_elements(Trace(X)), Q.real_elements(X))
    assert ask(Q.integer_elements(Determinant(X)), Q.integer_elements(X))
    assert not ask(Q.integer_elements(X.I), Q.integer_elements(X))
    alpha = Symbol('alpha')
def test_matrix_element_sets_determinant_trace():
    assert ask(Q.integer(Determinant(X)), Q.integer_elements(X))
    assert ask(Q.integer(Trace(X)), Q.integer_elements(X))
 

src/s/y/sympy-HEAD/sympy/assumptions/tests/test_matrices.py   sympy(Download)
from sympy import Q, ask, Symbol
from sympy.matrices.expressions import (MatrixSymbol, Identity, ZeroMatrix,
        Trace, MatrixSlice, Determinant)
from sympy.matrices.expressions.factorizations import LofLU
from sympy.utilities.pytest import XFAIL
def test_det_trace_positive():
    X = MatrixSymbol('X', 4, 4)
    assert ask(Q.positive(Trace(X)), Q.positive_definite(X))
    assert ask(Q.positive(Determinant(X)), Q.positive_definite(X))
 
    assert ask(Q.real_elements(X.I), Q.real_elements(X) & Q.invertible(X))
    assert ask(Q.real_elements(Trace(X)), Q.real_elements(X))
    assert ask(Q.integer_elements(Determinant(X)), Q.integer_elements(X))
    assert not ask(Q.integer_elements(X.I), Q.integer_elements(X))
    alpha = Symbol('alpha')
def test_matrix_element_sets_determinant_trace():
    assert ask(Q.integer(Determinant(X)), Q.integer_elements(X))
    assert ask(Q.integer(Trace(X)), Q.integer_elements(X))