Reduce expression by combining powers with similar bases and exponents.
Explanation
If deep
is True
then powsimp() will also simplify arguments of
diff --git a/dev/explanation/index.html b/dev/explanation/index.html
index 1056f2f7eee..5bd7b718a5b 100644
--- a/dev/explanation/index.html
+++ b/dev/explanation/index.html
@@ -329,18 +329,20 @@
The Python Package SymPy can be used to symbolically solve physics problems on Classical Mechanics, Continuum Mechanics, Control Systems, High-Energy Physics, Optics, Quantum Mechanics, Units and Vector algebra.
-For physics tutorials, please check out:
+ -Provides basic quaternion operations.
Quaternion objects can be instantiated as Quaternion(a, b, c, d)
as in \(q = a + bi + cj + dk\).
Adds quaternions.
Returns the angle of the quaternion measured in the real-axis plane.
Explanation
Given a quaternion \(q = a + bi + cj + dk\) where \(a\), \(b\), \(c\) and \(d\) @@ -938,7 +940,7 @@
Returns True if the transformation arcs represented by the input quaternions happen in the same plane.
Returns \(\mathbf{Ax}(q)\), the axis of the quaternion \(q\).
Explanation
Given a quaternion \(q = a + bi + cj + dk\), returns \(\mathbf{Ax}(q)\) i.e., the versor of the vector part of that quaternion @@ -995,7 +997,7 @@
Returns the exponential of \(q\), given by \(e^q\).
Returns quaternion from elements of a column vector`. If vector_only is True, returns only imaginary part as a Matrix of length 3.
@@ -1055,7 +1057,7 @@Returns a rotation quaternion given the axis and the angle of rotation.
Returns quaternion equivalent to rotation represented by the Euler
angles, in the sequence defined by seq
.
Returns the equivalent quaternion of a matrix. The quaternion will be normalized only if the matrix is special orthogonal (orthogonal and det(M) = 1).
Returns the index vector of the quaternion.
Computes integration of quaternion.
Returns the inverse of the quaternion.
Returns true if the quaternion is pure, false if the quaternion is not pure or returns none if it is unknown.
Explanation
@@ -1250,7 +1252,7 @@Returns true if the quaternion is a zero quaternion or false if it is not a zero quaternion and None if the value is unknown.
Explanation
@@ -1276,7 +1278,7 @@Returns the logarithm of the quaternion, given by \(\log q\).
Examples
>>> from sympy import Quaternion
@@ -1292,7 +1294,7 @@ Introduction
-
-mensor()[source]¶
+mensor()[source]¶
Returns the natural logarithm of the norm(magnitude) of the quaternion.
Examples
>>> from sympy.algebras.quaternion import Quaternion
@@ -1311,7 +1313,7 @@ Introduction
-
-mul(other)[source]¶
+mul(other)[source]¶
Multiplies quaternions.
- Parameters:
@@ -1353,19 +1355,19 @@ Introduction
-
-norm()[source]¶
+norm()[source]¶
Returns the norm of the quaternion.
-
-orthogonal(other)[source]¶
+orthogonal(other)[source]¶
Returns the orthogonality of two quaternions.
- Parameters:
@@ -1397,7 +1399,7 @@ Introduction
-
-parallel(other)[source]¶
+parallel(other)[source]¶
Returns True if the two pure quaternions seen as 3D vectors are parallel.
- Parameters:
@@ -1429,7 +1431,7 @@ Introduction
-
-pow(p)[source]¶
+pow(p)[source]¶
Finds the pth power of the quaternion.
- Parameters:
@@ -1457,7 +1459,7 @@ Introduction
-
-pow_cos_sin(p)[source]¶
+pow_cos_sin(p)[source]¶
Computes the pth power in the cos-sin form.
- Parameters:
@@ -1582,7 +1584,7 @@ Introduction
-
-static rotate_point(pin, r)[source]¶
+static rotate_point(pin, r)[source]¶
Returns the coordinates of the point pin (a 3 tuple) after rotation.
- Parameters:
@@ -1621,7 +1623,7 @@ Introduction
-
-scalar_part()[source]¶
+scalar_part()[source]¶
Returns scalar part(\(\mathbf{S}(q)\)) of the quaternion q.
Explanation
Given a quaternion \(q = a + bi + cj + dk\), returns \(\mathbf{S}(q) = a\).
@@ -1636,7 +1638,7 @@ Introduction
-
-set_norm(norm)[source]¶
+set_norm(norm)[source]¶
Sets norm of an already instantiated quaternion.
- Parameters:
@@ -1671,7 +1673,7 @@ Introduction
-
-to_Matrix(vector_only=False)[source]¶
+to_Matrix(vector_only=False)[source]¶
Returns elements of quaternion as a column vector.
By default, a Matrix
of length 4 is returned, with the real part as the
first element.
@@ -1719,7 +1721,7 @@
Introduction
-
-to_axis_angle()[source]¶
+to_axis_angle()[source]¶
Returns the axis and angle of rotation of a quaternion.
- Returns:
@@ -1751,7 +1753,7 @@ Introductionavoid_square_root=False,
-)[source]¶
+)[source]¶
Returns Euler angles representing same rotation as the quaternion,
in the sequence given by seq
. This implements the method described
in [R3].
@@ -1826,7 +1828,7 @@ Introductionhomogeneous=True,
-)[source]¶
+)[source]¶
Returns the equivalent rotation transformation matrix of the quaternion
which represents rotation about the origin if v
is not passed.
@@ -1869,7 +1871,7 @@ Introduction
-
-classmethod vector_coplanar(q1, q2, q3)[source]¶
+classmethod vector_coplanar(q1, q2, q3)[source]¶
Returns True if the axis of the pure quaternions seen as 3D vectors
q1
, q2
, and q3
are coplanar.
@@ -1921,7 +1923,7 @@ Introduction
-
-vector_part()[source]¶
+vector_part()[source]¶
Returns \(\mathbf{V}(q)\), the vector part of the quaternion \(q\).
Explanation
Given a quaternion \(q = a + bi + cj + dk\), returns \(\mathbf{V}(q) = bi + cj + dk\).
diff --git a/dev/modules/assumptions/ask.html b/dev/modules/assumptions/ask.html
index 917bd89b763..265b3a0b9b0 100644
--- a/dev/modules/assumptions/ask.html
+++ b/dev/modules/assumptions/ask.html
@@ -329,18 +329,20 @@
- Linearized Carvallo-Whipple Bicycle Model
+- Control Tutorials
-- How-to Guides
+
+
+- How-to Guides
- Assumptions
- Symbolic and fuzzy booleans
- Writing Custom Functions
-- Physics
-
+- Physics
- Solve Equations
- Solving Guidance
- Solve an Equation Algebraically
@@ -803,14 +805,14 @@ Documentation Version
Module for querying SymPy objects about assumptions.
-
-class sympy.assumptions.ask.AssumptionKeys[source]¶
+class sympy.assumptions.ask.AssumptionKeys[source]¶
This class contains all the supported keys by ask
.
It should be accessed via the instance sympy.Q
.
-
-sympy.assumptions.ask.ask(proposition, assumptions=True, context={})[source]¶
+sympy.assumptions.ask.ask(proposition, assumptions=True, context={})[source]¶
Function to evaluate the proposition with assumptions.
- Parameters:
@@ -900,7 +902,7 @@ Documentation Version
-
-sympy.assumptions.ask.register_handler(key, handler)[source]¶
+sympy.assumptions.ask.register_handler(key, handler)[source]¶
Register a handler in the ask system. key must be a string and handler a
class inheriting from AskHandler.
@@ -910,7 +912,7 @@ Documentation Version
-
-sympy.assumptions.ask.remove_handler(key, handler)[source]¶
+sympy.assumptions.ask.remove_handler(key, handler)[source]¶
Removes a handler from the ask system.
Deprecated since version 1.8.: Use multipledispatch handler instead. See Predicate
.
diff --git a/dev/modules/assumptions/assume.html b/dev/modules/assumptions/assume.html
index 79c4ac76d2d..46078a3f878 100644
--- a/dev/modules/assumptions/assume.html
+++ b/dev/modules/assumptions/assume.html
@@ -329,18 +329,20 @@
- Linearized Carvallo-Whipple Bicycle Model
+- Control Tutorials
-- How-to Guides
+
+
+- How-to Guides
- Assumptions
- Symbolic and fuzzy booleans
- Writing Custom Functions
-- Physics
-
+- Physics
- Solve Equations
- Solving Guidance
- Solve an Equation Algebraically
@@ -803,7 +805,7 @@ Documentation Version
A module which implements predicates and assumption context.
-
-class sympy.assumptions.assume.AppliedPredicate(predicate, *args)[source]¶
+class sympy.assumptions.assume.AppliedPredicate(predicate, *args)[source]¶
The class of expressions resulting from applying Predicate
to
the arguments. AppliedPredicate
merely wraps its argument and
remain unevaluated. To evaluate it, use the ask()
function.
@@ -858,7 +860,7 @@ Documentation Version
@@ -911,7 +913,7 @@ Documentation Version
-
-eval(args, assumptions=True)[source]¶
+eval(args, assumptions=True)[source]¶
Evaluate self(*args)
under the given assumptions.
This uses only direct resolution methods, not logical inference.
@@ -995,13 +997,13 @@ Documentation Version
-
-classmethod register(*types, **kwargs)[source]¶
+classmethod register(*types, **kwargs)[source]¶
Register the signature to the handler.
-
-classmethod register_many(*types, **kwargs)[source]¶
+classmethod register_many(*types, **kwargs)[source]¶
Register multiple signatures to same handler.
@@ -1009,7 +1011,7 @@ Documentation Version
-
-class sympy.assumptions.assume.UndefinedPredicate(name, handlers=None)[source]¶
+class sympy.assumptions.assume.UndefinedPredicate(name, handlers=None)[source]¶
Predicate without handler.
Explanation
This predicate is generated by using Predicate
directly for
@@ -1028,7 +1030,7 @@
Documentation Version
-
-sympy.assumptions.assume.assuming(*assumptions)[source]¶
+sympy.assumptions.assume.assuming(*assumptions)[source]¶
Context manager for assumptions.
Examples
>>> from sympy import assuming, Q, ask
diff --git a/dev/modules/assumptions/index.html b/dev/modules/assumptions/index.html
index c5bd15290bc..a6de8cca1aa 100644
--- a/dev/modules/assumptions/index.html
+++ b/dev/modules/assumptions/index.html
@@ -329,18 +329,20 @@
- Linearized Carvallo-Whipple Bicycle Model
+- Control Tutorials
-- How-to Guides
+
+
+- How-to Guides
- Assumptions
- Symbolic and fuzzy booleans
- Writing Custom Functions
-- Physics
-
+- Physics
- Solve Equations
- Solving Guidance
- Solve an Equation Algebraically
@@ -805,7 +807,7 @@ Documentation Version
Predicate¶
-
-class sympy.assumptions.assume.Predicate(*args, **kwargs)[source]
+class sympy.assumptions.assume.Predicate(*args, **kwargs)[source]
Base class for mathematical predicates. It also serves as a
constructor for undefined predicate objects.
Explanation
@@ -877,7 +879,7 @@ Predicate
-
-eval(args, assumptions=True)[source]
+eval(args, assumptions=True)[source]
Evaluate self(*args)
under the given assumptions.
This uses only direct resolution methods, not logical inference.
@@ -889,13 +891,13 @@ Predicate
-
-classmethod register(*types, **kwargs)[source]
+classmethod register(*types, **kwargs)[source]
Register the signature to the handler.
-
-classmethod register_many(*types, **kwargs)[source]
+classmethod register_many(*types, **kwargs)[source]
Register multiple signatures to same handler.
@@ -903,7 +905,7 @@ Predicate
-
-class sympy.assumptions.assume.AppliedPredicate(predicate, *args)[source]
+class sympy.assumptions.assume.AppliedPredicate(predicate, *args)[source]
The class of expressions resulting from applying Predicate
to
the arguments. AppliedPredicate
merely wraps its argument and
remain unevaluated. To evaluate it, use the ask()
function.
@@ -963,7 +965,7 @@ Querying
is ask()
:
-
-sympy.assumptions.ask.ask(proposition, assumptions=True, context={})[source]
+sympy.assumptions.ask.ask(proposition, assumptions=True, context={})[source]
Function to evaluate the proposition with assumptions.
- Parameters:
diff --git a/dev/modules/assumptions/predicates.html b/dev/modules/assumptions/predicates.html
index 2d95f41ed23..7ab70eebd86 100644
--- a/dev/modules/assumptions/predicates.html
+++ b/dev/modules/assumptions/predicates.html
@@ -329,18 +329,20 @@
- Linearized Carvallo-Whipple Bicycle Model
+- Control Tutorials
-- How-to Guides
+
+
+- How-to Guides
- Assumptions
- Symbolic and fuzzy booleans
- Writing Custom Functions
-- Physics
-
+- Physics
- Solve Equations
- Solving Guidance
- Solve an Equation Algebraically
@@ -804,7 +806,7 @@ Documentation Version
Common¶
-
-class sympy.assumptions.predicates.common.IsTruePredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.common.IsTruePredicate(*args, **kwargs)[source]¶
Generic predicate.
Explanation
ask(Q.is_true(x))
is true iff x
is true. This only makes
@@ -849,7 +851,7 @@
Common¶
-
-class sympy.assumptions.predicates.common.CommutativePredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.common.CommutativePredicate(*args, **kwargs)[source]¶
Commutative predicate.
Explanation
ask(Q.commutative(x))
is true iff x
commutes with any other
@@ -869,7 +871,7 @@
Common¶
Calculus¶
-
-class sympy.assumptions.predicates.calculus.FinitePredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.calculus.FinitePredicate(*args, **kwargs)[source]¶
Finite number predicate.
Explanation
Q.finite(x)
is true if x
is a number but neither an infinity
@@ -913,7 +915,7 @@
Calculus
-
-class sympy.assumptions.predicates.calculus.InfinitePredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.calculus.InfinitePredicate(*args, **kwargs)[source]¶
Infinite number predicate.
Q.infinite(x)
is true iff the absolute value of x
is
infinity.
@@ -932,7 +934,7 @@ Calculus
Matrix¶
-
-class sympy.assumptions.predicates.matrices.SymmetricPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.SymmetricPredicate(*args, **kwargs)[source]¶
Symmetric matrix predicate.
Explanation
Q.symmetric(x)
is true iff x
is a square matrix and is equal to
@@ -969,7 +971,7 @@
Matrix¶
-
-class sympy.assumptions.predicates.matrices.InvertiblePredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.InvertiblePredicate(*args, **kwargs)[source]¶
Invertible matrix predicate.
Explanation
Q.invertible(x)
is true iff x
is an invertible matrix.
@@ -1006,7 +1008,7 @@
Matrix¶
-
-class sympy.assumptions.predicates.matrices.OrthogonalPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.OrthogonalPredicate(*args, **kwargs)[source]¶
Orthogonal matrix predicate.
Explanation
Q.orthogonal(x)
is true iff x
is an orthogonal matrix.
@@ -1048,7 +1050,7 @@
Matrix¶
-
-class sympy.assumptions.predicates.matrices.UnitaryPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.UnitaryPredicate(*args, **kwargs)[source]¶
Unitary matrix predicate.
Explanation
Q.unitary(x)
is true iff x
is a unitary matrix.
@@ -1087,7 +1089,7 @@
Matrix¶
-
-class sympy.assumptions.predicates.matrices.PositiveDefinitePredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.PositiveDefinitePredicate(*args, **kwargs)[source]¶
Positive definite matrix predicate.
Explanation
If \(M\) is a \(n \times n\) symmetric real matrix, it is said
@@ -1126,7 +1128,7 @@
Matrix¶
-
-class sympy.assumptions.predicates.matrices.UpperTriangularPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.UpperTriangularPredicate(*args, **kwargs)[source]¶
Upper triangular matrix predicate.
Explanation
A matrix \(M\) is called upper triangular matrix if \(M_{ij}=0\)
@@ -1158,7 +1160,7 @@
Matrix¶
-
-class sympy.assumptions.predicates.matrices.LowerTriangularPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.LowerTriangularPredicate(*args, **kwargs)[source]¶
Lower triangular matrix predicate.
Explanation
A matrix \(M\) is called lower triangular matrix if \(M_{ij}=0\)
@@ -1190,7 +1192,7 @@
Matrix¶
-
-class sympy.assumptions.predicates.matrices.DiagonalPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.DiagonalPredicate(*args, **kwargs)[source]¶
Diagonal matrix predicate.
Explanation
Q.diagonal(x)
is true iff x
is a diagonal matrix. A diagonal
@@ -1225,7 +1227,7 @@
Matrix¶
-
-class sympy.assumptions.predicates.matrices.FullRankPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.FullRankPredicate(*args, **kwargs)[source]¶
Fullrank matrix predicate.
Explanation
Q.fullrank(x)
is true iff x
is a full rank matrix.
@@ -1255,7 +1257,7 @@
Matrix¶
-
-class sympy.assumptions.predicates.matrices.SquarePredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.SquarePredicate(*args, **kwargs)[source]¶
Square matrix predicate.
Explanation
Q.square(x)
is true iff x
is a square matrix. A square matrix
@@ -1293,7 +1295,7 @@
Matrix¶
-
-class sympy.assumptions.predicates.matrices.IntegerElementsPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.IntegerElementsPredicate(*args, **kwargs)[source]¶
Integer elements matrix predicate.
Explanation
Q.integer_elements(x)
is true iff all the elements of x
@@ -1317,7 +1319,7 @@
Matrix¶
-
-class sympy.assumptions.predicates.matrices.RealElementsPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.RealElementsPredicate(*args, **kwargs)[source]¶
Real elements matrix predicate.
Explanation
Q.real_elements(x)
is true iff all the elements of x
@@ -1341,7 +1343,7 @@
Matrix¶
-
-class sympy.assumptions.predicates.matrices.ComplexElementsPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.ComplexElementsPredicate(*args, **kwargs)[source]¶
Complex elements matrix predicate.
Explanation
Q.complex_elements(x)
is true iff all the elements of x
@@ -1367,7 +1369,7 @@
Matrix¶
-
-class sympy.assumptions.predicates.matrices.SingularPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.SingularPredicate(*args, **kwargs)[source]¶
Singular matrix predicate.
A matrix is singular iff the value of its determinant is 0.
Examples
@@ -1398,7 +1400,7 @@ Matrix¶
-
-class sympy.assumptions.predicates.matrices.NormalPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.NormalPredicate(*args, **kwargs)[source]¶
Normal matrix predicate.
A matrix is normal if it commutes with its conjugate transpose.
Examples
@@ -1427,7 +1429,7 @@ Matrix¶
-
-class sympy.assumptions.predicates.matrices.TriangularPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.TriangularPredicate(*args, **kwargs)[source]¶
Triangular matrix predicate.
Explanation
Q.triangular(X)
is true if X
is one that is either lower
@@ -1460,7 +1462,7 @@
Matrix¶
-
-class sympy.assumptions.predicates.matrices.UnitTriangularPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.matrices.UnitTriangularPredicate(*args, **kwargs)[source]¶
Unit triangular matrix predicate.
Explanation
A unit triangular matrix is a triangular matrix with 1s
@@ -1487,7 +1489,7 @@
Matrix¶
Number Theory¶
-
-class sympy.assumptions.predicates.ntheory.EvenPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.ntheory.EvenPredicate(*args, **kwargs)[source]¶
Even number predicate.
Explanation
ask(Q.even(x))
is true iff x
belongs to the set of even
@@ -1516,7 +1518,7 @@
Number Theory
-
-class sympy.assumptions.predicates.ntheory.OddPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.ntheory.OddPredicate(*args, **kwargs)[source]¶
Odd number predicate.
Explanation
ask(Q.odd(x))
is true iff x
belongs to the set of odd numbers.
@@ -1544,7 +1546,7 @@ Number Theory
-
-class sympy.assumptions.predicates.ntheory.PrimePredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.ntheory.PrimePredicate(*args, **kwargs)[source]¶
Prime number predicate.
Explanation
ask(Q.prime(x))
is true iff x
is a natural number greater
@@ -1576,7 +1578,7 @@
Number Theory
-
-class sympy.assumptions.predicates.ntheory.CompositePredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.ntheory.CompositePredicate(*args, **kwargs)[source]¶
Composite number predicate.
Explanation
ask(Q.composite(x))
is true iff x
is a positive integer and has
@@ -1608,7 +1610,7 @@
Number Theory¶
-
-class sympy.assumptions.predicates.order.PositivePredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.order.PositivePredicate(*args, **kwargs)[source]¶
Positive real number predicate.
Explanation
Q.positive(x)
is true iff x
is real and \(x > 0\), that is if x
@@ -1656,7 +1658,7 @@
Order¶
-
-class sympy.assumptions.predicates.order.NegativePredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.order.NegativePredicate(*args, **kwargs)[source]¶
Negative number predicate.
Explanation
Q.negative(x)
is true iff x
is a real number and \(x < 0\), that is,
@@ -1704,7 +1706,7 @@
Order¶
-
-class sympy.assumptions.predicates.order.ZeroPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.order.ZeroPredicate(*args, **kwargs)[source]¶
Zero number predicate.
Explanation
ask(Q.zero(x))
is true iff the value of x
is zero.
@@ -1735,7 +1737,7 @@ Order¶
-
-class sympy.assumptions.predicates.order.NonZeroPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.order.NonZeroPredicate(*args, **kwargs)[source]¶
Nonzero real number predicate.
Explanation
ask(Q.nonzero(x))
is true iff x
is real and x
is not zero. Note in
@@ -1782,7 +1784,7 @@
Order¶
-
-class sympy.assumptions.predicates.order.NonPositivePredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.order.NonPositivePredicate(*args, **kwargs)[source]¶
Nonpositive real number predicate.
Explanation
ask(Q.nonpositive(x))
is true iff x
belongs to the set of
@@ -1826,7 +1828,7 @@
Order¶
-
-class sympy.assumptions.predicates.order.NonNegativePredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.order.NonNegativePredicate(*args, **kwargs)[source]¶
Nonnegative real number predicate.
Explanation
ask(Q.nonnegative(x))
is true iff x
belongs to the set of
@@ -1871,7 +1873,7 @@
Order¶
Sets¶
-
-class sympy.assumptions.predicates.sets.IntegerPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.sets.IntegerPredicate(*args, **kwargs)[source]¶
Integer predicate.
Explanation
Q.integer(x)
is true iff x
belongs to the set of integer
@@ -1904,7 +1906,7 @@
Sets¶
-
-class sympy.assumptions.predicates.sets.RationalPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.sets.RationalPredicate(*args, **kwargs)[source]¶
Rational number predicate.
Explanation
Q.rational(x)
is true iff x
belongs to the set of
@@ -1939,7 +1941,7 @@
Sets¶
-
-class sympy.assumptions.predicates.sets.IrrationalPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.sets.IrrationalPredicate(*args, **kwargs)[source]¶
Irrational number predicate.
Explanation
Q.irrational(x)
is true iff x
is any real number that
@@ -1976,7 +1978,7 @@
Sets¶
-
-class sympy.assumptions.predicates.sets.RealPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.sets.RealPredicate(*args, **kwargs)[source]¶
Real number predicate.
Explanation
Q.real(x)
is true iff x
is a real number, i.e., it is in the
@@ -2047,7 +2049,7 @@
Sets¶
-
-class sympy.assumptions.predicates.sets.ExtendedRealPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.sets.ExtendedRealPredicate(*args, **kwargs)[source]¶
Extended real predicate.
Explanation
Q.extended_real(x)
is true iff x
is a real number or
@@ -2078,7 +2080,7 @@
Sets¶
-
-class sympy.assumptions.predicates.sets.HermitianPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.sets.HermitianPredicate(*args, **kwargs)[source]¶
Hermitian predicate.
Explanation
ask(Q.hermitian(x))
is true iff x
belongs to the set of
@@ -2103,7 +2105,7 @@
Sets¶
-
-class sympy.assumptions.predicates.sets.ComplexPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.sets.ComplexPredicate(*args, **kwargs)[source]¶
Complex number predicate.
Explanation
Q.complex(x)
is true iff x
belongs to the set of complex
@@ -2139,7 +2141,7 @@
Sets¶
-
-class sympy.assumptions.predicates.sets.ImaginaryPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.sets.ImaginaryPredicate(*args, **kwargs)[source]¶
Imaginary number predicate.
Explanation
Q.imaginary(x)
is true iff x
can be written as a real
@@ -2176,7 +2178,7 @@
Sets¶
-
-class sympy.assumptions.predicates.sets.AntihermitianPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.sets.AntihermitianPredicate(*args, **kwargs)[source]¶
Antihermitian predicate.
Explanation
Q.antihermitian(x)
is true iff x
belongs to the field of
@@ -2203,7 +2205,7 @@
Sets¶
-
-class sympy.assumptions.predicates.sets.AlgebraicPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.sets.AlgebraicPredicate(*args, **kwargs)[source]¶
Algebraic number predicate.
Explanation
Q.algebraic(x)
is true iff x
belongs to the set of
@@ -2243,7 +2245,7 @@
Sets¶
-
-class sympy.assumptions.predicates.sets.TranscendentalPredicate(*args, **kwargs)[source]¶
+class sympy.assumptions.predicates.sets.TranscendentalPredicate(*args, **kwargs)[source]¶
Transcedental number predicate.
Explanation
Q.transcendental(x)
is true iff x
belongs to the set of
diff --git a/dev/modules/assumptions/refine.html b/dev/modules/assumptions/refine.html
index 71addd6a3d6..7616e24b752 100644
--- a/dev/modules/assumptions/refine.html
+++ b/dev/modules/assumptions/refine.html
@@ -329,18 +329,20 @@
- Linearized Carvallo-Whipple Bicycle Model
+- Control Tutorials
-- How-to Guides
+
+
+- How-to Guides
- Assumptions
- Symbolic and fuzzy booleans
- Writing Custom Functions
-- Physics
-
+- Physics
- Solve Equations
- Solving Guidance
- Solve an Equation Algebraically
@@ -802,7 +804,7 @@ Documentation Version
Refine¶
-
-sympy.assumptions.refine.refine(expr, assumptions=True)[source]¶
+sympy.assumptions.refine.refine(expr, assumptions=True)[source]¶
Simplify an expression using assumptions.
Explanation
Unlike simplify()
which performs structural simplification
@@ -840,7 +842,7 @@
Documentation Version
-
-sympy.assumptions.refine.refine_Pow(expr, assumptions)[source]¶
+sympy.assumptions.refine.refine_Pow(expr, assumptions)[source]¶
Handler for instances of Pow.
Examples
>>> from sympy import Q
@@ -868,7 +870,7 @@ Documentation Version
-
-sympy.assumptions.refine.refine_abs(expr, assumptions)[source]¶
+sympy.assumptions.refine.refine_abs(expr, assumptions)[source]¶
Handler for the absolute value.
Examples
>>> from sympy import Q, Abs
@@ -885,7 +887,7 @@ Documentation Version
-
-sympy.assumptions.refine.refine_arg(expr, assumptions)[source]¶
+sympy.assumptions.refine.refine_arg(expr, assumptions)[source]¶
Handler for complex argument
Explanation
>>> from sympy.assumptions.refine import refine_arg
@@ -901,7 +903,7 @@ Documentation Version
-
-sympy.assumptions.refine.refine_atan2(expr, assumptions)[source]¶
+sympy.assumptions.refine.refine_atan2(expr, assumptions)[source]¶
Handler for the atan2 function.
Examples
>>> from sympy import Q, atan2
@@ -927,7 +929,7 @@ Documentation Version
-
-sympy.assumptions.refine.refine_im(expr, assumptions)[source]¶
+sympy.assumptions.refine.refine_im(expr, assumptions)[source]¶
Handler for imaginary part.
Explanation
>>> from sympy.assumptions.refine import refine_im
@@ -943,7 +945,7 @@ Documentation Version
-
-sympy.assumptions.refine.refine_matrixelement(expr, assumptions)[source]¶
+sympy.assumptions.refine.refine_matrixelement(expr, assumptions)[source]¶
Handler for symmetric part.
Examples
>>> from sympy.assumptions.refine import refine_matrixelement
@@ -959,7 +961,7 @@ Documentation Version
-
-sympy.assumptions.refine.refine_re(expr, assumptions)[source]¶
+sympy.assumptions.refine.refine_re(expr, assumptions)[source]¶
Handler for real part.
Examples
>>> from sympy.assumptions.refine import refine_re
@@ -975,7 +977,7 @@ Documentation Version
-
-sympy.assumptions.refine.refine_sign(expr, assumptions)[source]¶
+sympy.assumptions.refine.refine_sign(expr, assumptions)[source]¶
Handler for sign.
Examples
>>> from sympy.assumptions.refine import refine_sign
diff --git a/dev/modules/calculus/index.html b/dev/modules/calculus/index.html
index 858db33572b..de76646de0c 100644
--- a/dev/modules/calculus/index.html
+++ b/dev/modules/calculus/index.html
@@ -329,18 +329,20 @@
- Linearized Carvallo-Whipple Bicycle Model
+- Control Tutorials
-- How-to Guides
+
+
+- How-to Guides
- Assumptions
- Symbolic and fuzzy booleans
- Writing Custom Functions
-- Physics
-
+- Physics
- Solve Equations
- Solving Guidance
- Solve an Equation Algebraically
@@ -805,7 +807,7 @@ Documentation Version
Euler-Lagrange Equations for given Lagrangian.
-
-sympy.calculus.euler.euler_equations(L, funcs=(), vars=())[source]¶
+sympy.calculus.euler.euler_equations(L, funcs=(), vars=())[source]¶
Find the Euler-Lagrange equations [R31] for a given Lagrangian.
- Parameters:
@@ -891,7 +893,7 @@ Documentation Version
- symbol=None,
-)[source]¶
+)[source]¶
Return whether the function is decreasing in the given interval.
- Parameters:
@@ -949,7 +951,7 @@ Documentation Version
- symbol=None,
-)[source]¶
+)[source]¶
Return whether the function is increasing in the given interval.
- Parameters:
@@ -1003,7 +1005,7 @@ Documentation Version
- symbol=None,
-)[source]¶
+)[source]¶
Return whether the function is monotonic in the given interval.
- Parameters:
@@ -1065,7 +1067,7 @@ Documentation Version
- symbol=None,
-)[source]¶
+)[source]¶
Return whether the function is strictly decreasing in the given interval.
- Parameters:
@@ -1119,7 +1121,7 @@ Documentation Version
- symbol=None,
-)[source]¶
+)[source]¶
Return whether the function is strictly increasing in the given interval.
- Parameters:
@@ -1174,7 +1176,7 @@ Documentation Version
- symbol=None,
-)[source]¶
+)[source]¶
Helper function for functions checking function monotonicity.
- Parameters:
@@ -1213,7 +1215,7 @@ Documentation Version
-
-sympy.calculus.singularities.singularities(expression, symbol, domain=None)[source]¶
+sympy.calculus.singularities.singularities(expression, symbol, domain=None)[source]¶
Find singularities of a given function.
- Parameters:
@@ -1300,7 +1302,7 @@ Documentation Version
-
-sympy.calculus.finite_diff.apply_finite_diff(order, x_list, y_list, x0=0)[source]¶
+sympy.calculus.finite_diff.apply_finite_diff(order, x_list, y_list, x0=0)[source]¶
Calculates the finite difference approximation of
the derivative of requested order at x0
from points
provided in x_list
and y_list
.
@@ -1380,7 +1382,7 @@ Documentation Version
- evaluate=False,
-)[source]¶
+)[source]¶
Differentiate expr and replace Derivatives with finite differences.
- Parameters:
@@ -1432,7 +1434,7 @@ Documentation Version
-
-sympy.calculus.finite_diff.finite_diff_weights(order, x_list, x0=1)[source]¶
+sympy.calculus.finite_diff.finite_diff_weights(order, x_list, x0=1)[source]¶
Calculates the finite difference weights for an arbitrarily spaced
one-dimensional grid (x_list
) for derivatives at x0
of order
0, 1, …, up to order
using a recursive formula. Order of accuracy
@@ -1570,7 +1572,7 @@
Documentation Version
-
-sympy.calculus.util.continuous_domain(f, symbol, domain)[source]¶
+sympy.calculus.util.continuous_domain(f, symbol, domain)[source]¶
Returns the domain on which the function expression f is continuous.
This function is limited by the ability to determine the various
singularities and discontinuities of the given function.
@@ -1623,7 +1625,7 @@
Documentation Version
-
-sympy.calculus.util.function_range(f, symbol, domain)[source]¶
+sympy.calculus.util.function_range(f, symbol, domain)[source]¶
Finds the range of a function in a given domain.
This method is limited by the ability to determine the singularities and
determine limits.
@@ -1680,7 +1682,7 @@ Documentation Version
-
-sympy.calculus.util.is_convex(f, *syms, domain=Reals)[source]¶
+sympy.calculus.util.is_convex(f, *syms, domain=Reals)[source]¶
Determines the convexity of the function passed in the argument.
- Parameters:
@@ -1757,7 +1759,7 @@ Documentation Version
-
-sympy.calculus.util.lcim(numbers)[source]¶
+sympy.calculus.util.lcim(numbers)[source]¶
Returns the least common integral multiple of a list of numbers.
The numbers can be rational or irrational or a mixture of both.
\(None\) is returned for incommensurable numbers.
@@ -1789,7 +1791,7 @@ Documentation Version
-
-sympy.calculus.util.maximum(f, symbol, domain=Reals)[source]¶
+sympy.calculus.util.maximum(f, symbol, domain=Reals)[source]¶
Returns the maximum value of a function in the given domain.
- Parameters:
@@ -1836,7 +1838,7 @@ Documentation Version
-
-sympy.calculus.util.minimum(f, symbol, domain=Reals)[source]¶
+sympy.calculus.util.minimum(f, symbol, domain=Reals)[source]¶
Returns the minimum value of a function in the given domain.
- Parameters:
@@ -1883,7 +1885,7 @@ Documentation Version
-
-sympy.calculus.util.not_empty_in(finset_intersection, *syms)[source]¶
+sympy.calculus.util.not_empty_in(finset_intersection, *syms)[source]¶
Finds the domain of the functions in finset_intersection
in which the
finite_set
is not-empty.
@@ -1930,7 +1932,7 @@ Documentation Version
-
-sympy.calculus.util.periodicity(f, symbol, check=False)[source]¶
+sympy.calculus.util.periodicity(f, symbol, check=False)[source]¶
Tests the given function for periodicity in the given symbol.
- Parameters:
@@ -1990,7 +1992,7 @@ Documentation Version
-
-sympy.calculus.util.stationary_points(f, symbol, domain=Reals)[source]¶
+sympy.calculus.util.stationary_points(f, symbol, domain=Reals)[source]¶
Returns the stationary points of a function (where derivative of the
function is 0) in the given domain.
diff --git a/dev/modules/categories.html b/dev/modules/categories.html
index 2798dc36400..81a22d6c515 100644
--- a/dev/modules/categories.html
+++ b/dev/modules/categories.html
@@ -329,18 +329,20 @@
- Linearized Carvallo-Whipple Bicycle Model
+- Control Tutorials
-- How-to Guides
+
+
+- How-to Guides
- Assumptions
- Symbolic and fuzzy booleans
- Writing Custom Functions
-- Physics
-
+- Physics
- Solve Equations
- Solving Guidance
- Solve an Equation Algebraically
@@ -826,7 +828,7 @@ Introduction
-
-class sympy.categories.Object(name, **assumptions)[source]¶
+class sympy.categories.Object(name, **assumptions)[source]¶
The base class for any kind of object in an abstract category.
Explanation
While technically any instance of Basic
will do, this
@@ -836,7 +838,7 @@
Introduction
-
-class sympy.categories.Morphism(domain, codomain)[source]¶
+class sympy.categories.Morphism(domain, codomain)[source]¶
The base class for any morphism in an abstract category.
Explanation
In abstract categories, a morphism is an arrow between two
@@ -869,7 +871,7 @@
Introduction
-
-compose(other)[source]¶
+compose(other)[source]¶
Composes self with the supplied morphism.
The order of elements in the composition is the usual order,
i.e., to construct \(g\circ f\) use g.compose(f)
.
@@ -910,7 +912,7 @@ Introduction
-
-class sympy.categories.NamedMorphism(domain, codomain, name)[source]¶
+class sympy.categories.NamedMorphism(domain, codomain, name)[source]¶
Represents a morphism which has a name.
Explanation
Names are used to distinguish between morphisms which have the
@@ -950,7 +952,7 @@
Introduction
-
-class sympy.categories.CompositeMorphism(*components)[source]¶
+class sympy.categories.CompositeMorphism(*components)[source]¶
Represents a morphism which is a composition of other morphisms.
Explanation
Two composite morphisms are equal if the morphisms they were
@@ -1032,7 +1034,7 @@
Introduction
-
-flatten(new_name)[source]¶
+flatten(new_name)[source]¶
Forgets the composite structure of this morphism.
Explanation
If new_name
is not empty, returns a NamedMorphism
@@ -1057,7 +1059,7 @@
Introduction
-
-class sympy.categories.IdentityMorphism(domain)[source]¶
+class sympy.categories.IdentityMorphism(domain)[source]¶
Represents an identity morphism.
Explanation
An identity morphism is a morphism with equal domain and codomain,
@@ -1091,7 +1093,7 @@
Introductioncommutative_diagrams=EmptySet,
-)[source]¶
+)[source]¶
An (abstract) category.
Explanation
A category [JoyOfCats] is a quadruple \(\mbox{K} = (O, \hom, id,
@@ -1188,7 +1190,7 @@ Introduction
-
-class sympy.categories.Diagram(*args)[source]¶
+class sympy.categories.Diagram(*args)[source]¶
Represents a diagram in a certain category.
Explanation
Informally, a diagram is a collection of objects of a category and
@@ -1262,7 +1264,7 @@
Introduction
-
-hom(A, B)[source]¶
+hom(A, B)[source]¶
Returns a 2-tuple of sets of morphisms between objects A
and
B
: one set of morphisms listed as premises, and the other set
of morphisms listed as conclusions.
@@ -1287,7 +1289,7 @@ Introduction
-
-is_subdiagram(diagram)[source]¶
+is_subdiagram(diagram)[source]¶
Checks whether diagram
is a subdiagram of self
.
Diagram \(D'\) is a subdiagram of \(D\) if all premises
(conclusions) of \(D'\) are contained in the premises
@@ -1352,7 +1354,7 @@
Introduction
-
-subdiagram_from_objects(objects)[source]¶
+subdiagram_from_objects(objects)[source]¶
If objects
is a subset of the objects of self
, returns
a diagram which has as premises all those premises of self
which have a domains and codomains in objects
, likewise
@@ -1382,7 +1384,7 @@
Introduction
-
-class sympy.categories.diagram_drawing.DiagramGrid(diagram, groups=None, **hints)[source]¶
+class sympy.categories.diagram_drawing.DiagramGrid(diagram, groups=None, **hints)[source]¶
Constructs and holds the fitting of the diagram into a grid.
Explanation
The mission of this class is to analyse the structure of the
@@ -1585,7 +1587,7 @@
Introductionlabel,
-)[source]¶
+)[source]¶
Stores the information necessary for producing an Xy-pic
description of an arrow.
The principal goal of this class is to abstract away the string
@@ -1680,7 +1682,7 @@
Introduction
-
-class sympy.categories.diagram_drawing.XypicDiagramDrawer[source]¶
+class sympy.categories.diagram_drawing.XypicDiagramDrawer[source]¶
Given a Diagram
and the corresponding
DiagramGrid
, produces the Xy-pic representation of the
diagram.
@@ -1802,7 +1804,7 @@ Introductiondiagram_format='',
-)[source]¶
+)[source]¶
Returns the Xy-pic representation of diagram
laid out in
grid
.
Consider the following simple triangle diagram.
@@ -1865,7 +1867,7 @@ Introduction**hints,
-)[source]¶
+)[source]¶
Provides a shortcut combining DiagramGrid
and
XypicDiagramDrawer
. Returns an Xy-pic presentation of
diagram
. The argument masked
is a list of morphisms which
@@ -1912,7 +1914,7 @@
Introduction**hints,
-)[source]¶
+)[source]¶
Combines the functionality of xypic_draw_diagram
and
sympy.printing.preview
. The arguments masked
,
diagram_format
, groups
, and hints
are passed to
diff --git a/dev/modules/codegen.html b/dev/modules/codegen.html
index d15157e2913..2329f7bfd93 100644
--- a/dev/modules/codegen.html
+++ b/dev/modules/codegen.html
@@ -329,18 +329,20 @@
- Linearized Carvallo-Whipple Bicycle Model
+- Control Tutorials
-- How-to Guides
+
+
+- How-to Guides
- Assumptions
- Symbolic and fuzzy booleans
- Writing Custom Functions
-- Physics
-
+- Physics
- Solve Equations
- Solving Guidance
- Solve an Equation Algebraically
@@ -1341,7 +1343,7 @@ Autowrap
- opportunistic=True,
-)[source]¶
+)[source]¶
Specialization of ReplaceOptim for functions evaluating “f(x) - 1”.
-
-replace_in_Add(e)[source]¶
+replace_in_Add(e)[source]¶
passed as second argument to Basic.replace(…)
@@ -1388,7 +1390,7 @@ Autowrap
-
-class sympy.codegen.rewriting.Optimization(cost_function=None, priority=1)[source]¶
+class sympy.codegen.rewriting.Optimization(cost_function=None, priority=1)[source]¶
Abstract base class for rewriting optimization.
Subclasses should implement __call__
taking an expression
as argument.
@@ -1402,7 +1404,7 @@ Autowrap
-
-class sympy.codegen.rewriting.ReplaceOptim(query, value, **kwargs)[source]¶
+class sympy.codegen.rewriting.ReplaceOptim(query, value, **kwargs)[source]¶
Rewriting optimization calling replace on expressions.
- Parameters:
@@ -1443,7 +1445,7 @@ Autowrap
- base_req=<function <lambda>>,
-)[source]¶
+)[source]¶
Creates an instance of ReplaceOptim
for expanding Pow
.
-
-class sympy.codegen.matrix_nodes.MatrixSolve(*args, **kwargs)[source]¶
+class sympy.codegen.matrix_nodes.MatrixSolve(*args, **kwargs)[source]¶
Represents an operation to solve a linear matrix equation.
- Parameters:
@@ -1569,7 +1571,7 @@ Autowrap
- **kwargs,
-)[source]¶
+)[source]¶
Approximates functions by expanding them as a series.
- Parameters:
@@ -1616,7 +1618,7 @@ Autowrap
-
-class sympy.codegen.approximations.SumApprox(bounds, reltol, **kwargs)[source]¶
+class sympy.codegen.approximations.SumApprox(bounds, reltol, **kwargs)[source]¶
Approximates sum by neglecting small terms.
- Parameters:
@@ -1778,7 +1780,7 @@ Using the nodes
-
-class sympy.codegen.ast.Assignment(lhs, rhs)[source]¶
+class sympy.codegen.ast.Assignment(lhs, rhs)[source]¶
Represents variable assignment for code generation.
- Parameters:
@@ -1818,7 +1820,7 @@ Using the nodes
-
-class sympy.codegen.ast.AssignmentBase(lhs, rhs)[source]¶
+class sympy.codegen.ast.AssignmentBase(lhs, rhs)[source]¶
Abstract base class for Assignment and AugmentedAssignment.
Attributes:
@@ -1829,7 +1831,7 @@ Using the nodes
-
-class sympy.codegen.ast.Attribute(possibly parametrized)[source]¶
+class sympy.codegen.ast.Attribute(possibly parametrized)[source]¶
For use with sympy.codegen.ast.Node
(which takes instances of
Attribute
as attrs
).
@@ -1856,7 +1858,7 @@ Using the nodes
-
-class sympy.codegen.ast.AugmentedAssignment(lhs, rhs)[source]¶
+class sympy.codegen.ast.AugmentedAssignment(lhs, rhs)[source]¶
Base class for augmented assignments.
Attributes:
@@ -1868,7 +1870,7 @@ Using the nodes
-
-class sympy.codegen.ast.BreakToken(*args, **kwargs)[source]¶
+class sympy.codegen.ast.BreakToken(*args, **kwargs)[source]¶
Represents ‘break’ in C/Python (‘exit’ in Fortran).
Use the premade instance break_
or instantiate manually.
Examples
@@ -1884,7 +1886,7 @@ Using the nodes
-
-class sympy.codegen.ast.CodeBlock(*args)[source]¶
+class sympy.codegen.ast.CodeBlock(*args)[source]¶
Represents a block of code.
Explanation
For now only assignments are supported. This restriction will be lifted in
@@ -1929,7 +1931,7 @@
Using the nodesorder='canonical',
-)[source]¶
+)[source]¶
Return a new code block with common subexpressions eliminated.
Explanation
See the docstring of sympy.simplify.cse_main.cse()
for more
@@ -1959,7 +1961,7 @@
Using the nodes
-
-classmethod topological_sort(assignments)[source]¶
+classmethod topological_sort(assignments)[source]¶
Return a CodeBlock with topologically sorted assignments so that
variables are assigned before they are used.
Examples
@@ -1991,19 +1993,19 @@ Using the nodes
-
-class sympy.codegen.ast.Comment(*args, **kwargs)[source]¶
+class sympy.codegen.ast.Comment(*args, **kwargs)[source]¶
Represents a comment.
-
-class sympy.codegen.ast.ComplexType(*args, **kwargs)[source]¶
+class sympy.codegen.ast.ComplexType(*args, **kwargs)[source]¶
Represents a complex floating point number.
-
-class sympy.codegen.ast.ContinueToken(*args, **kwargs)[source]¶
+class sympy.codegen.ast.ContinueToken(*args, **kwargs)[source]¶
Represents ‘continue’ in C/Python (‘cycle’ in Fortran)
Use the premade instance continue_
or instantiate manually.
Examples
@@ -2019,7 +2021,7 @@ Using the nodes
-
-class sympy.codegen.ast.Declaration(*args, **kwargs)[source]¶
+class sympy.codegen.ast.Declaration(*args, **kwargs)[source]¶
Represents a variable declaration
- Parameters:
@@ -2044,7 +2046,7 @@ Using the nodes
-
-class sympy.codegen.ast.Element(*args, **kwargs)[source]¶
+class sympy.codegen.ast.Element(*args, **kwargs)[source]¶
Element in (a possibly N-dimensional) array.
Examples
>>> from sympy.codegen.ast import Element
@@ -2064,11 +2066,11 @@ Using the nodes
-
-class sympy.codegen.ast.FloatBaseType(*args, **kwargs)[source]¶
+class sympy.codegen.ast.FloatBaseType(*args, **kwargs)[source]¶
Represents a floating point number type.
@@ -2076,7 +2078,7 @@ Using the nodes
-
-class sympy.codegen.ast.FloatType(*args, **kwargs)[source]¶
+class sympy.codegen.ast.FloatType(*args, **kwargs)[source]¶
Represents a floating point type with fixed bit width.
Base 2 & one sign bit is assumed.
@@ -2123,7 +2125,7 @@ Using the nodes
-
-cast_nocheck(value)[source]¶
+cast_nocheck(value)[source]¶
Casts without checking if out of bounds or subnormal.
@@ -2180,7 +2182,7 @@ Using the nodes
-
-class sympy.codegen.ast.For(*args, **kwargs)[source]¶
+class sympy.codegen.ast.For(*args, **kwargs)[source]¶
Represents a ‘for-loop’ in the code.
@@ -2232,7 +2234,7 @@ Using the nodes
-
-class sympy.codegen.ast.FunctionCall(*args, **kwargs)[source]¶
+class sympy.codegen.ast.FunctionCall(*args, **kwargs)[source]¶
Represents a call to a function in the code.
- Parameters:
@@ -2252,7 +2254,7 @@ Using the nodes
-
-class sympy.codegen.ast.FunctionDefinition(*args, **kwargs)[source]¶
+class sympy.codegen.ast.FunctionDefinition(*args, **kwargs)[source]¶
Represents a function definition in the code.
- Parameters:
@@ -2283,7 +2285,7 @@ Using the nodes
-
-class sympy.codegen.ast.FunctionPrototype(*args, **kwargs)[source]¶
+class sympy.codegen.ast.FunctionPrototype(*args, **kwargs)[source]¶
Represents a function prototype
Allows the user to generate forward declaration in e.g. C/C++.
@@ -2307,13 +2309,13 @@ Using the nodes
-
-class sympy.codegen.ast.IntBaseType(*args, **kwargs)[source]¶
+class sympy.codegen.ast.IntBaseType(*args, **kwargs)[source]¶
Integer base type, contains no size information.
-
-class sympy.codegen.ast.Node(*args, **kwargs)[source]¶
+class sympy.codegen.ast.Node(*args, **kwargs)[source]¶
Subclass of Token, carrying the attribute ‘attrs’ (Tuple)
Examples
>>> from sympy.codegen.ast import Node, value_const, pointer_const
@@ -2332,7 +2334,7 @@ Using the nodes
-
-attr_params(looking_for)[source]¶
+attr_params(looking_for)[source]¶
Returns the parameters of the Attribute with name looking_for
in self.attrs
@@ -2340,7 +2342,7 @@ Using the nodes
-
-class sympy.codegen.ast.NoneToken(*args, **kwargs)[source]¶
+class sympy.codegen.ast.NoneToken(*args, **kwargs)[source]¶
The AST equivalence of Python’s NoneType
The corresponding instance of Python’s None
is none
.
Examples
@@ -2354,7 +2356,7 @@ Using the nodes
-
-class sympy.codegen.ast.Pointer(*args, **kwargs)[source]¶
+class sympy.codegen.ast.Pointer(*args, **kwargs)[source]¶
Represents a pointer. See Variable
.
Examples
Can create instances of Element
:
@@ -2370,7 +2372,7 @@ Using the nodes
-
-class sympy.codegen.ast.Print(*args, **kwargs)[source]¶
+class sympy.codegen.ast.Print(*args, **kwargs)[source]¶
Represents print command in the code.
- Parameters:
@@ -2389,19 +2391,19 @@ Using the nodes
-
-class sympy.codegen.ast.QuotedString(*args, **kwargs)[source]¶
+class sympy.codegen.ast.QuotedString(*args, **kwargs)[source]¶
Represents a string which should be printed with quotes.
-
-class sympy.codegen.ast.Raise(*args, **kwargs)[source]¶
+class sympy.codegen.ast.Raise(*args, **kwargs)[source]¶
Prints as ‘raise …’ in Python, ‘throw …’ in C++
-
-class sympy.codegen.ast.Return(*args, **kwargs)[source]¶
+class sympy.codegen.ast.Return(*args, **kwargs)[source]¶
Represents a return command in the code.
- Parameters:
@@ -2421,14 +2423,14 @@ Using the nodes
-
-class sympy.codegen.ast.RuntimeError_(*args, **kwargs)[source]¶
+class sympy.codegen.ast.RuntimeError_(*args, **kwargs)[source]¶
Represents ‘std::runtime_error’ in C++ and ‘RuntimeError’ in Python.
Note that the latter is uncommon, and you might want to use e.g. ValueError.
-
-class sympy.codegen.ast.Scope(*args, **kwargs)[source]¶
+class sympy.codegen.ast.Scope(*args, **kwargs)[source]¶
Represents a scope in the code.
- Parameters:
@@ -2442,13 +2444,13 @@ Using the nodes
-
-class sympy.codegen.ast.SignedIntType(*args, **kwargs)[source]¶
+class sympy.codegen.ast.SignedIntType(*args, **kwargs)[source]¶
Represents a signed integer type.
-
-class sympy.codegen.ast.Stream(*args, **kwargs)[source]¶
+class sympy.codegen.ast.Stream(*args, **kwargs)[source]¶
Represents a stream.
There are two predefined Stream instances stdout
& stderr
.
@@ -2470,7 +2472,7 @@ Using the nodes
-
-class sympy.codegen.ast.String(*args, **kwargs)[source]¶
+class sympy.codegen.ast.String(*args, **kwargs)[source]¶
SymPy object representing a string.
Atomic object which is not an expression (as opposed to Symbol).
@@ -2495,7 +2497,7 @@ Using the nodes
-
-class sympy.codegen.ast.Token(*args, **kwargs)[source]¶
+class sympy.codegen.ast.Token(*args, **kwargs)[source]¶
Base class for the AST types.
Explanation
Defining fields are set in _fields
. Attributes (defined in _fields)
@@ -2509,7 +2511,7 @@
Using the nodesnot_in_args are not passed to Basic
.
-
-kwargs(exclude=(), apply=None)[source]¶
+kwargs(exclude=(), apply=None)[source]¶
Get instance’s attributes as dict of keyword arguments.
- Parameters:
@@ -2529,7 +2531,7 @@ Using the nodes
-
-class sympy.codegen.ast.Type(*args, **kwargs)[source]¶
+class sympy.codegen.ast.Type(*args, **kwargs)[source]¶
Represents a type.
- Parameters:
@@ -2593,7 +2595,7 @@ Using the nodesprecision_targets=None,
-)[source]¶
+)[source]¶
Casts a value to the data type of the instance.
- Parameters:
@@ -2647,7 +2649,7 @@ Using the nodes
-
-classmethod from_expr(expr)[source]¶
+classmethod from_expr(expr)[source]¶
Deduces type from an expression or a Symbol
.
- Parameters:
@@ -2679,13 +2681,13 @@ Using the nodes
-
-class sympy.codegen.ast.UnsignedIntType(*args, **kwargs)[source]¶
+class sympy.codegen.ast.UnsignedIntType(*args, **kwargs)[source]¶
Represents an unsigned integer type.
-
-class sympy.codegen.ast.Variable(*args, **kwargs)[source]¶
+class sympy.codegen.ast.Variable(*args, **kwargs)[source]¶
Represents a variable.
- Parameters:
@@ -2737,7 +2739,7 @@ Using the nodes
-
-as_Declaration(**kwargs)[source]¶
+as_Declaration(**kwargs)[source]¶
Convenience method for creating a Declaration instance.
Explanation
If the variable of the Declaration need to wrap a modified
@@ -2772,7 +2774,7 @@
Using the nodescast_check=True,
-)[source]¶
+)[source]¶
Alt. constructor with type deduction from Type.from_expr
.
Deduces type primarily from symbol
, secondarily from value
.
@@ -2810,7 +2812,7 @@ Using the nodes
-
-class sympy.codegen.ast.While(*args, **kwargs)[source]¶
+class sympy.codegen.ast.While(*args, **kwargs)[source]¶
Represents a ‘for-loop’ in the code.
- Expressions are of the form:
@@ -2843,7 +2845,7 @@ Using the nodes
-
-sympy.codegen.ast.aug_assign(lhs, op, rhs)[source]¶
+sympy.codegen.ast.aug_assign(lhs, op, rhs)[source]¶
Create ‘lhs op= rhs’.
- Parameters:
@@ -2890,7 +2892,7 @@ Using the nodes
-
-class sympy.codegen.cfunctions.Cbrt(*args)[source]¶
+class sympy.codegen.cfunctions.Cbrt(*args)[source]¶
Represents the cube root function.
Explanation
The reason why one would use Cbrt(x)
over cbrt(x)
@@ -2911,7 +2913,7 @@
Using the nodes
-
-fdiff(argindex=1)[source]¶
+fdiff(argindex=1)[source]¶
Returns the first derivative of this function.
@@ -2919,7 +2921,7 @@ Using the nodes
-
-class sympy.codegen.cfunctions.Sqrt(*args)[source]¶
+class sympy.codegen.cfunctions.Sqrt(*args)[source]¶
Represents the square root function.
Explanation
The reason why one would use Sqrt(x)
over sqrt(x)
@@ -2940,7 +2942,7 @@
Using the nodes
-
-fdiff(argindex=1)[source]¶
+fdiff(argindex=1)[source]¶
Returns the first derivative of this function.
@@ -2948,7 +2950,7 @@ Using the nodes
-
-class sympy.codegen.cfunctions.exp2(arg)[source]¶
+class sympy.codegen.cfunctions.exp2(arg)[source]¶
Represents the exponential function with base two.
Explanation
The benefit of using exp2(x)
over 2**x
@@ -2969,7 +2971,7 @@
Using the nodes
-
-fdiff(argindex=1)[source]¶
+fdiff(argindex=1)[source]¶
Returns the first derivative of this function.
@@ -2977,7 +2979,7 @@ Using the nodes
-
-class sympy.codegen.cfunctions.expm1(arg)[source]¶
+class sympy.codegen.cfunctions.expm1(arg)[source]¶
Represents the exponential function minus one.
Explanation
The benefit of using expm1(x)
over exp(x) - 1
@@ -3001,7 +3003,7 @@
Using the nodes
-
-fdiff(argindex=1)[source]¶
+fdiff(argindex=1)[source]¶
Returns the first derivative of this function.
@@ -3009,7 +3011,7 @@ Using the nodes
-
-class sympy.codegen.cfunctions.fma(*args)[source]¶
+class sympy.codegen.cfunctions.fma(*args)[source]¶
Represents “fused multiply add”.
Explanation
The benefit of using fma(x, y, z)
over x*y + z
@@ -3024,7 +3026,7 @@
Using the nodes
-
-fdiff(argindex=1)[source]¶
+fdiff(argindex=1)[source]¶
Returns the first derivative of this function.
@@ -3032,7 +3034,7 @@ Using the nodes
-
-class sympy.codegen.cfunctions.hypot(*args)[source]¶
+class sympy.codegen.cfunctions.hypot(*args)[source]¶
Represents the hypotenuse function.
Explanation
The hypotenuse function is provided by e.g. the math library
@@ -3051,7 +3053,7 @@
Using the nodes
-
-fdiff(argindex=1)[source]¶
+fdiff(argindex=1)[source]¶
Returns the first derivative of this function.
@@ -3059,7 +3061,7 @@ Using the nodes
-
-class sympy.codegen.cfunctions.log10(arg)[source]¶
+class sympy.codegen.cfunctions.log10(arg)[source]¶
Represents the logarithm function with base ten.
Examples
>>> from sympy.abc import x
@@ -3076,7 +3078,7 @@ Using the nodes
-
-fdiff(argindex=1)[source]¶
+fdiff(argindex=1)[source]¶
Returns the first derivative of this function.
@@ -3084,7 +3086,7 @@ Using the nodes
-
-class sympy.codegen.cfunctions.log1p(arg)[source]¶
+class sympy.codegen.cfunctions.log1p(arg)[source]¶
Represents the natural logarithm of a number plus one.
Explanation
The benefit of using log1p(x)
over log(x + 1)
@@ -3109,7 +3111,7 @@
Using the nodes
-
-fdiff(argindex=1)[source]¶
+fdiff(argindex=1)[source]¶
Returns the first derivative of this function.
@@ -3117,7 +3119,7 @@ Using the nodes
-
-class sympy.codegen.cfunctions.log2(arg)[source]¶
+class sympy.codegen.cfunctions.log2(arg)[source]¶
Represents the logarithm function with base two.
Explanation
The benefit of using log2(x)
over log(x)/log(2)
@@ -3138,7 +3140,7 @@
Using the nodes
-
-fdiff(argindex=1)[source]¶
+fdiff(argindex=1)[source]¶
Returns the first derivative of this function.
@@ -3150,13 +3152,13 @@ Using the nodes
-
-class sympy.codegen.cnodes.CommaOperator(*args)[source]¶
+class sympy.codegen.cnodes.CommaOperator(*args)[source]¶
Represents the comma operator in C
-
-class sympy.codegen.cnodes.Label(*args, **kwargs)[source]¶
+class sympy.codegen.cnodes.Label(*args, **kwargs)[source]¶
Label for use with e.g. goto statement.
Examples
>>> from sympy import ccode, Symbol
@@ -3172,7 +3174,7 @@ Using the nodes
-
-class sympy.codegen.cnodes.PostDecrement(*args)[source]¶
+class sympy.codegen.cnodes.PostDecrement(*args)[source]¶
Represents the post-decrement operator
Examples
>>> from sympy.abc import x
@@ -3186,7 +3188,7 @@ Using the nodes
-
-class sympy.codegen.cnodes.PostIncrement(*args)[source]¶
+class sympy.codegen.cnodes.PostIncrement(*args)[source]¶
Represents the post-increment operator
Examples