Re: [Numpy-discussion] Transpose Array How?

2010-06-23 Thread Alan Bromborsky
Angus McMorland wrote: > On 23 June 2010 16:13, Alan Bromborsky wrote: > >> Alan Bromborsky wrote: >> >>> In the transpose function we have transpose(a,axis) where axis can be a >>> list of integers. But exactly what to the integers mean? If axis = >

Re: [Numpy-discussion] Transpose Array How?

2010-06-23 Thread Alan Bromborsky
Alan Bromborsky wrote: > In the transpose function we have transpose(a,axis) where axis can be a > list of integers. But exactly what to the integers mean? If axis = > [i1,i2] switching axis i1 with axis i2 is obvious, but what if axis = > [i1,i2,i3]. Does this describe a cyclic

[Numpy-discussion] Transpose Array How?

2010-06-23 Thread Alan Bromborsky
In the transpose function we have transpose(a,axis) where axis can be a list of integers. But exactly what to the integers mean? If axis = [i1,i2] switching axis i1 with axis i2 is obvious, but what if axis = [i1,i2,i3]. Does this describe a cyclic permutation where i1->i2->i3->i2 or what doe

Re: [Numpy-discussion] Tensor contraction

2010-06-17 Thread Alan Bromborsky
Friedrich Romstedt wrote: > 2010/6/13 Alan Bromborsky : > >> Friedrich Romstedt wrote: >> >>>> I am writing symbolic tensor package for general relativity. In making >>>> symbolic tensors concrete >>>> I generate

Re: [Numpy-discussion] Tensor contraction

2010-06-14 Thread Alan Bromborsky
tware/theano/library/tensor/basic.html > > Dag Sverre > > Alan Bromborsky wrote: > >> Sebastian Walter wrote: >> >>> On Sun, Jun 13, 2010 at 8:11 PM, Alan Bromborsky >>> wrote: >>> >>> &g

Re: [Numpy-discussion] Tensor contraction

2010-06-14 Thread Alan Bromborsky
Sebastian Walter wrote: > On Sun, Jun 13, 2010 at 8:11 PM, Alan Bromborsky wrote: > >> Friedrich Romstedt wrote: >> >>> 2010/6/13 Pauli Virtanen : >>> >>> >>>> def tensor_contraction_single(tensor, dimensions): >>&

Re: [Numpy-discussion] Tensor contraction

2010-06-13 Thread Alan Bromborsky
Friedrich Romstedt wrote: > 2010/6/13 Alan Bromborsky : > >> I am writing symbolic tensor package for general relativity. In making >> symbolic tensors concrete >> I generate numpy arrays stuffed with sympy functions and symbols. >> > > Tha

Re: [Numpy-discussion] Tensor contraction

2010-06-13 Thread Alan Bromborsky
Friedrich Romstedt wrote: > 2010/6/13 Pauli Virtanen : > >> def tensor_contraction_single(tensor, dimensions): >>"""Perform a single tensor contraction over the dimensions given""" >>swap = [x for x in range(tensor.ndim) >>if x not in dimensions] + list(dimensions) >>x =

Re: [Numpy-discussion] Tensor contraction

2010-06-12 Thread Alan Bromborsky
Friedrich Romstedt wrote: > 2010/6/12 Alan Bromborsky : > >> If I have a single numpy array, for example with 3 indices T_{ijk} and I >> want to sum over two them in the sense of tensor contraction - >> >> T_{k} = \sum_{i=0}^{n-1} T_{iik}. Is there an eas

[Numpy-discussion] Tensor contraction

2010-06-12 Thread Alan Bromborsky
If I have a single numpy array, for example with 3 indices T_{ijk} and I want to sum over two them in the sense of tensor contraction - T_{k} = \sum_{i=0}^{n-1} T_{iik}. Is there an easy way to do this with numpy? ___ NumPy-Discussion mailing list Num