]> www.ginac.de Git - ginac.git/blobdiff - doc/tutorial/ginac.texi
Bug in expand_dummy_sum is fixed.
[ginac.git] / doc / tutorial / ginac.texi
index 8c7f993e522f09b40e41e257fd9c801fba24e917..9f2abc1c86cb4f12a2125ae3714eb25e79f98358 100644 (file)
@@ -1155,11 +1155,17 @@ in the complex domain.  As a consequence, operations like complex conjugation,
 for example (@pxref{Complex expressions}), do @emph{not} evaluate if applied
 to such symbols. Likewise @code{log(exp(x))} does not evaluate to @code{x},
 because of the unknown imaginary part of @code{x}.
-On the other hand, if you are sure that your symbols will hold only real values, you
-would like to have such functions evaluated. Therefore GiNaC allows you to specify
+On the other hand, if you are sure that your symbols will hold only real
+values, you would like to have such functions evaluated. Therefore GiNaC
+allows you to specify
 the domain of the symbol. Instead of @code{symbol x("x");} you can write
 @code{realsymbol x("x");} to tell GiNaC that @code{x} stands in for real values.
 
+@cindex @code{possymbol()}
+Furthermore, it is also possible to declare a symbol as positive. This will,
+for instance, enable the automatic simplification of @code{abs(x)} into 
+@code{x}. This is done by declaying the symbol as @code{possymbol x("x");}.
+
 
 @node Numbers, Constants, Symbols, Basic concepts
 @c    node-name, next, previous, up
@@ -2053,6 +2059,12 @@ Here are a couple of examples for constructing matrices:
 @}
 @end example
 
+@cindex @code{is_zero_matrix()} 
+The method @code{matrix::is_zero_matrix()} returns @code{true} only if
+all entries of the matrix are zeros. There is also method
+@code{ex::is_zero_matrix()} which returns @code{true} only if the
+expression is zero or a zero matrix.
+
 @cindex @code{transpose()}
 There are three ways to do arithmetic with matrices. The first (and most
 direct one) is to use the methods provided by the @code{matrix} class:
@@ -2717,11 +2729,7 @@ arithmetic class, you just pass it to @code{simplify_indexed()}):
 The @code{scalar_products} object @code{sp} acts as a storage for the
 scalar products added to it with the @code{.add()} method. This method
 takes three arguments: the two expressions of which the scalar product is
-taken, and the expression to replace it with. After @code{sp.add(A, B, 0)},
-@code{simplify_indexed()} will replace all scalar products of indexed
-objects that have the symbols @code{A} and @code{B} as base expressions
-with the single value 0. The number, type and dimension of the indices
-don't matter; @samp{A~mu~nu*B.mu.nu} would also be replaced by 0.
+taken, and the expression to replace it with.
 
 @cindex @code{expand()}
 The example above also illustrates a feature of the @code{expand()} method:
@@ -3301,7 +3309,11 @@ generators, an index @code{mu} with a numeric value may be of type
 @code{idx} as well.
 Parameter @code{metr} defines the metric @math{M(i, j)} and can be
 represented by a square @code{matrix}, @code{tensormetric} or @code{indexed} class
-object. Optional parameter @code{rl} allows to distinguish different
+object. In fact, any expression either with two free indices or without
+indices at all is admitted as @code{metr}. In the later case an @code{indexed}
+object with two newly created indices with @code{metr} as its
+@code{op(0)} will be used.
+Optional parameter @code{rl} allows to distinguish different
 Clifford algebras, which will commute with each other. The last
 optional parameter @code{anticommuting} defines if the anticommuting
 assumption (i.e.
@@ -3545,9 +3557,10 @@ linear-fractional) transformation @samp{v -> (av+b)/(cv+d)} defined by
 the matrix @samp{M = [[a, b], [c, d]]}. The parameter @code{G} defines
 the metric of the surrounding (pseudo-)Euclidean space. This can be an
 indexed object, tensormetric, matrix or a Clifford unit, in the later
-case the optional parameters @code{rl} and @code{anticommuting} are ignored
-even if supplied.  The returned value of this function is a list of
-components of the resulting vector.
+case the optional parameters @code{rl} and @code{anticommuting} are
+ignored even if supplied.  Depending from the type of @code{v} the
+returned value of this function is either a vector or a list holding vector's
+components.
 
 @cindex @code{clifford_max_label()}
 Finally the function
@@ -4097,7 +4110,8 @@ bool ex::is_zero();
 @end example
 
 for checking whether one expression is equal to another, or equal to zero,
-respectively.
+respectively. See also the method @code{ex::is_zero_matrix()}, 
+@pxref{Matrices}. 
 
 
 @subsection Ordering expressions