sympde.calculus package

Submodules

sympde.calculus.core module

The calculus subpackage provides different operators, as generic as possible, but knowning properties between them. For instance, the following statement will naturally give 0

>>> from sympde.calculus import grad, curl
>>> from sympde.topology import Domain
>>> from sympde.topology import ScalarFunctionSpace
>>> from sympde.topology import ScalarFunction
>>> from sympde.topology import element_of
>>> domain = Domain('Omega', dim=2)
>>> V = ScalarFunctionSpace('V', domain)
>>> u,u1,u2 = [ScalarFunction(V, name=i) for i in ['u', 'u1', 'u2']]
>>> curl(grad(u))
0
>>> domain = Domain('Omega', dim=2)
>>> V = ScalarFunctionSpace('V', domain)
>>> W = VectorFunctionSpace('W', domain)
>>> alpha, beta, gamma = [Constant(i) for i in ['alpha','beta','gamma']]
>>> f,g,h = [element_of(V, name=i) for i in ['f','g','h']]
>>> F,G,H = [element_of(W, i) for i in ['F','G','H']]

Generic properties

scalar gradient properties

>>> assert( grad(f+g) == grad(f) + grad(g) )
>>> assert( grad(alpha*f) == alpha*grad(f) )
>>> assert( grad(alpha*f + beta*g) == alpha*grad(f) + beta*grad(g)  )
>>> assert( grad(f*g) == f*grad(g) + g*grad(f) )
>>> assert( grad(f/g) == -f*grad(g)/g**2 + grad(f)/g )
>>> assert( expand(grad(f*g*h)) == f*g*grad(h) + f*h*grad(g) + g*h*grad(f) )

vector gradient properties

>>> assert( grad(F+G) == grad(F) + grad(G) )
>>> assert( grad(alpha*F) == alpha*grad(F) )
>>> assert( grad(alpha*F + beta*G) == alpha*grad(F) + beta*grad(G)  )
>>> assert( grad(dot(F,G)) == convect(F, G) + convect(G, F) + cross(F, curl(G)) - cross(curl(F), G) )

curl properties

>>> assert( curl(f+g) == curl(f) + curl(g) )
>>> assert( curl(alpha*f) == alpha*curl(f) )
>>> assert( curl(alpha*f + beta*g) == alpha*curl(f) + beta*curl(g)  )

laplace properties

>>> assert( laplace(f+g) == laplace(f) + laplace(g) )
>>> assert( laplace(alpha*f) == alpha*laplace(f) )
>>> assert( laplace(alpha*f + beta*g) == alpha*laplace(f) + beta*laplace(g)  )

divergence properties

>>> assert( div(F+G) == div(F) + div(G) )
>>> assert( div(alpha*F) == alpha*div(F) )
>>> assert( div(alpha*F + beta*G) == alpha*div(F) + beta*div(G)  )
>>> assert( div(cross(F,G)) == -dot(F, curl(G)) + dot(G, curl(F)) )

2D specific properties

rot properties

>>> assert( rot(F+G) == rot(F) + rot(G) )
>>> assert( rot(alpha*F) == alpha*rot(F) )
>>> assert( rot(alpha*F + beta*G) == alpha*rot(F) + beta*rot(G)  )

3D specific properties

class sympde.calculus.core.Average(*_args)[source]

Bases: BasicOperator

Represents the average of an expression at the interface of two subdomains.

This operator implements the properties of addition and multiplication

Examples

default_assumptions = {}
classmethod eval(*_args)[source]

Returns a canonical form of cls applied to arguments args.

Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function “sign”

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class sympde.calculus.core.BasicOperator(*args)[source]

Bases: CalculusFunction

Basic class for calculus operators.

default_assumptions = {}
class sympde.calculus.core.BasicOperatorAdd(*args, **options)[source]

Bases: Add

default_assumptions = {}
class sympde.calculus.core.Bracket(arg1, arg2)[source]

Bases: DiffOperator

This operator represents the Poisson bracket between two expressions.

default_assumptions = {'commutative': True}
classmethod eval(arg1, arg2)[source]

Returns a canonical form of cls applied to arguments args.

Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function “sign”

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
property is_algebraic

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

is_commutative = True
property is_complex

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_composite

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_even

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_negative

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_nonnegative

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_nonpositive

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_nonzero

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_positive

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_real

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_imaginary

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_integer

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_irrational

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_negative

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_noninteger

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_nonnegative

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_nonpositive

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_nonzero

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_odd

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_positive

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_prime

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_rational

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_real

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

is_scalar = True
property is_transcendental

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_zero

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

class sympde.calculus.core.Convect(*args)[source]

Bases: BasicOperator

This operator represents the convection operator defined as \(convect(F, G) := (F \cdot \\nabla) G\).

This operator implements the properties of addition and multiplication

Examples

>>> domain = Domain('Omega', dim=2)
>>> V = ScalarFunctionSpace('V', domain)
>>> W = VectorFunctionSpace('W', domain)
>>> alpha, beta, gamma = [Constant(i) for i in ['alpha','beta','gamma']]
>>> f,g,h = [element_of(V, name=i) for i in ['f','g','h']]
>>> F,G,H = [element_of(W, i) for i in ['F','G','H']]
>>> convect(F+G, H)
convect(F,H) + convect(G,H)
>>> convect(alpha*F,H)
alpha*convect(F,H)
>>> convect(F,alpha*H)
alpha*convect(F,H)
default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_scalar = False
is_transcendental = False
is_zero = False
class sympde.calculus.core.Convolution(*_args)[source]

Bases: BasicOperator

Represents a generic Convolution operator, without knowledge of the dimension.

default_assumptions = {}
classmethod eval(*_args)[source]

Returns a canonical form of cls applied to arguments args.

Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function “sign”

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class sympde.calculus.core.Cross(*args)[source]

Bases: BasicOperator

This operator represents the cross product between two expressions, regardless of the dimension.

default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_scalar = False
is_transcendental = False
is_zero = False
class sympde.calculus.core.Curl(expr)[source]

Bases: DiffOperator

Represents a generic Curl operator, without knowledge of the dimension.

This operator implements the properties of addition and multiplication

Examples

>>> from sympde.core import Constant
>>> from sympde.topology import Domain
>>> from sympde.topology import VectorFunctionSpace
>>> from sympde.topology import VectorFunction
>>> domain = Domain('Omega', dim=2)
>>> V = VectorFunctionSpace('V', domain)
>>> u,u1,u2 = [VectorFunction(V, name=i) for i in ['u', 'u1', 'u2']]
>>> v,v1,v2 = [VectorFunction(V, name=i) for i in ['v', 'v1', 'v2']]
>>> alpha = Constant('alpha', is_real=True)
>>> curl(u1+u2,v1)
Curl(u1, v1) + Curl(u2, v1)
>>> curl(alpha*u1)
alpha*Curl(u1)
default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
classmethod eval(expr)[source]

Returns a canonical form of cls applied to arguments args.

Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function “sign”

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_scalar = False
is_transcendental = False
is_zero = False
sympde.calculus.core.D

alias of StrainTensor

class sympde.calculus.core.DiffOperator(*args)[source]

Bases: CalculusFunction

Basic class for calculus operators.

default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_transcendental = False
is_zero = False
class sympde.calculus.core.Div(expr)[source]

Bases: DiffOperator

Represents a generic Div operator, without knowledge of the dimension.

This operator implements the properties of addition and multiplication

Examples

>>> from sympde.core import Constant
>>> from sympde.topology import Domain
>>> from sympde.topology import VectorFunctionSpace
>>> from sympde.topology import VectorFunction
>>> domain = Domain('Omega', dim=2)
>>> V = VectorFunctionSpace('V', domain)
>>> u,u1,u2 = [VectorFunction(V, name=i) for i in ['u', 'u1', 'u2']]
>>> v,v1,v2 = [VectorFunction(V, name=i) for i in ['v', 'v1', 'v2']]
>>> alpha = Constant('alpha', is_real=True)
>>> div(u1+u2,v1)
Div(u1, v1) + Div(u2, v1)
>>> div(alpha*u1)
alpha*Div(u1)
default_assumptions = {'commutative': True}
classmethod eval(expr)[source]

Returns a canonical form of cls applied to arguments args.

Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function “sign”

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
property is_algebraic

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

is_commutative = True
property is_complex

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_composite

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_even

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_negative

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_nonnegative

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_nonpositive

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_nonzero

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_positive

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_real

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_imaginary

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_integer

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_irrational

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_negative

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_noninteger

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_nonnegative

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_nonpositive

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_nonzero

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_odd

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_positive

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_prime

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_rational

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_real

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

is_scalar = True
property is_transcendental

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_zero

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

sympde.calculus.core.Dn

alias of NormalDerivative

class sympde.calculus.core.Dot(*args)[source]

Bases: BasicOperator

Represents a generic Dot operator, without knowledge of the dimension.

Examples

>>> from sympde.calculus import Dot
>>> from sympy import Tuple
>>> from sympy.abc import x,y
>>> a = Tuple(x,1)
>>> b = Tuple(1,y)
>>> dot(a,b)
x + y

This operator implements the properties of addition and multiplication

>>> from sympde.core import Constant
>>> from sympde.topology import Domain
>>> from sympde.topology import VectorFunctionSpace
>>> from sympde.topology import VectorFunction
>>> domain = Domain('Omega', dim=2)
>>> V = VectorFunctionSpace('V', domain)
>>> u,u1,u2 = [VectorFunction(V, name=i) for i in ['u', 'u1', 'u2']]
>>> v,v1,v2 = [VectorFunction(V, name=i) for i in ['v', 'v1', 'v2']]
>>> alpha = Constant('alpha', is_real=True)
>>> dot(u1+u2,v1)
Dot(u1, v1) + Dot(u2, v1)
>>> dot(u1,alpha*v1)
alpha*Dot(u1, v1)
default_assumptions = {'commutative': True, 'composite': False, 'even': False, 'integer': False, 'irrational': False, 'negative': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'zero': False}
is_commutative = True
is_composite = False
is_even = False
is_integer = False
is_irrational = False
is_negative = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_scalar = True
is_zero = False
class sympde.calculus.core.Grad(expr)[source]

Bases: DiffOperator

Represents a generic Grad operator, without knowledge of the dimension.

This operator implements the properties of addition and multiplication

Examples

>>> from sympde.core import Constant
>>> from sympde.topology import Domain
>>> from sympde.topology import VectorFunctionSpace
>>> from sympde.topology import VectorFunction
>>> domain = Domain('Omega', dim=2)
>>> V = ScalarFunctionSpace('V', domain)
>>> u,u1,u2 = [ScalarFunction(V, name=i) for i in ['u', 'u1', 'u2']]
>>> v,v1,v2 = [ScalarFunction(V, name=i) for i in ['v', 'v1', 'v2']]
>>> alpha = Constant('alpha', is_real=True)
>>> grad(u1+u2,v1)
Grad(u1, v1) + Grad(u2, v1)
>>> grad(alpha*u1)
alpha*Grad(u1)
>>> grad(2)
0
default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
classmethod eval(expr)[source]

Returns a canonical form of cls applied to arguments args.

Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function “sign”

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_scalar = False
is_transcendental = False
is_zero = False
class sympde.calculus.core.Hessian(expr)[source]

Bases: DiffOperator

Represents a generic Hessian operator, without knowledge of the dimension.

This operator implements the properties of addition and multiplication

Examples

>>> from sympde.core import Constant
>>> from sympde.topology import Domain
>>> from sympde.topology import VectorFunctionSpace
>>> from sympde.topology import VectorFunction
>>> domain = Domain('Omega', dim=2)
>>> V = ScalarFunctionSpace('V', domain)
>>> u,u1,u2 = [ScalarFunction(V, name=i) for i in ['u', 'u1', 'u2']]
>>> v,v1,v2 = [ScalarFunction(V, name=i) for i in ['v', 'v1', 'v2']]
>>> alpha = Constant('alpha', is_real=True)
>>> hessian(u1+u2,v1)
Hessian(u1, v1) + Hessian(u2, v1)
>>> hessian(alpha*u1)
alpha*Hessian(u1)
default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
classmethod eval(expr)[source]

Returns a canonical form of cls applied to arguments args.

Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function “sign”

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_scalar = False
is_transcendental = False
is_zero = False
class sympde.calculus.core.Inner(*args)[source]

Bases: BasicOperator

Represents a generic Frobenius inner operator, without knowledge of the dimension.

This operator implements the properties of addition and multiplication

Examples

>>> from sympde.calculus import inner, grad
>>> from sympde.topology import Domain
>>> from sympde.topology import VectorFunctionSpace
>>> from sympde.topology import VectorFunction
>>> domain = Domain('Omega', dim=2)
>>> V = VectorFunctionSpace('V', domain)
>>> u,u1,u2 = [VectorFunction(V, name=i) for i in ['u', 'u1', 'u2']]
>>> v,v1,v2 = [VectorFunction(V, name=i) for i in ['v', 'v1', 'v2']]
>>> inner(grad(u), grad(v))
Inner(Grad(u), Grad(v))
>>> inner(grad(u1+u2), grad(v))
Inner(Grad(u1), Grad(v)) + Inner(Grad(u2), Grad(v))
default_assumptions = {'commutative': True, 'composite': False, 'even': False, 'integer': False, 'irrational': False, 'negative': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'zero': False}
is_commutative = True
is_composite = False
is_even = False
is_integer = False
is_irrational = False
is_negative = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_scalar = True
is_zero = False
class sympde.calculus.core.Jump(*_args)[source]

Bases: BasicOperator

Represents the jump of an expression at the interface of two subdomains.

This operator implements the properties of addition and multiplication

Examples

default_assumptions = {}
classmethod eval(*_args)[source]

Returns a canonical form of cls applied to arguments args.

Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function “sign”

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class sympde.calculus.core.Laplace(expr)[source]

Bases: DiffOperator

Represents a generic Laplace operator, without knowledge of the dimension.

This operator implements the properties of addition and multiplication

Examples

>>> from sympde.core import Constant
>>> from sympde.topology import Domain
>>> from sympde.topology import VectorFunctionSpace
>>> from sympde.topology import VectorFunction
>>> domain = Domain('Omega', dim=2)
>>> V = ScalarFunctionSpace('V', domain)
>>> u,u1,u2 = [ScalarFunction(V, name=i) for i in ['u', 'u1', 'u2']]
>>> v,v1,v2 = [ScalarFunction(V, name=i) for i in ['v', 'v1', 'v2']]
>>> alpha = Constant('alpha', is_real=True)
>>> laplace(u1+u2,v1)
Laplace(u1, v1) + Laplace(u2, v1)
>>> laplace(alpha*u1)
alpha*Laplace(u1)
default_assumptions = {'commutative': True}
classmethod eval(expr)[source]

Returns a canonical form of cls applied to arguments args.

Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function “sign”

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
property is_algebraic

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

is_commutative = True
property is_complex

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_composite

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_even

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_negative

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_nonnegative

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_nonpositive

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_nonzero

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_positive

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_extended_real

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_imaginary

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_integer

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_irrational

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_negative

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_noninteger

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_nonnegative

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_nonpositive

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_nonzero

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_odd

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_positive

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_prime

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_rational

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_real

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

is_scalar = True
property is_transcendental

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

property is_zero

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

class sympde.calculus.core.MinusInterfaceOperator(*_args)[source]

Bases: BasicOperator

The minus operator represents the value of an expression on the first side of an interface.

default_assumptions = {}
classmethod eval(*_args)[source]

Returns a canonical form of cls applied to arguments args.

Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function “sign”

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
property space
class sympde.calculus.core.NormalDerivative(*_args)[source]

Bases: DiffOperator

Represents the normal derivative.

This operator implements the properties of addition and multiplication

Examples

default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
classmethod eval(*_args)[source]

Returns a canonical form of cls applied to arguments args.

Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function “sign”

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_transcendental = False
is_zero = False
class sympde.calculus.core.Outer(*args)[source]

Bases: BasicOperator

Represents a generic outer operator, without knowledge of the dimension.

This operator implements the properties of addition and multiplication

default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_scalar = False
is_transcendental = False
is_zero = False
class sympde.calculus.core.PlusInterfaceOperator(*_args)[source]

Bases: BasicOperator

The plus operator represents the value of an expression on the second side of an interface.

default_assumptions = {}
classmethod eval(*_args)[source]

Returns a canonical form of cls applied to arguments args.

Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function “sign”

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
property space
class sympde.calculus.core.Rot(expr)[source]

Bases: DiffOperator

Represents a generic 2D rotational operator.

This operator implements the properties of addition and multiplication

Examples

>>> from sympde.core import Constant
>>> from sympde.topology import Domain
>>> from sympde.topology import VectorFunctionSpace
>>> from sympde.topology import VectorFunction
>>> domain = Domain('Omega', dim=2)
>>> V = ScalarFunctionSpace('V', domain)
>>> u,u1,u2 = [ScalarFunction(V, name=i) for i in ['u', 'u1', 'u2']]
>>> v,v1,v2 = [ScalarFunction(V, name=i) for i in ['v', 'v1', 'v2']]
>>> alpha = Constant('alpha', is_real=True)
>>> rot(u1+u2,v1)
Rot(u1, v1) + Rot(u2, v1)
>>> rot(alpha*u1)
alpha*Rot(u1)
default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
classmethod eval(expr)[source]

Returns a canonical form of cls applied to arguments args.

Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function “sign”

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_scalar = False
is_transcendental = False
is_zero = False
class sympde.calculus.core.StrainTensor(expr)[source]

Bases: Grad

This operator represents the strain tensor (grad(u) + transpose(grad(u)))/2

default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_transcendental = False
is_zero = False
sympde.calculus.core.add_basicop(expr)[source]
sympde.calculus.core.avg

alias of Average

sympde.calculus.core.bracket

alias of Bracket

