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.
Richard Kreckel [Sun, 11 Mar 2001 19:10:03 +0000 (19:10 +0000)]
normal.cpp, normal.h: Fix Yun's algorithm (there was a mistake in Geddes et
al.) for square-free factorization. Also change the syntax to allow for
square-free factoring in a recursive way in Q[X]. This is an example how it
works in Z[x,y,z] in ginsh:
> ?sqrfree
sqrfree(expression [, symbol-list]) - square-free factorization of a polynomial
> sqrfree(expand((x+y)*(x+y+z)^2*(y-z)^3));
(x+y)*(-x-y-z)^2*(y^3+3*y*z^2-3*y^2*z-z^3)
> sqrfree(expand((x+y)*(x+y+z)^2*(y-z)^3),[y]);
(x+y)*(y-z)^3*(x+y+z)^2
> sqrfree(expand((x+y)*(x+y+z)^2*(y-z)^3),[z]);
(x+y)*(y-z)^3*(x+y+z)^2
> sqrfree(expand((x+y)*(x+y+z)^2*(y-z)^3),[x]);
(x+y)*(-x-y-z)^2*(y^3+3*y*z^2-3*y^2*z-z^3)
> sqrfree(expand((x+y)*(x+y+z)^2*(y-z)^3),[x,y]);
(x+y)*(-x-y-z)^2*(y^3+3*y*z^2-3*y^2*z-z^3)
> sqrfree(expand((x+y)*(x+y+z)^2*(y-z)^3),[x,y,z]);
(x+y)*(-x-y-z)^2*(y^3+3*y*z^2-3*y^2*z-z^3)
> sqrfree(expand((x+y)*(x+y+z)^2*(y-z)^3),[v]);
3*x*y^5+3*x^2*y^4+x^3*y^3+y^6-y*z^5-2*y^4*z^2+y^2*z^4-y^5*z+2*y^3*z^3-3*x^3*y^2*z+3*x^3*y*z^2-5*x*y^4*z-x*y*z^4+3*x^2*y*z^3+6*x*y^2*z^3+3*x^2*y^2*z^2-2*x*y^3*z^2-7*x^2*y^3*z-x^3*z^3-2*x^2*z^4-x*z^5
Christian Bauer [Fri, 9 Mar 2001 22:21:35 +0000 (22:21 +0000)]
- lcm_of_coefficients_denominators(1/2+x^10) returned 1024 instead of 2 and
multiply_lcm() on that expression barfed
- contract_with() now takes two exvector::iterators and and exvector; this
makes it possible to look for more contractions in the implementation
Richard Kreckel [Wed, 28 Feb 2001 15:54:52 +0000 (15:54 +0000)]
* ginac/registrar.h: dtor is inlined now.
* ginac/basic.h, ginac/ex.h: removed INLINE_FOO_CONSTRUCTORS and hand-inlined
stuff instead, since the macros turned out to get in the way while
fine-tuning the inlining.
* ginac/utils.h: if 'long long' works, use that one for computing the hash
value instead of floating point tricks. 2 Reasons: on Intel the assembler
is terrible and slow otherwise, 'long long' will appear in C++ anyways when
they adapt to the C99 standard.
* Several other small performance tweaks.
* ginac/constant.cpp: (constant::calchash()) implement, caring for serial.
* ginac/function.pl (function::calchash()): implement, caring for serial.
* ginac/expairseq.cpp: honor coeff's hash value.
* ginac/pseries.cpp: (pseries::power_const()) fix problems with zero pseries.
* Added several pounds of in-source documentation in doxygen style.
Richard Kreckel [Wed, 28 Feb 2001 15:53:26 +0000 (15:53 +0000)]
* some longish timings are now disabled by default.
* check/time_lw_M2.cpp: new timing (defaults to disabled)
* check/time_lw_N.cpp: new timing (defaults to disabled)
Christian Bauer [Tue, 27 Feb 2001 19:54:38 +0000 (19:54 +0000)]
when there are multiple variables with the same maximum degree, the one with
the least number of terms in the leading coefficient is chosen as the main
variable in GCD computations
Christian Bauer [Thu, 15 Feb 2001 22:54:52 +0000 (22:54 +0000)]
the destructor, copy constructor, and assignment operator (which were the
same for all subclasses of basic, with very few exceptions) are now included
in the GINAC_IMPLEMENT_REGISTERED_CLASS macro; the GINAC_DECLARE_REGISTERED_CLASS
macro also defines these (and other common) member functions
Christian Bauer [Wed, 14 Feb 2001 00:50:46 +0000 (00:50 +0000)]
- added documentation to the indexed, color, lortensor and clifford classes
- moved Dim() function from lortensor.cpp to lorentzidx.cpp
- moved append_exvector_to_exvector() from color.cpp to utils.cpp
- some cleanups in the lortensor and clifford classes
Christian Bauer [Mon, 12 Feb 2001 20:54:53 +0000 (20:54 +0000)]
- added documentation for the idx, coloridx and lorentzidx classes
- idx_intersect() works correctly when indices appear multiple times
- g~mu_mu = D-2 (instead of D-dim(P))