cc.redberry.core.tensor
Class Tensors
- java.lang.Object
-
- cc.redberry.core.tensor.Tensors
-
public final class Tensors extends java.lang.ObjectFactory methods to create tensors.- Since:
- 1.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidaddAntiSymmetry(SimpleTensor tensor, IndexType type, int... permutation)Attaches antisymmetry to simple tensor with respect to indices of specified type.static voidaddAntiSymmetry(SimpleTensor tensor, int... permutation)Attaches antisymmetry to simple tensor.static voidaddAntiSymmetry(java.lang.String tensor, IndexType type, int... permutation)Attaches antisymmetry to simple tensor with respect to indices of specified type.static voidaddAntiSymmetry(java.lang.String tensor, int... permutation)Attaches antisymmetry to simple tensor.static voidaddSymmetries(SimpleTensor tensor, Permutation... permutations)Attaches symmetries to simple tensor.static voidaddSymmetries(java.lang.String tensor, Permutation... permutations)Attaches symmetris to simple tensor.static voidaddSymmetry(SimpleTensor tensor, IndexType type, boolean sign, int... permutation)Attaches symmetry to simple tensor with respect to indices of specified type.static voidaddSymmetry(SimpleTensor tensor, IndexType type, int... permutation)Attaches symmetry to simple tensor with respect to indices of specified type.static voidaddSymmetry(SimpleTensor tensor, IndexType type, Permutation permutation)Attaches symmetry to simple tensor with respect to indices of specified type.static voidaddSymmetry(SimpleTensor tensor, int... permutation)Attaches symmetry to simple tensor.static voidaddSymmetry(SimpleTensor tensor, Permutation permutation)Attaches symmetry to simple tensor.static voidaddSymmetry(java.lang.String tensor, IndexType type, boolean sign, int... permutation)Attaches symmetry to simple tensor with respect to indices of specified type.static voidaddSymmetry(java.lang.String tensor, IndexType type, int... permutation)Attaches symmetry to simple tensor with respect to indices of specified type.static voidaddSymmetry(java.lang.String tensor, IndexType type, Permutation permutation)Attaches symmetry to simple tensor with respect to indices of specified type.static voidaddSymmetry(java.lang.String tensor, int... permutation)Attaches symmetry to simple tensor.static voidaddSymmetry(java.lang.String tensor, Permutation permutation)Attaches symmetry to simple tensor.static Tensorarccos(Tensor argument)Creates a arccosine object from scalar argument.static Tensorarccot(Tensor argument)Creates a arcotangent object from scalar argument.static Tensorarcsin(Tensor argument)Creates a arcsinus object from scalar argument.static Tensorarctan(Tensor argument)Creates a arctangent object from scalar argument.static Tensorcos(Tensor argument)Creates a cosine object from scalar argument.static Tensorcot(Tensor argument)Creates a cotangent object from scalar argument.static SimpleTensorcreateKronecker(int index1, int index2)Returns Kronecker tensor with specified upper and lower indices.static SimpleTensorcreateMetric(int index1, int index2)Returns metric tensor with specified indices.static SimpleTensorcreateMetricOrKronecker(int index1, int index2)Returns metric tensor if specified indices have same states and Kronecker tensor if specified indices have different states.static Tensordivide(Tensor a, Tensor b)Returnsadivided byb.static Tensorexp(Tensor argument)Creates a exponent object from scalar argument.static Expressionexpression(Tensor left, Tensor right)Creates an expression object from two tensors.static TensorFieldfield(int name, SimpleIndices indices, SimpleIndices[] argIndices, Tensor[] arguments)Returns new tensor field with specified int name (seeNameManagerfor details), indices, arguments list and explicit argument indices bindings.static TensorFieldfield(int name, SimpleIndices indices, Tensor[] arguments)Returns new tensor field with specified int name (seeNameManagerfor details), indices and arguments list.static TensorFieldfield(java.lang.String name, SimpleIndices indices, java.util.Collection<Tensor> arguments)Returns new tensor field with specified string name, indices and arguments list.static TensorFieldfield(java.lang.String name, SimpleIndices indices, SimpleIndices[] argIndices, Tensor[] arguments)Returns new tensor field with specified string name, indices, arguments list and explicit argument indices bindings.static TensorFieldfield(java.lang.String name, SimpleIndices indices, Tensor[] arguments)Returns new tensor field with specified string name, indices and arguments list.static TensorFieldfieldDerivative(java.lang.String name, SimpleIndices indices, SimpleIndices[] argIndices, Tensor[] arguments, int[] orders)Returns new tensor field derivative with specified string name, indices, arguments, derivative orders and explicit argument indices bindings.static TensorFieldfieldDerivative(TensorField parent, SimpleIndices derivativeIndices, int argPosition)Creates 1-st derivative with respect to specified argument of specified tensor field with specified derivative indicesstatic TensorFieldfieldDerivative(TensorField parent, SimpleIndices derivativeIndices, int argPosition, int order)Creates n-th derivative with respect to specified argument of specified tensor field with specified derivative indicesstatic booleanisKronecker(Tensor t)Returnstrueif specified tensor is Kronecker tensorstatic booleanisKroneckerOrMetric(SimpleTensor t)Returnstrueif specified tensor is metric or Kronecker tensorstatic booleanisKroneckerOrMetric(Tensor t)Returnstrueif specified tensor is metric or Kronecker tensorstatic booleanisMetric(Tensor t)Returnstrueif specified tensor is metric tensorstatic Tensorlog(Tensor argument)Creates a natural logarithm object from scalar argument.static Tensormultiply(java.util.Collection<Tensor> factors)Returns the result of multiplication of specified tensors.static Tensormultiply(Tensor... factors)Returns the result of multiplication of specified tensors.static TensormultiplyAndRenameConflictingDummies(java.util.Collection<Tensor> factors)Returns result of multiplication of specified tensors taking care about all conflicting dummy indices in factors.static TensormultiplyAndRenameConflictingDummies(Tensor... factors)Returns result of multiplication of specified tensors taking care about all conflicting dummy indices in factors.static Tensornegate(Tensor tensor)Multiplies specified tensor by minus one.static Tensorparse(double i)Converts double value to Complex.static Tensorparse(float i)Converts float value to Complex.static Tensorparse(int i)Converts int value to Complex.static Tensorparse(long i)Converts long value to Complex.static Tensor[]parse(java.lang.String... expressions)Converts array of string expressions into array of tensors.static Tensorparse(java.lang.String expression)Converts string expression into tensor.static Tensorparse(java.lang.String expression, ParseTokenTransformer... preprocessors)Converts string expression into tensor, additionally transforming AST according to specified AST transformers.static ExpressionparseExpression(java.lang.String expression)Converts a string intoExpression.static SimpleTensorparseSimple(java.lang.String expression)Converts a string into simple tensor.static Tensorpow(Tensor argument, java.math.BigInteger power)Power function.static Tensorpow(Tensor argument, int power)Power function.static Tensorpow(Tensor argument, Tensor power)Power function.static Tensorreciprocal(Tensor tensor)Returns reciprocal of the specified tensor, i.e.static voidresolveAllDummies(Tensor[] factors)static Tensor[]resolveDummy(Tensor[] factors)Renames dummies in specified tensors, such that it becomes safe to multiply them.static voidsetAntiSymmetric(java.lang.Object... tensors)Makes simple tensors antisymmetric.static voidsetAntiSymmetric(SimpleTensor tensor)Makes simple tensor antisymmetric.static voidsetAntiSymmetric(SimpleTensor tensor, IndexType type)Makes simple tensor antisymmetric with respect to indices of specified type.static voidsetAntiSymmetric(java.lang.String... tensors)Makes simple tensors symmetric.static voidsetAntiSymmetric(java.lang.String tensor)Makes simple tensor antisymmetric.static SimpleTensorsetIndices(SimpleTensor tensor, int[] indices)Returns an instance of specified simple tensor with specified indicesstatic SimpleTensorsetIndices(SimpleTensor tensor, SimpleIndices indices)Returns an instance of specified simple tensor with specified indicesstatic voidsetSymmetric(java.lang.Object... tensors)Makes simple tensors symmetric.static voidsetSymmetric(SimpleTensor tensor)Makes simple tensor symmetric.static voidsetSymmetric(SimpleTensor tensor, IndexType type)Makes simple tensor symmetric with respect to indices of specified type.static voidsetSymmetric(java.lang.String tensor)Makes simple tensor symmetric.static SimpleTensorsimpleTensor(int name, SimpleIndices indices)Returns new simple tensor with specified int name (seeNameManagerfor details) and indices.static SimpleTensorsimpleTensor(java.lang.String name, SimpleIndices indices)Returns new simple tensor with specified string name and indices.static Tensorsin(Tensor argument)Creates a sinus object from scalar argument.static Tensorsubtract(Tensor a, Tensor b)Subtractsbfromastatic Tensorsum(java.util.Collection<Tensor> tensors)Returns the result of summation of several tensors.static Tensorsum(Tensor... tensors)Returns the result of summation of several tensors.static Tensortan(Tensor argument)Creates a tangent object from scalar argument
-
-
-
Method Detail
-
pow
public static Tensor pow(Tensor argument, int power)
Power function. Returns tensor raised to specified integer power.- Parameters:
argument- basepower- power- Returns:
- result of argument exponentiation
- Throws:
java.lang.IllegalArgumentException- if argument is not scalar
-
pow
public static Tensor pow(Tensor argument, java.math.BigInteger power)
Power function. Returns tensor raised to specified integer power.- Parameters:
argument- basepower- power- Returns:
- result of argument exponentiation
- Throws:
java.lang.IllegalArgumentException- if argument is not scalar
-
pow
public static Tensor pow(Tensor argument, Tensor power)
Power function. Returns tensor raised to specified power.- Parameters:
argument- basepower- power- Returns:
- result of argument exponentiation
- Throws:
java.lang.IllegalArgumentException- if argument or power is not scalar
-
multiply
public static Tensor multiply(Tensor... factors)
Returns the result of multiplication of specified tensors. Einstein notation assumed. If there is a chance that some factors have conflicting (same name) dummy indices usemultiplyAndRenameConflictingDummies(Tensor...)instead.- Parameters:
factors- array of factors to be multiplied- Returns:
- result of multiplication
- Throws:
InconsistentIndicesException- if there is indices clash
-
multiply
public static Tensor multiply(java.util.Collection<Tensor> factors)
Returns the result of multiplication of specified tensors. Einstein notation assumed. If there is a chance that some factors have conflicting (same name) dummy indices usemultiplyAndRenameConflictingDummies(Tensor...)instead.- Parameters:
factors- collection of factors to be multiplied- Returns:
- result of multiplication
- Throws:
InconsistentIndicesException- if there is indices clash
-
multiplyAndRenameConflictingDummies
public static Tensor multiplyAndRenameConflictingDummies(Tensor... factors)
Returns result of multiplication of specified tensors taking care about all conflicting dummy indices in factors. Einstein notation assumed.- Parameters:
factors- array of factors to be multiplied- Returns:
- result of multiplication
- Throws:
InconsistentIndicesException- if there is indices clash
-
multiplyAndRenameConflictingDummies
public static Tensor multiplyAndRenameConflictingDummies(java.util.Collection<Tensor> factors)
Returns result of multiplication of specified tensors taking care about all conflicting dummy indices in factors. Einstein notation assumed.- Parameters:
factors- array of factors to be multiplied- Returns:
- result of multiplication
- Throws:
InconsistentIndicesException- if there is indices clash
-
resolveDummy
public static Tensor[] resolveDummy(Tensor[] factors)
Renames dummies in specified tensors, such that it becomes safe to multiply them.- Parameters:
factors- tensors- Returns:
- the array of tensors with renamed dummy indices
-
resolveAllDummies
public static void resolveAllDummies(Tensor[] factors)
-
divide
public static Tensor divide(Tensor a, Tensor b)
Returnsadivided byb.- Parameters:
a- tensorb- scalar tensor- Returns:
adivided byb.- Throws:
java.lang.IllegalArgumentException- if b is not scalar
-
sum
public static Tensor sum(Tensor... tensors)
Returns the result of summation of several tensors.- Parameters:
tensors- array of summands- Returns:
- result of summation
- Throws:
TensorException- if tensors have different free indices
-
sum
public static Tensor sum(java.util.Collection<Tensor> tensors)
Returns the result of summation of several tensors.- Parameters:
tensors- collection of summands- Returns:
- result of summation
- Throws:
TensorException- if tensors have different free indices
-
subtract
public static Tensor subtract(Tensor a, Tensor b)
Subtractsbfroma- Parameters:
a- tensorb- tensor- Returns:
a-b- Throws:
TensorException- if tensors have different free indices
-
negate
public static Tensor negate(Tensor tensor)
Multiplies specified tensor by minus one.- Parameters:
tensor- tensor to be negotiated- Returns:
- tensor negate to specified one
-
reciprocal
public static Tensor reciprocal(Tensor tensor)
Returns reciprocal of the specified tensor, i.e. one divided by it.- Parameters:
tensor- tensor- Returns:
- reciprocal of the specified tensor
- Throws:
java.lang.IllegalArgumentException- if specified tensor is not scalar
-
simpleTensor
public static SimpleTensor simpleTensor(java.lang.String name, SimpleIndices indices)
Returns new simple tensor with specified string name and indices.- Parameters:
name- string name of the tensorindices- indices- Returns:
- new instance of
SimpleTensorobject
-
simpleTensor
public static SimpleTensor simpleTensor(int name, SimpleIndices indices)
Returns new simple tensor with specified int name (seeNameManagerfor details) and indices.- Parameters:
name- int name of the tensorindices- indices- Returns:
- new instance of
SimpleTensorobject
-
fieldDerivative
public static TensorField fieldDerivative(TensorField parent, SimpleIndices derivativeIndices, int argPosition)
Creates 1-st derivative with respect to specified argument of specified tensor field with specified derivative indices- Parameters:
parent- tensor fieldderivativeIndices- indices of the var (inverted)argPosition- argument- Returns:
- 1-st derivative
-
fieldDerivative
public static TensorField fieldDerivative(TensorField parent, SimpleIndices derivativeIndices, int argPosition, int order)
Creates n-th derivative with respect to specified argument of specified tensor field with specified derivative indices- Parameters:
parent- tensor fieldderivativeIndices- indices of the var (inverted)argPosition- argumentorder- order of derivative- Returns:
- n-th derivative
-
fieldDerivative
public static TensorField fieldDerivative(java.lang.String name, SimpleIndices indices, SimpleIndices[] argIndices, Tensor[] arguments, int[] orders)
Returns new tensor field derivative with specified string name, indices, arguments, derivative orders and explicit argument indices bindings.- Parameters:
name- string name of the corresponding tensor fieldindices- total indices of resulting derivative (field indices + indices of vars)argIndices- argument indices bindingsarguments- arguments listorders- orders of derivatives- Returns:
- new instance of
TensorFieldobject
-
field
public static TensorField field(java.lang.String name, SimpleIndices indices, Tensor[] arguments)
Returns new tensor field with specified string name, indices and arguments list. Free indices of arguments assumed as arguments indices bindings of this field bindings.- Parameters:
name- int name of the fieldindices- indicesarguments- arguments list- Returns:
- new instance of
TensorFieldobject
-
field
public static TensorField field(java.lang.String name, SimpleIndices indices, java.util.Collection<Tensor> arguments)
Returns new tensor field with specified string name, indices and arguments list. Free indices of arguments assumed as arguments indices bindings of this field bindings.- Parameters:
name- int name of the fieldindices- indicesarguments- arguments list- Returns:
- new instance of
TensorFieldobject
-
field
public static TensorField field(java.lang.String name, SimpleIndices indices, SimpleIndices[] argIndices, Tensor[] arguments)
Returns new tensor field with specified string name, indices, arguments list and explicit argument indices bindings.- Parameters:
name- int name of the fieldindices- indicesargIndices- argument indices bindingsarguments- arguments list- Returns:
- new instance of
TensorFieldobject
-
field
public static TensorField field(int name, SimpleIndices indices, SimpleIndices[] argIndices, Tensor[] arguments)
Returns new tensor field with specified int name (seeNameManagerfor details), indices, arguments list and explicit argument indices bindings.- Parameters:
name- int name of the fieldindices- indicesargIndices- argument indices bindingsarguments- arguments list- Returns:
- new instance of
TensorFieldobject
-
field
public static TensorField field(int name, SimpleIndices indices, Tensor[] arguments)
Returns new tensor field with specified int name (seeNameManagerfor details), indices and arguments list. Free indices of arguments assumed as arguments indices bindings of this field bindings.- Parameters:
name- int name of the fieldindices- indicesarguments- arguments list- Returns:
- new instance of
TensorFieldobject
-
setIndices
public static SimpleTensor setIndices(SimpleTensor tensor, int[] indices)
Returns an instance of specified simple tensor with specified indices- Parameters:
tensor- simple tensorindices- indices- Returns:
- instance of specified simple tensor with specified indices
-
setIndices
public static SimpleTensor setIndices(SimpleTensor tensor, SimpleIndices indices)
Returns an instance of specified simple tensor with specified indices- Parameters:
tensor- simple tensorindices- indices- Returns:
- instance of specified simple tensor with specified indices
-
expression
public static Expression expression(Tensor left, Tensor right)
Creates an expression object from two tensors.- Parameters:
left- left part of expressionright- right part of expression- Returns:
- new object of type
Expression
-
sin
public static Tensor sin(Tensor argument)
Creates a sinus object from scalar argument.- Parameters:
argument- scalar argument of sinus- Returns:
- sinus of argument
-
cos
public static Tensor cos(Tensor argument)
Creates a cosine object from scalar argument.- Parameters:
argument- scalar argument of cosine- Returns:
- cosine of argument
-
tan
public static Tensor tan(Tensor argument)
Creates a tangent object from scalar argument- Parameters:
argument- scalar argument of tangent- Returns:
- tangent of argument
-
cot
public static Tensor cot(Tensor argument)
Creates a cotangent object from scalar argument.- Parameters:
argument- scalar argument of cotangent- Returns:
- cotangent of argument
-
arcsin
public static Tensor arcsin(Tensor argument)
Creates a arcsinus object from scalar argument.- Parameters:
argument- scalar argument of arcsinus- Returns:
- arcsinus of argument
-
arccos
public static Tensor arccos(Tensor argument)
Creates a arccosine object from scalar argument.- Parameters:
argument- scalar argument of arccosine- Returns:
- arccosine of argument
-
arctan
public static Tensor arctan(Tensor argument)
Creates a arctangent object from scalar argument.- Parameters:
argument- scalar argument of arctangent- Returns:
- arctangent of argument
-
arccot
public static Tensor arccot(Tensor argument)
Creates a arcotangent object from scalar argument.- Parameters:
argument- scalar argument of arccotangent- Returns:
- arcotangent of argument
-
log
public static Tensor log(Tensor argument)
Creates a natural logarithm object from scalar argument.- Parameters:
argument- scalar argument of logarithm- Returns:
- natural logarithm of argument
-
exp
public static Tensor exp(Tensor argument)
Creates a exponent object from scalar argument.- Parameters:
argument- scalar argument of exponent- Returns:
- exponent of argument
-
createKronecker
public static SimpleTensor createKronecker(int index1, int index2)
Returns Kronecker tensor with specified upper and lower indices.- Parameters:
index1- first indexindex2- second index- Returns:
- Kronecker tensor with specified upper and lower indices
- Throws:
java.lang.IllegalArgumentException- if indices have same statesjava.lang.IllegalArgumentException- if indices have different types
-
createMetric
public static SimpleTensor createMetric(int index1, int index2)
Returns metric tensor with specified indices.- Parameters:
index1- first indexindex2- second index- Returns:
- metric tensor with specified indices
- Throws:
java.lang.IllegalArgumentException- if indices have different statesjava.lang.IllegalArgumentException- if indices have different typesjava.lang.IllegalArgumentException- if indices have non metric types
-
createMetricOrKronecker
public static SimpleTensor createMetricOrKronecker(int index1, int index2)
Returns metric tensor if specified indices have same states and Kronecker tensor if specified indices have different states.- Parameters:
index1- first indexindex2- second index- Returns:
- metric tensor if specified indices have same states and Kronecker tensor if specified indices have different states
- Throws:
java.lang.IllegalArgumentException- if indices have different typesjava.lang.IllegalArgumentException- if indices have same states and non metric types
-
isKronecker
public static boolean isKronecker(Tensor t)
Returnstrueif specified tensor is Kronecker tensor- Parameters:
t- tensor- Returns:
trueif specified tensor is Kronecker tensor
-
isMetric
public static boolean isMetric(Tensor t)
Returnstrueif specified tensor is metric tensor- Parameters:
t- tensor- Returns:
trueif specified tensor is metric tensor
-
isKroneckerOrMetric
public static boolean isKroneckerOrMetric(Tensor t)
Returnstrueif specified tensor is metric or Kronecker tensor- Parameters:
t- tensor- Returns:
trueif specified tensor is metric or Kronecker tensor
-
isKroneckerOrMetric
public static boolean isKroneckerOrMetric(SimpleTensor t)
Returnstrueif specified tensor is metric or Kronecker tensor- Parameters:
t- tensor- Returns:
trueif specified tensor is metric or Kronecker tensor
-
parse
public static Tensor parse(java.lang.String expression)
Converts string expression into tensor.- Parameters:
expression- string to be parsed- Returns:
- result of parsing
- Throws:
ParserException- if expression does not satisfy correct Redberry input notation for tensors
-
parse
public static Tensor parse(int i)
Converts int value to Complex.- Parameters:
i- integer- Returns:
- same Complex
-
parse
public static Tensor parse(long i)
Converts long value to Complex.- Parameters:
i- long integer- Returns:
- same Complex
-
parse
public static Tensor parse(double i)
Converts double value to Complex.- Parameters:
i- double- Returns:
- same Complex
-
parse
public static Tensor parse(float i)
Converts float value to Complex.- Parameters:
i- float- Returns:
- same Complex
-
parse
public static Tensor[] parse(java.lang.String... expressions)
Converts array of string expressions into array of tensors.- Parameters:
expressions- array of strings to be parsed- Returns:
- array of parsed tensors
- Throws:
ParserException- if expression does not satisfy correct Redberry input notation for tensors
-
parse
public static Tensor parse(java.lang.String expression, ParseTokenTransformer... preprocessors)
Converts string expression into tensor, additionally transforming AST according to specified AST transformers.- Parameters:
expression- string to be parsedpreprocessors- AST transformers- Returns:
- result of parsing
- Throws:
ParserException- if expression does not satisfy correct Redberry input notation for tensors
-
parseSimple
public static SimpleTensor parseSimple(java.lang.String expression)
Converts a string into simple tensor.- Parameters:
expression- string to be parsed- Returns:
- simple tensor
- Throws:
java.lang.IllegalArgumentException- if expression does not represents simple tensorParserException- if expression does not satisfy correct Redberry input notation for tensors
-
parseExpression
public static Expression parseExpression(java.lang.String expression)
Converts a string intoExpression.- Parameters:
expression- string to be parsed- Returns:
- simple tensor
- Throws:
java.lang.IllegalArgumentException- if string expression does not representsExpressionParserException- if expression does not satisfy correct Redberry input notation for tensors
-
addSymmetry
public static void addSymmetry(java.lang.String tensor, IndexType type, Permutation permutation)Attaches symmetry to simple tensor with respect to indices of specified type.- Parameters:
tensor- string representation of simple tensortype- type of indicespermutation- permutation- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if degree of permutation differs from the size of indices of specified type
-
addSymmetry
public static void addSymmetry(SimpleTensor tensor, IndexType type, Permutation permutation)
Attaches symmetry to simple tensor with respect to indices of specified type.- Parameters:
tensor- simple tensortype- type of indicespermutation- permutation- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if degree of specified permutation differs from the size of indices of specified type
-
addSymmetry
public static void addSymmetry(SimpleTensor tensor, Permutation permutation)
Attaches symmetry to simple tensor.- Parameters:
tensor- simple tensorpermutation- permutation- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if degree of specified permutation differs from the size of indices of specified tensor
-
addSymmetry
public static void addSymmetry(java.lang.String tensor, Permutation permutation)Attaches symmetry to simple tensor.- Parameters:
tensor- string representation of simple tensorpermutation- permutation- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if degree of specified permutation differs from the size of indices of specified tensor
-
addSymmetries
public static void addSymmetries(SimpleTensor tensor, Permutation... permutations)
Attaches symmetries to simple tensor.- Parameters:
tensor- simple tensorpermutations- permutations- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if degree of some permutation differs from the size of indices of specified tensor
-
addSymmetries
public static void addSymmetries(java.lang.String tensor, Permutation... permutations)Attaches symmetris to simple tensor.- Parameters:
tensor- string representation of simple tensorpermutations- permutations- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if degree of some permutation differs from the size of indices of specified tensor
-
addSymmetry
public static void addSymmetry(java.lang.String tensor, IndexType type, boolean sign, int... permutation)Attaches symmetry to simple tensor with respect to indices of specified type.- Parameters:
tensor- string representation of simple tensorpermutation- permutationsign-truefor antisymmetry,falsefor symmetrytype- type of indices- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if specified permutation is inconsistent with one-line notationjava.lang.IllegalArgumentException- if order of specified permutation is odd and sign istruejava.lang.IllegalArgumentException- if degree of specified permutation differs from the size of indices of specified type
-
addSymmetry
public static void addSymmetry(SimpleTensor tensor, IndexType type, boolean sign, int... permutation)
Attaches symmetry to simple tensor with respect to indices of specified type.- Parameters:
tensor- simple tensorpermutation- permutationsign-truefor antisymmetry,falsefor symmetrytype- type of indices- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if specified permutation is inconsistent with one-line notationjava.lang.IllegalArgumentException- if order of specified permutation is odd and sign istruejava.lang.IllegalArgumentException- if degree of specified permutation differs from the size of indices of specified type
-
addSymmetry
public static void addSymmetry(java.lang.String tensor, IndexType type, int... permutation)Attaches symmetry to simple tensor with respect to indices of specified type.- Parameters:
tensor- string representation of simple tensorpermutation- permutationtype- type of indices- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if specified permutation is inconsistent with one-line notationjava.lang.IllegalArgumentException- if degree of specified permutation differs from the size of indices of specified type
-
addSymmetry
public static void addSymmetry(SimpleTensor tensor, IndexType type, int... permutation)
Attaches symmetry to simple tensor with respect to indices of specified type.- Parameters:
tensor- simple tensorpermutation- permutationtype- type of indices- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if specified permutation is inconsistent with one-line notationjava.lang.IllegalArgumentException- if degree of specified permutation differs from the size of indices of specified type
-
addAntiSymmetry
public static void addAntiSymmetry(java.lang.String tensor, IndexType type, int... permutation)Attaches antisymmetry to simple tensor with respect to indices of specified type.- Parameters:
tensor- string representation of simple tensorpermutation- permutationtype- type of indices- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if specified permutation is inconsistent with one-line notationjava.lang.IllegalArgumentException- if order of specified permutation is oddjava.lang.IllegalArgumentException- if degree of specified permutation differs from the size of indices of specified type
-
addAntiSymmetry
public static void addAntiSymmetry(SimpleTensor tensor, IndexType type, int... permutation)
Attaches antisymmetry to simple tensor with respect to indices of specified type.- Parameters:
tensor- simple tensorpermutation- permutationtype- type of indices- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if specified permutation is inconsistent with one-line notationjava.lang.IllegalArgumentException- if order of specified permutation is oddjava.lang.IllegalArgumentException- if degree of specified permutation differs from the size of indices of specified type
-
addSymmetry
public static void addSymmetry(java.lang.String tensor, int... permutation)Attaches symmetry to simple tensor.- Parameters:
tensor- string representation of simple tensorpermutation- permutation- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if specified permutation is inconsistent with one-line notationjava.lang.IllegalArgumentException- if degree of specified permutation differs from the size of indices of specified tensor
-
addSymmetry
public static void addSymmetry(SimpleTensor tensor, int... permutation)
Attaches symmetry to simple tensor.- Parameters:
tensor- simple tensorpermutation- permutation- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if specified permutation is inconsistent with one-line notationjava.lang.IllegalArgumentException- if degree of specified permutation differs from the size of indices of specified tensor
-
addAntiSymmetry
public static void addAntiSymmetry(java.lang.String tensor, int... permutation)Attaches antisymmetry to simple tensor.- Parameters:
tensor- string representation of simple tensorpermutation- permutation- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if specified permutation is inconsistent with one-line notationjava.lang.IllegalArgumentException- if order of specified permutation is oddjava.lang.IllegalArgumentException- if degree of specified permutation differs from the size of indices of specified tensor
-
addAntiSymmetry
public static void addAntiSymmetry(SimpleTensor tensor, int... permutation)
Attaches antisymmetry to simple tensor.- Parameters:
tensor- simple tensorpermutation- permutation- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)java.lang.IllegalArgumentException- if specified permutation is inconsistent with one-line notationjava.lang.IllegalArgumentException- if order of specified permutation is oddjava.lang.IllegalArgumentException- if degree of specified permutation differs from the size of indices of specified tensor
-
setAntiSymmetric
public static void setAntiSymmetric(SimpleTensor tensor, IndexType type)
Makes simple tensor antisymmetric with respect to indices of specified type.- Parameters:
tensor- simple tensortype- type of indices- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)
-
setAntiSymmetric
public static void setAntiSymmetric(SimpleTensor tensor)
Makes simple tensor antisymmetric.- Parameters:
tensor- simple tensor- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)
-
setAntiSymmetric
public static void setAntiSymmetric(java.lang.String tensor)
Makes simple tensor antisymmetric.- Parameters:
tensor- string representation of simple tensor- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)
-
setAntiSymmetric
public static void setAntiSymmetric(java.lang.Object... tensors)
Makes simple tensors antisymmetric.- Parameters:
tensors- string representation of simple tensor- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)
-
setSymmetric
public static void setSymmetric(SimpleTensor tensor, IndexType type)
Makes simple tensor symmetric with respect to indices of specified type.- Parameters:
tensor- simple tensortype- type of indices- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)
-
setSymmetric
public static void setSymmetric(SimpleTensor tensor)
Makes simple tensor symmetric.- Parameters:
tensor- simple tensor- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)
-
setSymmetric
public static void setSymmetric(java.lang.String tensor)
Makes simple tensor symmetric.- Parameters:
tensor- string representation of simple tensor- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)
-
setSymmetric
public static void setSymmetric(java.lang.Object... tensors)
Makes simple tensors symmetric.- Parameters:
tensors- string representation of simple tensors- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)
-
setAntiSymmetric
public static void setAntiSymmetric(java.lang.String... tensors)
Makes simple tensors symmetric.- Parameters:
tensors- string representation of simple tensors- Throws:
java.lang.IllegalStateException- if this tensor is already in use (it's permutation group calculated)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG