Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: How does TensorReduce use assumptions?
Replies: 2   Last Post: Jan 24, 2014 4:09 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Yi Wang

Posts: 33
Registered: 3/30/12
Re: How does TensorReduce use assumptions?
Posted: Jan 24, 2014 4:08 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Dear Jose,

Thank you very much for your reply! With your help, now I can get
TensorReduce work in this way. Previously I didn't notice TensorRank and
that's why I had the problem.

BTW, it also took me some time to notice that TensorSymmetry[f] ^=
Symmetric[All] doesn't work. Explicit slots like Symmetric[{1,2}] needs to
be given. After solving this problem, everything works great!

Best,
Yi


On Thu, Jan 23, 2014 at 2:08 PM, Jose Martin-Garcia <jose@wolfram.com>wrote:

> Hi,
>
> The documentation statement on TensorDimensions is correct, but some
> operations need full information (dimensions, rank and symmetry). For
> example let us assume that f does not have any symmetry,
>
> In[1]:= TensorDimensions[f[g__]] ^:= d& /@ {g};
> TensorRank[f[g__]] ^:= Length[{g}];
> TensorSymmetry[f[g__]] ^:= {};
>
> Then you get the expected
>
> In[4]:= Assuming[t \[Element] Arrays[{d, d}, Antisymmetric[All]],
> TensorReduce@ TensorContract[t \[TensorProduct] f[DN, DN],
> {{1, 4}}]]
> Out[4]= - TensorContract[t \[TensorProduct] f[DN, DN], {{2, 4}}]
>
> Regards,
> Jose.
>
> ----- Original Message -----
>

> > From: "Yi Wang" <tririverwangyi@gmail.com>
> > To: mathgroup@smc.vnet.net
> > Sent: Thursday, January 23, 2014 2:35:25 AM
> > Subject: How does TensorReduce use assumptions?

>
> > I would like to use TensorReduce by assuming that certain patterns of
> > functions are tensors. From documentation of TensorReduce:

>
> > "If TensorDimensions[ten] does not return a list of dimensions, then the
> > expression ten is returned unchanged."

>
> > I would have inferred from above that if I modify TensorDimensions[ten],
> > TensorReduce should work. Thus I did

>
> > Unprotect[TensorDimensions];
> > TensorDimensions[f_[g__]] := d & /@ {g};
> > Protect[TensorDimensions];

>
> > Assuming[ t \[Element] Arrays[{d, d}, Antisymmetric[All]] ,
> > TensorReduce @ TensorContract[ t\[TensorProduct]f[DN, DN], {1, 4}]]

>
> > However, this doesn't work. i.e. TensorReduce does nothing, and the
> result is
>

> > TensorContract[ t\[TensorProduct]f[DN, DN], {{1, 4}}]
>
> > To compare, having defined
>
> > Assuming[ t \[Element] Arrays[{d, d}, Antisymmetric[All]] &&
> > f[DN, DN] \[Element] Arrays[{d, d}],
> > TensorReduce @ TensorContract[ t\[TensorProduct]f[DN, DN], {1, 4}]]

>
> > - TensorContract[ t\[TensorProduct]f[DN, DN], {{2, 4}}]
>
> > the result is indeed simplified as desired:
>
> > I also tried to modify TensorSymmetry, but without luck either.
>
> > I'd like to understand what are the assumptions that TensorReduce really
> > uses. Is there a way that I can work with TensorReduce as above, with
> > pattern like declaration of tensors?

>
> > PS: Currently I generate a list of assumptions of f_[g__] using Cases,
> and
> > put those assumptions together in Assuming. This makes the code slow and
> > ugly.

>




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.