[GiNaC-list] bug in reposition_dummy_indices

Sheplyakov Alexei varg at theor.jinr.ru
Tue Nov 22 12:36:40 CET 2005


Hello!

This simple program fails:

#include <iostream>
#include <cassert>
#include <ginac/ginac.h>
using namespace std;
using namespace GiNaC;

int main(int argc, char** argv)
{
	varidx mu1(symbol("mu1"), 4);
	varidx mu2(symbol("mu2"), 4);
	varidx mu3(symbol("mu3"), 4);
	varidx mu4(symbol("mu4"), 4);
	varidx mu5(symbol("mu5"), 4);
	varidx mu6(symbol("mu6"), 4);
	symbol A("A");

	exvector ev2;
	ev2.push_back(mu3.toggle_variance());
	ev2.push_back(mu6);
	ev2.push_back(mu5.toggle_variance());
	ev2.push_back(mu6.toggle_variance());
	ev2.push_back(mu5);
	ev2.push_back(mu3); 

	ex test_cycl = indexed(A, sy_cycl(), ev2);
	test_cycl = test_cycl.simplify_indexed();
	assert(test_cycl.get_free_indices().size() == 0);

	return 0;
}

The reason is that reposition_dummy_indices() (indexed.cpp:639) ignores 
symmetry properties of expression[s]. To be more specific, if the 
expression e has some symmetry properties, than the code like this
(indexed.cpp:654):

					e = e.subs(lst(
						*it2 == ex_to<varidx>(*it2).toggle_variance(),
						ex_to<varidx>(*it2).toggle_variance() == *it2
					), subs_options::no_pattern);

can yield some non-trivial permutation of indices (apart from swapping
covariant and contravariant instances of some index), so subsequent
manipulations become incorrect. However, I don't know how to fix this.
Any ideas?

-- 
All science is either physics or stamp collecting.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.cebix.net/pipermail/ginac-list/attachments/20051122/51b25aea/attachment.pgp


More information about the GiNaC-list mailing list