Package cc.redberry.core.combinatorics

Examples of cc.redberry.core.combinatorics.Symmetry


        for (int j = 0; j < data.length; ++j, ++i)
            s[i] = symmetry.newIndexOf(j) + data.from;
        for (; i < indicesTypeStructure.size(); ++i)
            s[i] = i;
        try {
            if (symmetries.add(new Symmetry(s, symmetry.isAntiSymmetry()))) {
                diffIds = null;
                return true;
            }
            return false;
        } catch (InconsistentGeneratorsException exception) {
View Full Code Here


            s[i] = i;
        for (int j = 0; j < data.length; ++j, ++i)
            s[i] = symmetry.newIndexOf(j) + data.from;
        for (; i < indicesTypeStructure.size(); ++i)
            s[i] = i;
        symmetries.addUnsafe(new Symmetry(s, symmetry.isAntiSymmetry()));
        return true;
    }
View Full Code Here

*/
class EmptySymmetries extends DummySymmetries {

    EmptySymmetries(int dimension) {
        super(dimension,
              Collections.unmodifiableList(Arrays.asList(new Symmetry(dimension))));
        assert dimension == 0 || dimension == 1;
    }
View Full Code Here

        for (Symmetries ss : this.symmetries) {
            final List<Symmetry> basis = ss.getBasisSymmetries();
            //iterating from 1 because zero'th element is always identity symmetry
            for (k = 1; k < basis.size(); ++k) {
                c = new int[data.length];
                Symmetry s = basis.get(k);
                for (j = 0; j < data.length; ++j)
                    if (cosort[j] < position || cosort[j] >= position + s.dimension())
                        c[j] = j;
                    else
                        c[j] = cosortInv[s.newIndexOf(cosort[j] - position) + position];
                resultingSymmetries.addUnsafe(UnsafeCombinatorics.createUnsafe(c, s.isAntiSymmetry()));
            }
            //increasing position in the total symmetry array
            position += ss.dimension();
        }
View Full Code Here

                continue;
            if (typeData.length == 0)//redundant
                continue;
            int cpunt = random.nextInt(4);
            for (i = 0; i < cpunt; ++i)
                descriptor.getSymmetries().addUnsafe(type, new Symmetry(nextPermutation(typeData.length), false));
        }
    }
View Full Code Here

        }

        if (symmetryIterator != null) {
            OUT:
            while (symmetryIterator.hasNext()) {
                Symmetry s = symmetryIterator.next();
                IndexMappingBuffer tempBuffer = currentBuffer.clone();
                for (int i = 0; i < size; ++i)
                    if (!tempBuffer.tryMap(fromIndices.get(s.newIndexOf(i)), toIndices.get(i)))
                        continue OUT;
                tempBuffer.addSign(s.isAntiSymmetry());
                return tempBuffer;
            }
            symmetryIterator = null;
            currentBuffer = null;
            return null;
View Full Code Here

            Map<IntArray, Boolean> symmetries = getEpsilonSymmetries(indices.length);

            //symmetries of product, which is contracted with Levi-Civita
            MappingsPort port = IndexMappings.createPort(temp, temp);
            IndexMappingBuffer buffer;
            Symmetry sym;

            //check for two symmetric indices of product contracted with two antisymmetric indices of eps
            while ((buffer = port.take()) != null) {
                //symmetry of product indices
                sym = TensorUtils.getSymmetryFromMapping(indices, buffer);
                //if symmetry mixes indices of product, which are not contracted with eps
                if (!checkNonPermutingPositions(sym, nonPermutableArray))
                    continue;
                //bingo!
                if (sym.isAntiSymmetry() != symmetries.get(sym.getPermutation()))
                    return Complex.ZERO;
            }

        }
View Full Code Here

        Map<IntArray, Boolean> symmetries = cachedLeviCivitaSymmetries.get(indicesSize);
        if (symmetries != null)
            return symmetries;
        symmetries = new HashMap<>();
        Symmetries ss = SymmetriesFactory.createSymmetries(indicesSize);
        ss.addUnsafe(new Symmetry(Combinatorics.createTransposition(indicesSize, 0, 1), true));
        if (indicesSize % 2 == 0)
            ss.addUnsafe(new Symmetry(Combinatorics.createCycle(indicesSize), true));
        else
            ss.addUnsafe(new Symmetry(Combinatorics.createCycle(indicesSize), false));
        for (Symmetry symmetry : ss)
            symmetries.put(symmetry.getPermutation(), symmetry.isAntiSymmetry());
        cachedLeviCivitaSymmetries.put(indicesSize, symmetries);
        return symmetries;
    }
View Full Code Here

            Map<IntArray, Boolean> symmetries = getEpsilonSymmetries(indices.length);

            //symmetries of product, which is contracted with Levi-Civita
            MappingsPort port = IndexMappings.createPort(temp, temp);
            IndexMappingBuffer buffer;
            Symmetry sym;

            //check for two symmetric indices of product contracted with two antisymmetric indices of eps
            while ((buffer = port.take()) != null) {
                //symmetry of product indices
                sym = TensorUtils.getSymmetryFromMapping(indices, buffer);
                //if symmetry mixes indices of product, which are not contracted with eps
                if (!checkNonPermutingPositions(sym, nonPermutableArray))
                    continue;
                //bingo!
                if (sym.isAntiSymmetry() != symmetries.get(sym.getPermutation()))
                    return Complex.ZERO;
            }

        }
View Full Code Here

        Map<IntArray, Boolean> symmetries = cachedLeviCivitaSymmetries.get(indicesSize);
        if (symmetries != null)
            return symmetries;
        symmetries = new HashMap<>();
        Symmetries ss = SymmetriesFactory.createSymmetries(indicesSize);
        ss.addUnsafe(new Symmetry(Combinatorics.createTransposition(indicesSize, 0, 1), true));
        if (indicesSize % 2 == 0)
            ss.addUnsafe(new Symmetry(Combinatorics.createCycle(indicesSize), true));
        else
            ss.addUnsafe(new Symmetry(Combinatorics.createCycle(indicesSize), false));
        for (Symmetry symmetry : ss)
            symmetries.put(symmetry.getPermutation(), symmetry.isAntiSymmetry());
        cachedLeviCivitaSymmetries.put(indicesSize, symmetries);
        return symmetries;
    }
View Full Code Here

TOP

Related Classes of cc.redberry.core.combinatorics.Symmetry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.