sympde.calculus.core.conv

alias of Convolution

sympde.calculus.core.convect

alias of Convect

sympde.calculus.core.cross

alias of Cross

sympde.calculus.core.curl

alias of Curl

sympde.calculus.core.div

alias of Div

sympde.calculus.core.dot

alias of Dot

sympde.calculus.core.grad

alias of Grad

sympde.calculus.core.has(obj, types)[source]
sympde.calculus.core.hessian

alias of Hessian

sympde.calculus.core.inner

alias of Inner

sympde.calculus.core.is_constant(atom)[source]

Determine whether the given atom represents a constant number.

sympde.calculus.core.is_scalar(atom)[source]

Determine whether the given atom represents a scalar quantity.

sympde.calculus.core.is_zero(x)[source]
sympde.calculus.core.jump

alias of Jump

sympde.calculus.core.laplace

alias of Laplace

sympde.calculus.core.minus

alias of MinusInterfaceOperator

sympde.calculus.core.outer

alias of Outer

sympde.calculus.core.plus

alias of PlusInterfaceOperator

sympde.calculus.core.rot

alias of Rot

sympde.calculus.errors module

exception sympde.calculus.errors.ArgumentTypeError(*args, **kwargs)[source]

Bases: CalculusError

exception sympde.calculus.errors.CalculusError(*args, **kwargs)[source]

Bases: Exception

sympde.calculus.matrices module

class sympde.calculus.matrices.Inverse(*args, **options)[source]

Bases: MatrixSymbolicExpr

property arg
default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
is_Matrix = False
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_transcendental = False
is_zero = False
class sympde.calculus.matrices.MatSymbolicAbs(*args, **options)[source]

Bases: MatrixSymbolicExpr

default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_transcendental = False
is_zero = False
class sympde.calculus.matrices.MatSymbolicAdd(*args, **options)[source]

Bases: MatrixSymbolicExpr, Add

default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
is_Matrix = False
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_transcendental = False
is_zero = False
class sympde.calculus.matrices.MatSymbolicMul(*args, **options)[source]

Bases: MatrixSymbolicExpr, Mul

default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
is_Matrix = False
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_transcendental = False
is_zero = False
class sympde.calculus.matrices.MatSymbolicPow(*args, **options)[source]

Bases: MatrixSymbolicExpr, Pow

default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
is_Matrix = False
is_algebraic = False
is_commutative
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_transcendental = False
is_zero = False
class sympde.calculus.matrices.MatrixElement(base, indices, **options)[source]

Bases: Expr

property base
default_assumptions = {}
property indices
class sympde.calculus.matrices.MatrixSymbolicExpr(*args, **options)[source]

Bases: Expr

property T
default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
det()[source]
inv()[source]
inverse()[source]
is_Identity = False
is_Matrix = True
is_MatrixSymbolicExpr = True
is_ZeroMatrix = False
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_transcendental = False
is_zero = False
trace()[source]
transpose()[source]
class sympde.calculus.matrices.SymbolicDeterminant(*args, **options)[source]

Bases: Expr

property arg
default_assumptions = {'commutative': True}
is_commutative = True
class sympde.calculus.matrices.SymbolicTrace(*args, **options)[source]

Bases: Expr

property arg
default_assumptions = {'commutative': True}
is_commutative = True
class sympde.calculus.matrices.Transpose(*args, **options)[source]

Bases: MatrixSymbolicExpr

property arg
default_assumptions = {'algebraic': False, 'commutative': False, 'complex': False, 'composite': False, 'even': False, 'extended_negative': False, 'extended_nonnegative': False, 'extended_nonpositive': False, 'extended_nonzero': False, 'extended_positive': False, 'extended_real': False, 'imaginary': False, 'integer': False, 'irrational': False, 'negative': False, 'noninteger': False, 'nonnegative': False, 'nonpositive': False, 'nonzero': False, 'odd': False, 'positive': False, 'prime': False, 'rational': False, 'real': False, 'transcendental': False, 'zero': False}
is_Matrix = False
is_algebraic = False
is_commutative = False
is_complex = False
is_composite = False
is_even = False
is_extended_negative = False
is_extended_nonnegative = False
is_extended_nonpositive = False
is_extended_nonzero = False
is_extended_positive = False
is_extended_real = False
is_imaginary = False
is_integer = False
is_irrational = False
is_negative = False
is_noninteger = False
is_nonnegative = False
is_nonpositive = False
is_nonzero = False
is_odd = False
is_positive = False
is_prime = False
is_rational = False
is_real = False
is_transcendental = False
is_zero = False

Module contents