[GiNaC-list] Covariant derivative(its long..)

Sheplyakov Alexei varg at theor.jinr.ru
Mon Apr 4 07:37:14 CEST 2005


On Sun, Apr 03, 2005 at 11:47:47PM -0300, mdias at ift.unesp.br wrote:
> 
> I tried this very confuse code, and I am happy if somebody could help-me. I
> tried to make covariant derivative derivated from a indexed. Use it like:
> D(indexed(A,mu),nu)
>  But the fatal errors in this code (among millions..):
> i) simplify_indexed() crashs or doesnt work !!
> II) get_free_indexes not work, so D^\alpha(A_beta)A^\beta A_\alpha
> -D^\beta(A_alpha)A^\beta A_\alpha is not zero
>  In the last post , Christian Bauer suggests "override is eval_indexed() (for
> automatic evaluation) and
> contract_with()/add_indexed()/scalar_mul_indexed() (for manual evaluation,
> AKA simplify_indexed())" and showed the way: look color.cpp source.
> 

[snip]

>   protected:
> 	void do_print(const print_context & c, unsigned level) const;
>         ex symtree, arg,index; 
>   lst seq;

You have re-defined `seq' member. Class indexed already has one (of
type std::vector<GiNaC::ex> type). This looks like asking for trouble,
unless you *exaclty* know what are you doing.

[Huge snip] 

You haven't implemented codiff::eval_indexed(), codiff::add_indexed(),
etc. So simplify_indexed() can't do something useful with your class. 

> ex covdiff::subs(const exmap & m, unsigned options) const

Do you really need to re-implement subs?

-- 
----------------------------------------------------------------------
  One disk to rule them all, One disk to find them.
  One disk to bring them all And in the darkness grind them.
  In the Land of Redmond where the shadows lie.
----------------------------------------------------------------------





More information about the GiNaC-list mailing list