MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Tensor Contraction

  • To: mathgroup at
  • Subject: [mg113787] Re: Tensor Contraction
  • From: Erik Max Francis <max at>
  • Date: Sat, 13 Nov 2010 00:57:34 -0500 (EST)
  • References: <ibj4ol$fi0$>

Sensei wrote:
> Hi! I am trying to implement cleanly the tensor contraction. What I'd 
> like to do is something like this.
> Let A = matrix of A^{ijk} be a 3-tensor, now how do I write something like
> C^{ik} = A^{ijk} v_j
> using the summing notation? I am trying to avoid making simple For cycles...

The way I did it for my own little tensor package is to tensor product 
the two together, transpose both of the relevant indices you want to 
contract to the first indices, then run Tr to contract them (call it 
with Tr[..., Plus, 2].

Erik Max Francis && max at &&
  San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis
   Mona Lisa / Come to discover / I am your daughter
    -- Lamya

  • Prev by Date: Table local
  • Next by Date: Re: exporting an array
  • Previous by thread: Tensor Contraction
  • Next by thread: Re: Tensor Contraction