symmetric-tensor-index
Index arithmetic for symmetric tensors
npm install symmetric-tensor-index
Want to see pretty graphs? Log in now!
2 | downloads in the last week |
12 | downloads in the last month |
Last Published By | |
---|---|
Version | 0.1.0 last updated a year ago |
License | MIT |
Keywords | symmetric, tensor, multivariate, polynomial, multinomial, taylor, series, index, arithmetic |
Repository | git://github.com/mikolalysenko/symmetric-tensor-index.git (git) |
Dependencies | None |
Dependents | mikolalysenko-hoarders, symmetric-tensor-eval, symmetric-tensor-to-string |
symmetric-tensor-index
Index operations for symmetric tensors (aka multinomials). In a r-th order symmetric tensor over a d-dimensional vector spaces, we can think of the indices in 3 different ways:
- As a tensor index (ie an array of length r with values of length d)
- As a polynomial degree (ie an array of length d with values up to r)
- Or a flattened array index (a scalar number between 0 and (d + r - 1) choose r )
The code in this library can be used to convert between these indices. For more details see:
Install
npm install symmetric-tensor-index
API
var sym = require("symmetric-tensor-index")
sym.nextTensor(dimension, rank, seq[, index])
Finds the index of the next entry in the tensor.
dimension
is the dimension of the tensorrank
is the rank of the tensorseq
is the tensor indexindex
is the array index (optional)
Returns The next array index. seq
is updated in place.
sym.tensorToDegree(dimension, rank, seq[, result])
Converts a tensor index to a degree index
dimension
dimension of vector spacerank
rank of the tensorseq
is the tensor indexresult
(optional) gets the resulting computation
Returns result
sym.tensorToArray(dimension, rank, seq)
Converts a tensor index to an array index
dimension
dimension of vector spacerank
rank of the tensorseq
is the tensor index
Returns The array index of the tensor entry
sym.degreeToTensor(dimension, rank, degrees[, result])
Converts a degree index to a tensor index
dimension
dimension of vector spacerank
rank of the tensordegrees
is the degree indexresult
is the result (optional)
Returns result
sym.degreeToArray(dimension, rank, degrees)
Converts a degree index to an array index
dimension
dimension of vector spacerank
rank of the tensordegrees
is the degree index
Returns The array index of the degree sequence
Credits
(c) 2013 Mikola Lysenko. MIT License