DefProduct, scalars and constant symbols

Sett 50 ganger
Hopp til første uleste melding

Mario Herrero Valea

ulest,
24. nov. 2017, 11:36:4124.11.2017
til xAct Tensor Computer Algebra
Dear all,

I'm trying to define a non-commutative product to use in my computations with a simple requirement: only a few objects must be multiplied by using this product, everything else (and in particular constant symbols) must go through and be considered like scalars for the product.

After diving into the group and into the documentation, I have understood that this should be possible by defining something like 

DefProduct[product, AssociativeProductQ -> True, IdentityElementOfProduct -> 1, ScalarsOfProduct -> ConstantSymbolQ]

However, when I try to use it, it does not take constant symbols out of the multiplication, not even after the use of ToCanonical. Clearly, there is something that I'm not doing correctly. 

Could you help me with this?


Best,
Mario 

Jose

ulest,
28. nov. 2017, 20:24:5728.11.2017
til xAct Tensor Computer Algebra
Hi,

Note the difference between ConstantSymbolQ (which is the predicate associated to DefConstantSymbol) and ConstantQ. For example ConstantQ[3] is True, but ConstantSymbolQ[3] is False.

The notion of "scalars of product" is precisely that of the objects that will be automatically extracted. You can create your own scalarQ function and explicitly specify there what is a scalar and what is not in this sense. In general I recommend to have explicit definitions for things that are scalars (so definitions of the form scalarQ[x[]] = True, or scalarQ[_Integer] = True, etc) and then at the end having a global scalarQ[_] = False that catches all the rest.

If this doesn't yet work for you, send an explicit example.

Cheers,
Jose.

Mario Herrero Valea

ulest,
1. des. 2017, 14:37:0001.12.2017
til xAct Tensor Computer Algebra
Hi Jose,

Thanks for your reply and the solution.

Actually the weird thing is that I was enforcing the ScalarsOfProduct -> ConstantSymbolQ definition but Mathematica was not simplifying things like product[A[a],w,A[b]] with w being a Constant Symbol an A[a] a tensor. But this definition was built inside a more complicated code so it might be that another function was interfering.

In any case, I have not worked on this code in the last days, but I will try to implement this as soon as possible and will come back to tell if it worked or not. 


Best,
Mario



--
You received this message because you are subscribed to the Google Groups "xAct Tensor Computer Algebra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xact+uns...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Svar alle
Svar til forfatter
Videresend
0 nye meldinger