From kreckel at ginac.de Sun Jun 5 00:19:51 2011 From: kreckel at ginac.de (Richard B. Kreckel) Date: Sun, 05 Jun 2011 00:19:51 +0200 Subject: [GiNaC-devel] indexes of clifford objects Message-ID: <4DEAAF87.9040806@ginac.de> Hi! When compiling GiNaC with -DDO_GINAC_ASSERT, exam_clifford.cpp fails the test suite because clifford.cpp:105, assertion `is_a(mu)' is violated. The function clifford_moebius_map constructs a clifford unit with an idx, not a varidx, if G is a matrix. The code in question was written by Vladimir in 2006. From a physicists point of view, I thought that it doesn't make sense to construct a clifford object with an idx instead of a varidx. But then, what's clifford_moebius_map doing? On the other hand, I also noticed that the tutorial does include examples of clifford objects with idx indices in section "A generic Clifford algebra". Strange. If someone with more insight could shed a light on this I could finish my recent quest to make GiNaC pass its test suite even when compiled with -DDO_GINAC_ASSERT. That would be great. Cheers -richy. -- Richard B. Kreckel From kisilv at maths.leeds.ac.uk Sun Jun 5 06:55:11 2011 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Sun, 05 Jun 2011 05:55:11 +0100 Subject: [GiNaC-devel] indexes of clifford objects In-Reply-To: <4DEAAF87.9040806@ginac.de> References: <4DEAAF87.9040806@ginac.de> Message-ID: <18991.1307249711@krein.leeds.ac.uk> Dear Richard, >>>>> On Sun, 05 Jun 2011 00:19:51 +0200, "Richard B. Kreckel" said: RK> From a physicists point of view, I thought that it doesn't make RK> sense to construct a clifford object with an idx instead of a RK> varidx. There are several mathematical frameworks leading to Clifford algebras. Most elementary one is a free algebra with n generators factorised by an ideal of the quadratic (anticommuting) relations. From that perspective generators of the Clifford algebra are not required to be even indexed objects at all. You may call them simply a, b, c,... as long as you able to make manipulations like ab=-ba, a^2=-1, etc. RK> If someone with more insight could shed a light on this I could RK> finish my recent quest to make GiNaC pass its test suite even RK> when compiled with -DDO_GINAC_ASSERT. That would be great. However, I do not see a practical obstacle to change the GiNaC code to permit varidx only as indices in the clifford class. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk -- www: http://www.maths.leeds.ac.uk/~kisilv/ From kreckel at ginac.de Mon Jun 6 08:24:16 2011 From: kreckel at ginac.de (Richard B. Kreckel) Date: Mon, 06 Jun 2011 08:24:16 +0200 Subject: [GiNaC-devel] indexes of clifford objects In-Reply-To: <18991.1307249711@krein.leeds.ac.uk> References: <4DEAAF87.9040806@ginac.de> <18991.1307249711@krein.leeds.ac.uk> Message-ID: <4DEC7290.6020302@ginac.de> Dear Vladimir, On 06/05/2011 06:55 AM, Vladimir V. Kisil wrote: >>>>>> On Sun, 05 Jun 2011 00:19:51 +0200, "Richard B. Kreckel" said: > RK> From a physicists point of view, I thought that it doesn't make > RK> sense to construct a clifford object with an idx instead of a > RK> varidx. > > There are several mathematical frameworks leading to Clifford > algebras. Most elementary one is a free algebra with n generators > factorised by an ideal of the quadratic (anticommuting) > relations. From that perspective generators of the Clifford algebra > are not required to be even indexed objects at all. You may call them > simply a, b, c,... as long as you able to make manipulations like ab=-ba, > a^2=-1, etc. Thanks for the concise reminder. > RK> If someone with more insight could shed a light on this I could > RK> finish my recent quest to make GiNaC pass its test suite even > RK> when compiled with -DDO_GINAC_ASSERT. That would be great. > > However, I do not see a practical obstacle to change the GiNaC code > to permit varidx only as indices in the clifford class. That, as opposed to making the clifford constructor accept both varidx and idx, would require changes to clifford_moebius_map and to the tutorial. Either way, can you recommend a patch? -richy. -- Richard B. Kreckel From kisilv at maths.leeds.ac.uk Fri Jun 10 22:17:14 2011 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Fri, 10 Jun 2011 21:17:14 +0100 Subject: [GiNaC-devel] indexes of clifford objects Message-ID: <27331.1307737034@krein.leeds.ac.uk> Dear Richard, >>>>> On Mon, 06 Jun 2011 08:24:16 +0200, "Richard B. Kreckel" < kreckel at ginac.de> said: RK> and to the tutorial. Either way, can you recommend a patch? I am attaching the patch, which admits only varidx as valid parameters. I Hope I did everything right. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk -- www: http://www.maths.leeds.ac.uk/~kisilv/ -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Clifford-class-now-admits-only-indices-with-a-varian.patch Type: text/x-c++ Size: 16823 bytes Desc: clifford patch URL: From alexei.sheplyakov at gmail.com Sat Jun 11 17:38:54 2011 From: alexei.sheplyakov at gmail.com (Alexei Sheplyakov) Date: Sat, 11 Jun 2011 15:38:54 +0000 Subject: [GiNaC-devel] indexes of clifford objects In-Reply-To: <18991.1307249711@krein.leeds.ac.uk> References: <4DEAAF87.9040806@ginac.de> <18991.1307249711@krein.leeds.ac.uk> Message-ID: <20110611153854.GA15592@vargsbox> Hello, On Sun, Jun 05, 2011 at 05:55:11AM +0100, Vladimir V. Kisil wrote: > RK> From a physicists point of view, I thought that it doesn't make > RK> sense to construct a clifford object with an idx instead of a > RK> varidx. > > There are several mathematical frameworks leading to Clifford > algebras. Most elementary one is a free algebra with n generators > factorised by an ideal of the quadratic (anticommuting) > relations. From that perspective generators of the Clifford algebra > are not required to be even indexed objects at all. You may call them > simply a, b, c,... as long as you able to make manipulations like ab=-ba, > a^2=-1, etc. > > RK> If someone with more insight could shed a light on this I could > RK> finish my recent quest to make GiNaC pass its test suite even > RK> when compiled with -DDO_GINAC_ASSERT. That would be great. > > However, I do not see a practical obstacle to change the GiNaC code > to permit varidx only as indices in the clifford class. I don't think this artificial restrictions is a good idea. Why don't we remove that bogus assertion instead? Best regards, Alexei From kisilv at maths.leeds.ac.uk Sat Jun 11 19:10:17 2011 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Sat, 11 Jun 2011 18:10:17 +0100 Subject: [GiNaC-devel] indexes of clifford objects In-Reply-To: <20110611153854.GA15592@vargsbox> References: <4DEAAF87.9040806@ginac.de> <18991.1307249711@krein.leeds.ac.uk> <20110611153854.GA15592@vargsbox> Message-ID: <6794.1307812217@krein.leeds.ac.uk> Dear Alexei, >>>>> On Sat, 11 Jun 2011 15:38:54 +0000, Alexei Sheplyakov said: ASh> I don't think this artificial restrictions is a good idea. Why ASh> don't we remove that bogus assertion instead? I do not qualify to participate in this discussion due to my limiting knowledge in software design. As a user I think that admitting idx make life easier, however I can survive if it will be restricted to varidx. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk -- www: http://www.maths.leeds.ac.uk/~kisilv/ From kreckel at ginac.de Sun Jun 12 00:01:49 2011 From: kreckel at ginac.de (Richard B. Kreckel) Date: Sun, 12 Jun 2011 00:01:49 +0200 Subject: [GiNaC-devel] indexes of clifford objects In-Reply-To: <6794.1307812217@krein.leeds.ac.uk> References: <4DEAAF87.9040806@ginac.de> <18991.1307249711@krein.leeds.ac.uk> <20110611153854.GA15592@vargsbox> <6794.1307812217@krein.leeds.ac.uk> Message-ID: <4DF3E5CD.1090703@ginac.de> On 06/11/2011 07:10 PM, Vladimir V. Kisil wrote: >>>>>> On Sat, 11 Jun 2011 15:38:54 +0000, Alexei Sheplyakov said: > ASh> I don't think this artificial restrictions is a good idea. Why > ASh> don't we remove that bogus assertion instead? > > I do not qualify to participate in this discussion due to my > limiting knowledge in software design. As a user I think that > admitting idx make life easier, however I can survive if it will be > restricted to varidx. Oh, in this case, I am sure this is not a question of software design! It depends on how useful a clifford with idx is in practice. You are saying that allowing idx makes life easier. Well, I think this settles it. -richy. -- Richard B. Kreckel From kisilv at maths.leeds.ac.uk Sun Jun 12 13:57:40 2011 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Sun, 12 Jun 2011 12:57:40 +0100 Subject: [GiNaC-devel] indexes of clifford objects In-Reply-To: <4DF3E5CD.1090703@ginac.de> References: <4DEAAF87.9040806@ginac.de> <18991.1307249711@krein.leeds.ac.uk> <20110611153854.GA15592@vargsbox> <6794.1307812217@krein.leeds.ac.uk> <4DF3E5CD.1090703@ginac.de> Message-ID: <15698.1307879860@krein.leeds.ac.uk> >>>>> On Sun, 12 Jun 2011 00:01:49 +0200, "Richard B. Kreckel" said: RK> It depends on how useful a clifford with idx is in practice. You RK> are saying that allowing idx makes life easier. Yes, in the simplistic approach to Clifford algebra there is no need to assign any covariance to indexes: they are simply labels to distinguish different generators. RK> Well, I think this settles it. OK, then you can discharge the previous patch. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk -- www: http://www.maths.leeds.ac.uk/~kisilv/ From kreckel at ginac.de Sun Jun 12 23:09:11 2011 From: kreckel at ginac.de (Richard B. Kreckel) Date: Sun, 12 Jun 2011 23:09:11 +0200 Subject: [GiNaC-devel] indexes of clifford objects In-Reply-To: <15698.1307879860@krein.leeds.ac.uk> References: <4DEAAF87.9040806@ginac.de> <18991.1307249711@krein.leeds.ac.uk> <20110611153854.GA15592@vargsbox> <6794.1307812217@krein.leeds.ac.uk> <4DF3E5CD.1090703@ginac.de> <15698.1307879860@krein.leeds.ac.uk> Message-ID: <4DF52AF7.70909@ginac.de> Hi! On 06/12/2011 01:57 PM, Vladimir V. Kisil wrote: > Yes, in the simplistic approach to Clifford algebra there is no need > to assign any covariance to indexes: they are simply labels to > distinguish different generators. Great! I've patched it. Thanks a lot. Sadly, it turns out that clifford_check6 triggers yet another assertion, this time in clifford.cpp:1249. There, ex_to(e.op(j)), however e.op(j) is actually a power object! It seems to have been introduced by b4631c1661b1, see . Any idea? -richy. -- Richard B. Kreckel From git at ginac.de Sun Jun 12 23:11:36 2011 From: git at ginac.de (Richard B. Kreckel) Date: Sun, 12 Jun 2011 23:11:36 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, master, updated. release_1-4-0-356-g77c2acd Message-ID: <20110612211136.C2FCDF00519@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, master has been updated via 77c2acd59e345fe7697304a865a8f41d43494129 (commit) from 761a6d99032dbbd82e8166036c17b498edfaa058 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 77c2acd59e345fe7697304a865a8f41d43494129 Author: Richard Kreckel Date: Sun Jun 12 23:10:07 2011 +0200 Relax assertion in clifford ctor. Class clifford can be constructed with an idx object, now, not just with a varidx. ----------------------------------------------------------------------- Summary of changes: ginac/clifford.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From kisilv at maths.leeds.ac.uk Mon Jun 20 23:09:51 2011 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Mon, 20 Jun 2011 22:09:51 +0100 Subject: [GiNaC-devel] indexes of clifford objects In-Reply-To: <4DF5E2CA.5050105@ginac.de> References: <4DEAAF87.9040806@ginac.de> <18991.1307249711@krein.leeds.ac.uk> <20110611153854.GA15592@vargsbox> <6794.1307812217@krein.leeds.ac.uk> <4DF3E5CD.1090703@ginac.de> <15698.1307879860@krein.leeds.ac.uk> <4DF52AF7.70909@ginac.de> <18865.1307916450@krein.leeds.ac.uk> <4DF5E2CA.5050105@ginac.de> Message-ID: <11426.1308604191@krein.leeds.ac.uk> Dear Richard, >>>>> On Sun, 12 Jun 2011 12:13:30 +0200, "Richard B. Kreckel" said: RK> Sadly, it turns out that clifford_check6 triggers yet another RK> assertion, this time in clifford.cpp:1249. I am attaching the patch. In two places a conversion to indexed shall be preceded by a corresponding check. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk -- www: http://www.maths.leeds.ac.uk/~kisilv/ -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Fix-two-careless-conversions-to-indexed-in-clifford..patch Type: text/x-c++ Size: 2671 bytes Desc: patch URL: From git at ginac.de Tue Jun 21 21:43:30 2011 From: git at ginac.de (Jens Vollinga) Date: Tue, 21 Jun 2011 21:43:30 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, master, updated. release_1-4-0-357-g7a7b485 Message-ID: <20110621194330.59777F0053B@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, master has been updated via 7a7b485ed57429bb21e7591f4a1b0454dd1f4aae (commit) from 77c2acd59e345fe7697304a865a8f41d43494129 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7a7b485ed57429bb21e7591f4a1b0454dd1f4aae Author: Jens Vollinga Date: Tue Jun 21 21:36:16 2011 +0200 Made yyerror() string argument constant to avoid an compile error with gcc 4.6. ----------------------------------------------------------------------- Summary of changes: ginsh/ginsh.h | 2 +- ginsh/ginsh_parser.yy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From git at ginac.de Thu Jun 23 16:28:12 2011 From: git at ginac.de (Richard B. Kreckel) Date: Thu, 23 Jun 2011 16:28:12 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, master, updated. release_1-4-0-358-g29b8244 Message-ID: <20110623142813.05331F004B7@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, master has been updated via 29b8244d6141ecb6f8d90480ade69af407270441 (commit) from 7a7b485ed57429bb21e7591f4a1b0454dd1f4aae (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 29b8244d6141ecb6f8d90480ade69af407270441 Author: Vladimir V. Kisil Date: Thu Jun 23 16:20:59 2011 +0200 Be more careful before converting to indexed. This patch makes GiNaC pass it's test suite when compiled with -DDO_GINAC_ASSERT. ----------------------------------------------------------------------- Summary of changes: check/exam_clifford.cpp | 3 ++- ginac/clifford.cpp | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From jlhsage at gmail.com Sun Jun 26 04:52:38 2011 From: jlhsage at gmail.com (J Sage) Date: Sat, 25 Jun 2011 19:52:38 -0700 Subject: [GiNaC-devel] series() errors with divide by zero Message-ID: Hi, There is an error in ginac when taking a series of a function at a singular point, for instance in ginsh, > series(sqrt(x),x,3); power::eval(): division by zero from ginac-1.6 file power.cpp line 408. I instrumented power.cpp with some printf functions and found the offending dispatch to be in line 665: coeff = deriv.subs(r, subs_options::no_pattern); while evaluating the third term in the expansion, presumably with a 1/x factor. I'm new to ginac so its taking me a while to learn the code -- next step is to try and get it running in gdb -- so I'd appreciate any input from the list about how ginac is handling and/or is supposed to handle this kind of error. Other software, like maxima, handles the problem fine: (%o6) maxima(sqrt(x), x, 0, 3) (%i7) taylor(sqrt(x),x,0,3); Thanks in advance, John * * -------------- next part -------------- An HTML attachment was scrubbed... URL: From kreckel at ginac.de Sun Jun 26 11:33:42 2011 From: kreckel at ginac.de (Richard B. Kreckel) Date: Sun, 26 Jun 2011 11:33:42 +0200 Subject: [GiNaC-devel] series() errors with divide by zero In-Reply-To: References: Message-ID: <4E06FCF6.6090105@ginac.de> Hi! On 06/26/2011 04:52 AM, J Sage wrote: > There is an error in ginac when taking a series of a function at > a singular point, for instance in ginsh, > > > series(sqrt(x),x,3); > power::eval(): division by zero > > from ginac-1.6 file power.cpp line 408. > > I instrumented power.cpp with some printf functions and found > the offending dispatch to be in line 665: > > coeff = deriv.subs(r, subs_options::no_pattern); > > while evaluating the third term in the expansion, presumably with > a 1/x factor. I'm new to ginac so its taking me a while to learn the > code -- next step is to try and get it running in gdb -- so I'd appreciate > any input from the list about how ginac is handling and/or is > supposed to handle this kind of error. Other software, like maxima, > handles the problem fine: > > (%o6) maxima(sqrt(x), x, 0, 3) > (%i7) taylor(sqrt(x),x,0,3); GiNaC can only compute Taylor and Laurent series. Your's is a Puiseux series: a series not in integer powers of x but in rational powers of x. The Puiseux expansion of sqrt(x) is, well, x^(1/2). You may try to set x=y^q and compute the Laurent expansion in y. Setting q=2 in your case would give the desired result: series(sqrt(x),x,0,3) = series(sqrt(y^2),y,0,3*2) = y = x^(1/2). Note that the member functions degree() and ldegree() currently return int, so this would have to be generalized somehow, when implementing Puiseux series directly in GiNaC. Bye -richy. -- Richard B. Kreckel From jlhsage at gmail.com Mon Jun 27 07:09:46 2011 From: jlhsage at gmail.com (J Sage) Date: Sun, 26 Jun 2011 22:09:46 -0700 Subject: [GiNaC-devel] series() errors with divide by zero In-Reply-To: <4E06FCF6.6090105@ginac.de> References: <4E06FCF6.6090105@ginac.de> Message-ID: ... > series(sqrt(x),x,0,3) > = series(sqrt(y^2),y,0,3*2) > = y > = x^(1/2). > > Note that the member functions degree() and ldegree() currently return int, > so this would have to be generalized somehow, when implementing Puiseux > series directly in GiNaC. > > Bye > -richy. > -- > Richard B. Kreckel > > Actually, ginac cannot do a series on x^n or on sqrt(x^2). Here's the ginsh output: > series(x^n,x,1); (0^n)+Order(x) > series(x^n,x,2); power::eval(): division by zero > series(sqrt(x^2),x,3); power::eval(): division by zero > John -------------- next part -------------- An HTML attachment was scrubbed... URL: From kreckel at ginac.de Mon Jun 27 08:27:59 2011 From: kreckel at ginac.de (Richard B. Kreckel) Date: Mon, 27 Jun 2011 08:27:59 +0200 Subject: [GiNaC-devel] series() errors with divide by zero In-Reply-To: References: <4E06FCF6.6090105@ginac.de> Message-ID: <4E0822EF.5020606@ginac.de> Hi! On 06/27/2011 07:09 AM, J Sage wrote: > ... > series(sqrt(x),x,0,3) > = series(sqrt(y^2),y,0,3*2) > = y > = x^(1/2). > > Note that the member functions degree() and ldegree() currently > return int, so this would have to be generalized somehow, when > implementing Puiseux series directly in GiNaC. > > Bye > -richy. > -- > Richard B. Kreckel > > > > > Actually, ginac cannot do a series on x^n or on sqrt(x^2). Here's the > ginsh output: > > > series(x^n,x,1); > (0^n)+Order(x) > > series(x^n,x,2); > power::eval(): division by zero > > series(sqrt(x^2),x,3); > power::eval(): division by zero Oh, you're so right! Actually, that's because the result of series(sqrt(x^2),x==0,3) is not necessarly x: it could just as well be -x. The presence of the branch point makes it more tricky. Sorry for not being able to help. Bye -richy. -- Richard B. Kreckel