Richard Kreckel [Tue, 8 May 2001 20:42:51 +0000 (20:42 +0000)]
* All operators are now strictly following the semantics we all know from
C/C++. I.e. e1+e2=42; is now impossible and other such stuff. For all
remaining errors (i.e. ++e1 = e1+1;) the compiler alone is to blame...
Richard Kreckel [Sat, 5 May 2001 23:09:07 +0000 (23:09 +0000)]
Changes needed for compilation with -DDO_GINAC_ASSERT:
* basic.cpp: if needed, #include <typeinfo>,
* mul.h: mul::print() needed a default for 2nd arg.
Hey, Cebix, could you please have a look at the assertions of type
basis.return_type()==return_types::commutative in power.cpp ctors?
Watch out, though: they are not just bogus because of the rule
(x*y)^2 -> x^2*y^2 in power::eval().
Christian Bauer [Fri, 4 May 2001 23:55:36 +0000 (23:55 +0000)]
- symbols can have a LaTeX name, e.g. symbol s("s", "\\sigma");
- LaTeX output of indexed objects and tensors is much nicer
- simplify_indexed() can do arbitrary contractions in Dirac gamma strings
- constructing expressions like
(x * dirac_ONE() + dirac_ONE()) * dirac_gamma(mu)
resulted in an exception because mul::simplify_ncmul() wasn't implemented
(maybe afrink didn't anticipate that an implementation would really be
needed...)
Richard Kreckel [Thu, 3 May 2001 23:50:48 +0000 (23:50 +0000)]
* Fix incompatibilities with recent versions of libreadline by having
configure find out the version and then doing ugly things with #ifdef.
* config.*: updates from upstream.
Christian Bauer [Thu, 26 Apr 2001 19:36:07 +0000 (19:36 +0000)]
- dirac_trace() handles arbitrary expressions (even unexpanded), including
gamma5
- implemented color_trace()
- eps0123() creates a 4-dimensional epsilon tensor without checking the
indices (so they may be D-dimensional); this may become a different class
soon, but for now all the implemented properties of the standard epsilon
tensor also apply to eps0123
Christian Bauer [Fri, 20 Apr 2001 23:09:09 +0000 (23:09 +0000)]
- degree(), ldegree(), coeff(), lcoeff(), tcoeff() and collect() work with
non-symbols as the second argument
- collect_distributed() produces result in distributed form (second argument
should be a list of symbols)
Christian Bauer [Fri, 20 Apr 2001 23:06:55 +0000 (23:06 +0000)]
- color/clifford objects have representation label to distinguish elements
of different algebras; objects with different labels commute with each
other
- dirac_one() -> dirac_ONE()
- added gamma5 clifford objects which is constructed by dirac_gamma5()
- clifford::simplify_ncmul() anticommutes gamma5's to the front and removes
squares of gamma5
- the argument to collect() can be a list of objects in which case the
result is either a recursively collected polynomial, or a polynomial in
a distributed form with terms like coeff*x1^e1*...*xn^en, as specified by
the second argument to collect(). For example (ginsh):
> f=a*x-x+a*x*y+x*y+a*x*y^2-2*x*y^2+y^2;
a*x+y*a*x+y^2*a*x+y^2-x+y*x-2*y^2*x
> collect(f,x);
(-1+y+y^2*a+y*a+a-2*y^2)*x+y^2
> collect(f,y);
a*x-x+y^2*(1+a*x-2*x)+y*(a*x+x)
> collect(f,[x,y]);
(-1+y*(1+a)+y^2*(-2+a)+a)*x+y^2
> collect(f,[y,x]);
(-1+a)*x+y*(1+a)*x+(1+(-2+a)*x)*y^2
> collect_distributed(f,[x,y]);
(-1+a)*x+y^2*(-2+a)*x+y*(1+a)*x+y^2
Richard Kreckel [Wed, 18 Apr 2001 19:30:21 +0000 (19:30 +0000)]
* color.cpp: remove duplicated default args.
* numeric.cpp: insert some missing cln:: namespace decls.
Why did this ever work?
* structure.cpp, structure.h: adjust to the new print scheme.
Richard Kreckel [Sun, 15 Apr 2001 00:28:18 +0000 (00:28 +0000)]
* basic::collec() never worked correctly on non-polynomials till now.
We simply correct for the missing terms, which makes it at least
algebraically correct (suggested by Pearu Peterson).
* Added support to print out LaTeX-style, based on some work by Stefan
Weinzierl:
- print.h: added a class print_latex().
- function.pl: added function_options::latex_name() because there was
no good way of setting that name before.
- inifncs*.cpp: use it.
- *.cpp: switch to see if print_context is actually print_latex and
then change the style.
* Fixed some stupid bugs in sections that were #define'd away for gcc-2.95.
Christian Bauer [Mon, 9 Apr 2001 21:33:17 +0000 (21:33 +0000)]
- updated to reflect the extended possibilities of subs(), (l)degree(),
(l/t)coeff() and collect()
- added examples for specialized expression output by tree-traversal and
with the aid of archives
Christian Bauer [Fri, 6 Apr 2001 23:02:58 +0000 (23:02 +0000)]
- replaced the various print*() member functions by a single print() that
takes a print_context object that determines the output formatting; this
should make it easier to add more output types
- print_tree output of indexed objects looks better
Christian Bauer [Thu, 5 Apr 2001 21:02:26 +0000 (21:02 +0000)]
subs() performs "syntactic substitution" as in Maple; you can substitute
any object by any other object (even numerics) but only when the object
subs() is called on exactly matches an object on the left-hand side of the
substitution list; expairseq still doesn't substitute its numeric coefficients
so substituting numerics will not replace them in all occurences (this
shouldn't matter, though)
Christian Bauer [Thu, 5 Apr 2001 19:45:05 +0000 (19:45 +0000)]
- subs() can be used to substitute functions, tensors and indexed objects
- op(0) of an idx object returns the index value; a nice side-effect of
this is that idx'es no longer all have the same hash value
- added checks for clifford class
Christian Bauer [Thu, 5 Apr 2001 19:44:47 +0000 (19:44 +0000)]
- subs() can be used to substitute functions, tensors and indexed objects
- op(0) of an idx object returns the index value; a nice side-effect of
this is that idx'es no longer all have the same hash value
Christian Bauer [Thu, 5 Apr 2001 00:16:02 +0000 (00:16 +0000)]
simplify_indexed() will re-expand the expression and re-run the
simplification if a contraction in a product resulted in a factor that
is a sum or a product itself; so e.g. gamma~mu*gamma~nu*gamma.nu*gamma.mu
will return dim^2*ONE without having to run simplify_indexed() twice
Christian Bauer [Mon, 2 Apr 2001 20:57:32 +0000 (20:57 +0000)]
degree(), ldegree(), coeff(), lcoeff(), tcoeff() and collect() can now
be used with constants and indexed expressions as well, so you can use
it to collect by powers of Pi or find the coefficient of gamma~0.
Limitations:
- it only works with symbols, constants and indexed expressions;
trying to find the coefficient of, e.g., "x^2" or "x+y" won't work
- it does not know about dummy index summations; the coefficient of
gamma~0 in p.mu*gamma~mu should be p.0 but is returned as 0
- using the functions on elements of noncommutative products might
return wrong or surprising results
Christian Bauer [Fri, 30 Mar 2001 18:14:32 +0000 (18:14 +0000)]
- added Clifford contractions:
gamma~mu*gamma~alpha*gamma~beta*gamma.mu
gamma~mu*gamma~alpha*gamma~beta*gamma~delta*gamma.mu
- detection of free indices of the complete product in
simplify_indexed_product() could go wrong if contractions resulted in
composite expressions
Christian Bauer [Fri, 30 Mar 2001 17:34:35 +0000 (17:34 +0000)]
- dummy index recognition in products was flawed: A.i.i*B.j.j would be
treated as a scalar product of A and B, A.j.j.i.i*B.k.l would be 0
if A was symmetric and B antisymmetric etc.
- removed redundant code for handling d.akl*f.akl contraction; this is
handled by simplify_indexed() itself since it is a contraction of a
symmetric with an antisymmetric tensor
Christian Bauer [Thu, 29 Mar 2001 20:56:32 +0000 (20:56 +0000)]
- added Clifford algebra unity element
- superfluous unity elements are removed from Clifford and color strings
- added Clifford contractions:
gamma~mu*gamma.mu
gamma~mu*gamma~alpha*gamma.mu
- added color contractions:
d.aac
d.abc*d.abc
d.akl*d.bkl
d.abc*f.abc
d.akl*f.bkl
f.abc*f.abc
f.akl*f.bkl
- delta tensor and color structure constants can be evaluated numerically
- color_T(), color_d() and color_f() check their arguments
- added a couple of utility functions to idx.*
- simplify_indexed() doesn't crash any more when used on expressions containing
noncommutative products
Christian Bauer [Wed, 28 Mar 2001 00:36:37 +0000 (00:36 +0000)]
- added skeleton implementation of color and clifford classes (don't bother
trying it, it doesn't work yet)
- some macros in utils.h (DEFAULT_*) provide shorthands for implementing
many required class member functions
Christian Bauer [Fri, 23 Mar 2001 17:49:54 +0000 (17:49 +0000)]
- simplify_indexed() simplifies c*(M).i.j -> (M').i.j (c: numeric, M: matrix)
with M'=c*M
- new member function matrix::mul(const numeric &other) to multiply matrix
with scalar
- lst_to_matrix() takes a "lst &" instead of an "ex &"
- added constructor of matrix from flat list
- added function diag_matrix() to construct matrix from list of diagonal
elements
Richard Kreckel [Thu, 22 Mar 2001 21:24:32 +0000 (21:24 +0000)]
* Eliminated overloaded operator% for noncommunistic objects for good.
End of story. There was just too much risk involved in somebody not
caring enough whether there are noncommutatating objects inside
expressions to be multiplied and it could potentially end up in people
using operator% instead of operator* all the time, just to be safe.
In any case, it was our firm believe that noncommutatividity is a
property of the class objects belong to and hence of the objects and
not at all of the sign to symbol the object (as Maple, Reduce and others
want to make us believe). Finally we found out how to code operator*
so that it handles both cases without any performance loss. It couldn't
be less intrusive! There is no measurable performance degradation.
(Except perhaps for the tgamma-expansion which seems to show some 3%
loss while others mysteriously become somewhat faster -- my brain is
melting.) Enough, now...
Richard Kreckel [Thu, 22 Mar 2001 20:09:25 +0000 (20:09 +0000)]
* configure.in, cint/run_exams.cpp, cint/ginaccint.cpp: adjusted the
--with-cint logic so ginaccint may run without a preset $CINTSYSDIR
(in case of a clean system-wide installation as opposed to the tool-
centric installation). cint/Makefile.makecint generation does not
yet work in this case, makecint needs a tiny upstream bugfix.
Richard Kreckel [Thu, 22 Mar 2001 20:09:22 +0000 (20:09 +0000)]
* INSTALL: reflect Cint status.
* configure.in, cint/run_exams.cpp, cint/ginaccint.cpp: adjusted the
--with-cint logic so ginaccint may run without a preset $CINTSYSDIR
(in case of a clean system-wide installation as opposed to the tool-
centric installation). cint/Makefile.makecint generation does not
yet work in this case, makecint needs a tiny upstream bugfix.