cc.redberry.core.indices
Class IndicesSymmetries
- java.lang.Object
-
- cc.redberry.core.indices.IndicesSymmetries
-
public final class IndicesSymmetries extends java.lang.ObjectWrapper ofPermutationGroupthat holds symmetries of indices. This class aggregates symmetries added via methodsadd(...)and calculate permutation group generated by these symmetries on the invocation of methodsgetPermutationGroup(),getPositionsInOrbits()etc. After permutation group was calculated the modification of symmetries is forbidden: all methodsadd(...)will throwIllegalStateException.- Since:
- 1.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(boolean sign, int[] permutation)Adds specified symmetry written in one-line notation to this symmetries.voidadd(byte type, boolean sign, int... permutation)Adds specified symmetry written in one-line notation to symmetries of indices of specified type.voidadd(IndexType type, boolean sign, int... permutation)Adds specified symmetry written in one-line notation to symmetries of indices of specified type.voidaddAll(java.util.Collection<Permutation> symmetry)Adds specified symmetries to this.voidaddAntiSymmetry(IndexType type, int... permutation)Adds specified antisymmetry written in one-line notation to symmetries of indices of specified type.voidaddAntiSymmetry(int... permutation)Adds specified antisymmetry written in one-line notation to this symmetries.voidaddSymmetries(java.util.Collection<Permutation> symmetries)Adds specified symmetries to this.voidaddSymmetries(Permutation... symmetries)Adds specified symmetries to this.voidaddSymmetry(byte type, Permutation symmetry)Adds specified symmetry to symmetries of indices of specified type.voidaddSymmetry(IndexType type, int... permutation)Adds specified permutation written in one-line notation to symmetries of indices of specified type.voidaddSymmetry(int... permutation)Adds specified permutation written in one-line notation to this symmetries.voidaddSymmetry(Permutation symmetry)Adds specified symmetry to this.booleanavailableForModification()Returnstrueif one can add new symmetries to this, orfalse, if this symmetries is already in use in some tensors; in latter case, the invocation of methodadd(...)will throw exception.IndicesSymmetriesclone()static IndicesSymmetriescreate(StructureOfIndices structureOfIndices)Creates symmetries with empty generating set.static IndicesSymmetriescreate(StructureOfIndices structureOfIndices, java.util.List<Permutation> generators)Creates symmetries of indices with specified structure and with specified generating set.static IndicesSymmetriescreate(StructureOfIndices structureOfIndices, PermutationGroup group)Creates symmetries of indices with specified structure and with specified permutation group.static IndicesSymmetriesgetEmpty()For indices with zero lengthjava.util.List<Permutation>getGenerators()Returns generating set (unmodifiable) of this symmetries.PermutationGroupgetPermutationGroup()Returns a permutation group that represents symmetries of this indices.short[]getPositionsInOrbits()Returns positions of indices in the array of orbits of underlying permutation group.StructureOfIndicesgetStructureOfIndices()Returns underlying structure of indices.booleanisTrivial()Returnstrueif all generators are identity (and, consequently, the underlying permutation group is trivial) and false otherwise.voidsetAntiSymmetric()Makes thissymmetriestotally antisymmetric in all its indices (for each type).voidsetSymmetric()Makes thissymmetriestotally symmetric in all its indices (for each type).java.lang.StringtoString()
-
-
-
Method Detail
-
create
public static IndicesSymmetries create(StructureOfIndices structureOfIndices)
Creates symmetries with empty generating set.- Parameters:
structureOfIndices- structure of indices for which this symmetries can be assigned- Returns:
- symmetries with empty generating set for indices with specified structure
-
create
public static IndicesSymmetries create(StructureOfIndices structureOfIndices, PermutationGroup group)
Creates symmetries of indices with specified structure and with specified permutation group.- Parameters:
structureOfIndices- structure of indices for which this symmetries can be assignedgroup- permutation group- Returns:
- symmetries with specified permutation group for indices with specified structure
- Throws:
java.lang.IllegalArgumentException- ifgroup.degree() != structureOfIndices.size()
-
create
public static IndicesSymmetries create(StructureOfIndices structureOfIndices, java.util.List<Permutation> generators)
Creates symmetries of indices with specified structure and with specified generating set.- Parameters:
structureOfIndices- structure of indices for which this symmetries can be assignedgenerators- generating set- Returns:
- symmetries with specified generating set for indices with specified structure
- Throws:
java.lang.IllegalArgumentException- if some generator ingeneratorshave degree different from size ofstructureOfIndices
-
getStructureOfIndices
public StructureOfIndices getStructureOfIndices()
Returns underlying structure of indices.- Returns:
- structure of indices
-
getGenerators
public java.util.List<Permutation> getGenerators()
Returns generating set (unmodifiable) of this symmetries.- Returns:
- generating set (unmodifiable) of this symmetries
-
getPermutationGroup
public PermutationGroup getPermutationGroup()
Returns a permutation group that represents symmetries of this indices. The invocation of this method makes this instance unmodifiable, i.e. invocation of methodadd(...)after invocation of this method will cause exception.- Returns:
- permutation group that represents symmetries of this indices
-
getPositionsInOrbits
public short[] getPositionsInOrbits()
Returns positions of indices in the array of orbits of underlying permutation group. Specifically, this method returnsPermutationGroup.getPositionsInOrbits()converted toshort[]. This method returns same reference each time; so, if one will use the returned array, do not forget to clone it, The invocation of this method makes this instance unmodifiable, i.e. invocation of methodadd(...)after invocation of this method will cause exception.- Returns:
- positions of indices in the array of orbits of underlying permutation group
- See Also:
PermutationGroup.getPositionsInOrbits()
-
isTrivial
public final boolean isTrivial()
Returnstrueif all generators are identity (and, consequently, the underlying permutation group is trivial) and false otherwise.- Returns:
trueif all generators are identity
-
availableForModification
public boolean availableForModification()
Returnstrueif one can add new symmetries to this, orfalse, if this symmetries is already in use in some tensors; in latter case, the invocation of methodadd(...)will throw exception.- Returns:
trueif one can add new symmetries to this, orfalse, if this symmetries is already in use in some tensors; in latter case, the invocation of methodadd(...)will throw exception.
-
addSymmetry
public void addSymmetry(int... permutation)
Adds specified permutation written in one-line notation to this symmetries.- Parameters:
permutation- permutation written in one-line notation- Throws:
java.lang.IllegalStateException- if this instance of symmetries is already in use (permutation group calculated)java.lang.IllegalArgumentException- if specified permutation is inconsistent with one-line notationjava.lang.IllegalArgumentException- if this structure of indices is inconsistent with specified permutation (permutation mixes indices of different types)
-
addAntiSymmetry
public void addAntiSymmetry(int... permutation)
Adds specified antisymmetry written in one-line notation to this symmetries.- Parameters:
permutation- permutation written in one-line notation- Throws:
java.lang.IllegalStateException- if this instance of symmetries is already in use (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 this structure of indices is inconsistent with specified permutation (permutation mixes indices of different types)
-
add
public void add(boolean sign, int[] permutation)Adds specified symmetry written in one-line notation to this symmetries.- Parameters:
sign-truefor antisymmetry,falsefor symmetrypermutation- permutation written in one-line notation- Throws:
java.lang.IllegalStateException- if this instance of symmetries is already in use (permutation group calculated)java.lang.IllegalArgumentException- if specified permutation is inconsistent with one-line notationjava.lang.IllegalArgumentException- when inputting antisymmetry with odd orderjava.lang.IllegalArgumentException- if this structure of indices is inconsistent with specified permutation (permutation mixes indices of different types)
-
addSymmetry
public void addSymmetry(IndexType type, int... permutation)
Adds specified permutation written in one-line notation to symmetries of indices of specified type.- Parameters:
type- type of indicespermutation- permutation written in one-line notation- Throws:
java.lang.IllegalStateException- if this instance of symmetries is already in use (permutation group calculated)java.lang.IllegalArgumentException- if specified permutation is inconsistent with one-line notationjava.lang.IllegalArgumentException- if length of specified permutation differs from the size of indices of specified type
-
addAntiSymmetry
public void addAntiSymmetry(IndexType type, int... permutation)
Adds specified antisymmetry written in one-line notation to symmetries of indices of specified type.- Parameters:
type- type of indicespermutation- permutation written in one-line notation- Throws:
java.lang.IllegalStateException- if this instance of symmetries is already in use (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 length of specified permutation differs from the size of indices of specified type
-
add
public void add(IndexType type, boolean sign, int... permutation)
Adds specified symmetry written in one-line notation to symmetries of indices of specified type.- Parameters:
type- type of indicessign-truefor antisymmetry,falsefor symmetrypermutation- permutation written in one-line notation- Throws:
java.lang.IllegalStateException- if this instance of symmetries is already in use (permutation group calculated)java.lang.IllegalArgumentException- if specified permutation is inconsistent with one-line notationjava.lang.IllegalArgumentException- when inputting antisymmetry with odd orderjava.lang.IllegalArgumentException- if length of specified permutation differs from the size of indices of specified type
-
add
public void add(byte type, boolean sign, int... permutation)Adds specified symmetry written in one-line notation to symmetries of indices of specified type.- Parameters:
type- type of indicessign-truefor antisymmetry,falsefor symmetrypermutation- permutation written in one-line notation- Throws:
java.lang.IllegalStateException- if this instance of symmetries is already in use (permutation group calculated)java.lang.IllegalArgumentException- if specified permutation is inconsistent with one-line notationjava.lang.IllegalArgumentException- when inputting antisymmetry with odd orderjava.lang.IllegalArgumentException- if length of specified permutation differs from the size of indices of specified type
-
addSymmetry
public void addSymmetry(byte type, Permutation symmetry)Adds specified symmetry to symmetries of indices of specified type.- Parameters:
type- type of indicessymmetry- symmetry- Throws:
java.lang.IllegalStateException- if this instance of symmetries is already in use (permutation group calculated)java.lang.IllegalArgumentException- if this structure of indices is inconsistent with specified permutation (permutation mixes indices of different types)
-
addSymmetry
public void addSymmetry(Permutation symmetry)
Adds specified symmetry to this.- Parameters:
symmetry- symmetry- Throws:
java.lang.IllegalStateException- if this instance of symmetries is already in use (permutation group calculated)java.lang.IllegalArgumentException- if this structure of indices is inconsistent with specified permutation (permutation mixes indices of different types)
-
addSymmetries
public void addSymmetries(Permutation... symmetries)
Adds specified symmetries to this.- Parameters:
symmetries- symmetries- Throws:
java.lang.IllegalStateException- if this instance of symmetries is already in use (permutation group calculated)java.lang.IllegalArgumentException- if this structure of indices is inconsistent with specified permutation (permutation mixes indices of different types)
-
addSymmetries
public void addSymmetries(java.util.Collection<Permutation> symmetries)
Adds specified symmetries to this.- Parameters:
symmetries- symmetries- Throws:
java.lang.IllegalStateException- if this instance of symmetries is already in use (permutation group calculated)java.lang.IllegalArgumentException- if this structure of indices is inconsistent with specified permutation (permutation mixes indices of different types)
-
addAll
public void addAll(java.util.Collection<Permutation> symmetry)
Adds specified symmetries to this.- Parameters:
symmetry- symmetry- Throws:
java.lang.IllegalStateException- if this instance of symmetries is already in use (permutation group calculated)java.lang.IllegalArgumentException- if this structure of indices is inconsistent with specified permutation (permutation mixes indices of different types)
-
setSymmetric
public void setSymmetric()
Makes thissymmetriestotally symmetric in all its indices (for each type). The invocation of this method makes this instance unmodifiable, i.e. invocation of methodadd(...)after invocation of this method will cause exception.- Throws:
java.lang.IllegalStateException- if this instance of symmetries is already in use (permutation group calculated)
-
setAntiSymmetric
public void setAntiSymmetric()
Makes thissymmetriestotally antisymmetric in all its indices (for each type). The invocation of this method makes this instance unmodifiable, i.e. invocation of methodadd(...)after invocation of this method will cause exception.- Throws:
java.lang.IllegalStateException- if this instance of symmetries is already in use (permutation group calculated)
-
clone
public IndicesSymmetries clone()
- Overrides:
clonein classjava.lang.Object
-
getEmpty
public static IndicesSymmetries getEmpty()
For indices with zero length
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG