SandBoxGradedTensor
last edited 14 years ago by Bill Page

Edit detail for SandBoxGradedTensor revision 2 of 2

1 2
Editor: Bill Page
Time: 2011年02月28日 14:55:14 GMT-8
Note: rank

changed:
- coerce: DP(dim, R) -> GradedTensor(1,0,R,dim)
 coerce: DirectProduct(dim, R) -> GradedTensor(1,0,R,dim)
changed:
- coerce: SM(dim, R) -> GradedTensor(0,2,R,dim)
 coerce: SquareMatrix(dim, R) -> GradedTensor(0,2,R,dim)
changed:
- rank: % -> [NonNegativeInteger,NonNegativeInteger]
 rank: % -> DirectProduct(2,NonNegativeInteger)
changed:
- elt: (%, I, I, I) -> R
 elt: (%, Integer, Integer, Integer) -> R
changed:
- elt: (%, I, I, I, I) -> R
 elt: (%, Integer, Integer, Integer, Integer) -> R
changed:
- elt: (%, List I) -> R
 elt: (%, List Integer) -> R
changed:
- --declarations
- x,y: %
 -- exports
 rank(t:%):DirectProduct(2,NonNegativeInteger)==directProduct [n,m]

fricas
(1) -> <spad>
fricas
)abbrev domain GTEN GradedTensor
GradedTensor(n:NonNegativeInteger, m:NonNegativeInteger, R:CommutativeRing,dim:NonNegativeInteger): Join(GradedAlgebra(R, NonNegativeInteger), GradedModule(Integer, NonNegativeInteger), Eltable(Integer,R)) with
 coerce: DirectProduct(dim, R) -> GradedTensor(1,0,R,dim)
 ++ coerce(v) views a vector as a (1,0)-tensor.
 coerce: SquareMatrix(dim, R) -> GradedTensor(0,2,R,dim)
 ++ coerce(m) views a matrix as a (0,2)-tensor.
 coerce: List R -> GradedTensor(0,1,R,dim)
 ++ coerce([r_1,...,r_dim]) allows tensors to be constructed
 ++ using lists.
 coerce: List % -> GradedTensor(n,m+1,R,dim)
 ++ coerce([t_1,...,t_dim]) allows tensors to be constructed
 ++ using lists.
 rank: % -> DirectProduct(2,NonNegativeInteger)
 ++ rank(t) returns the tensorial rank of (n,m)-tensor t
 ++ [n,m] (that is, the number of contravariant and covariant
 ++ indices).
 elt: (%) -> R
 ++ elt(t) gives the component of a rank 0 tensor.
 elt: (%, Integer, Integer) -> R
 ++ elt(t,i,j) gives a component of a rank (2,0) (1,1) or (0,2)-tensor. E.g.
 ++ T(1,1), T(1,-1), T(-1,-1)
 elt: (%, Integer, Integer, Integer) -> R
 ++ elt(t,i,j,k) gives a component of a rank (3,0),(2,1),(1,2) or (0,3)-tensor.
 ++ E.g. T(1,1,1), T(1,1,-1), etc.
 elt: (%, Integer, Integer, Integer, Integer) -> R
 ++ elt(t,i,j,k,l) gives a component of a rank (4,0), (3,1),(2,2),(1,3) or (0,4)-tensor.
 ++ E.g. T(1,1,1,1), T(1,1,1,-1), etc.
 elt: (%, List Integer) -> R
 ++ elt(t,[i1,...,iN]) gives a component of a rank (n,m)-tensor when n+m=N.
 ++ E.g. T[1,1,1,1,1], T[1,1,1,1,-1], etc.
 -- This specializes the documentation from GradedAlgebra.
 product: (%,%) -> %
 ++ product(s,t) is the outer product of the tensors s and t.
 ++ For example, if \spad{r = product(s,t)} for rank 2 tensors s and t,
 ++ then \spad{r} is a rank 4 tensor given by
 ++ \spad{r(i,j,k,l) = s(i,j)*t(k,l)}.
 *: (%, %) -> %
 ++ s*t is the inner product of the tensors s and t which contracts
 ++ the last index of s with the first index of t, i.e.
 ++ \spad{t*s = contract(t,rank t, s, 1)}
 ++ \spad{t*s = sum(k=1..dim, t[i1,..,iN,-k]*s[k,j1,..,jM])}
 ++ This is compatible with the use of \spad{M*v} to denote
 ++ the matrix-vector inner product.
 contract: (%, Integer, %, Integer) -> %
 ++ contract(t,i,s,j) is the inner product of tenors s and t
 ++ \spad{r(i1,i2,...,in,j1,j2,...jm) = sum(h=1..dim,s(i1,i2,ii=-h,...,in)*t(j1,j2,jj=h,...,jm))}.
 contract: (%, Integer, Integer) -> %
 ++ contract(t,i,j) is the contraction of tensor t which
 ++ \spad{r(i1,i2,...,in) = sum(h=1..dim,s(i1,i2,ii=-h,...,ij=h,...,in))}.
 transpose: % -> %
 ++ transpose(t) exchanges the first and last indices of t.
 ++ \spad{r(i,...,l) = t(l,...,i)}.
 transpose: (%, Integer, Integer) -> %
 ++ transpose(t,i,j) exchanges the \spad{i}-th and \spad{j}-th indices of t.
 ++ \spad{r(...,i,...,j,...) = t(...,j,...,i,...)}.
 reindex: (%, List Integer) -> %
 ++ reindex(t,[i1,...,in]) permutes the indices of t.
 ++ \spad{r(j1,j2,...,jn) = t(ji1,ji2,...,jin)}.
 kroneckerDelta: () -> GradedTensor(1,1,R,dim)
 ++ kroneckerDelta() is the rank (1,1)-tensor defined by
 ++ \spad{kroneckerDelta()(i,j)}
 ++ \spad{= 1 if i = j}
 ++ \spad{= 0 if i \~= j}
 leviCivitaSymbol: () -> GradedTensor(0,dim,R,dim)
 ++ leviCivitaSymbol() is the rank (0,\spad{dim})-tensor defined by
 ++ \spad{leviCivitaSymbol()(i1,...idim) = +1/0/-1}
 ++ if \spad{i1,...,idim} is an even/is nota /is an odd permutation
 ++ of \spad{minix,...,minix+dim-1}.
 ravel: % -> List R
 ++ ravel(t) produces a list of components from a tensor such that
 ++ \spad{unravel(ravel(t)) = t}.
 unravel: List R -> %
 ++ unravel(t) produces a tensor from a list of
 ++ components such that
 ++ \spad{unravel(ravel(t)) = t}.
 sample: () -> %
 ++ sample() returns an object of type %.
 == add
 Rep == CartesianTensor(1,dim,R)
 -- exports
 rank(t:%):DirectProduct(2,NonNegativeInteger)==directProduct [n,m]</spad>
fricas
Compiling FriCAS source code from file 
 /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/1176878541039946027-25px001.spad
 using old system compiler.
 GTEN abbreviates domain GradedTensor 
******** Spad syntax error detected ********
The prior line was:
32> product: (%,%) -> %
The current line is:
37> *: (%, %) -> %
The number of valid tokens is 1. The prior token was #S(TOKEN :SYMBOL |;| :TYPE KEYWORD :NONBLANK NIL :LINE_NUM 32 :CHAR_NUM 26) The current token is #S(TOKEN :SYMBOL * :TYPE KEYWORD :NONBLANK NIL :LINE_NUM 37 :CHAR_NUM 8)

AltStyle によって変換されたページ (->オリジナル) /