Package cc.redberry.core.groups.permutations

Examples of cc.redberry.core.groups.permutations.PermutationGroup


        Iterator<Permutation> cosetRepresentatives;
        BigInteger factor;
        //for a simple tensors we can compute coset representatives directly:
        if (t instanceof SimpleTensor) {
            PermutationGroup t_group =
                    conjugatedSymmetriesOfSubIndices(((SimpleTensor) t).getIndices());
            PermutationGroup union = t_group.union(indicesGroup);
            Permutation[] reps = union.leftCosetRepresentatives(t_group);
            cosetRepresentatives = new ArrayIterator<>(reps);
            factor = BigInteger.valueOf(reps.length);
        } else {
            //in case of multitensor, we do not know its group of symmetries
            //if the resulting symmetries are small, then we'll just apply all of them
            if (indicesGroup.order().compareTo(SMALL_ORDER_MAX_VALUE) < 0) {
                cosetRepresentatives = indicesGroup.iterator();
                factor = indicesGroup.order();
            } else {
                //otherwise we might will be more lucky if compute it group of symmetries and then compute coset reps.
                PermutationGroup t_group = PermutationGroup.createPermutationGroup(
                        TensorUtils.findIndicesSymmetries(indices, t));
                PermutationGroup union = t_group.union(indicesGroup);
                Permutation[] reps = union.leftCosetRepresentatives(t_group);
                cosetRepresentatives = new ArrayIterator<>(reps);
                factor = BigInteger.valueOf(reps.length);
            }
        }
View Full Code Here


            else {
                nonStabilizedPoints[nPointer] = s;
                mapping[nPointer++] = index;
            }
        }
        PermutationGroup result = allIndices.getSymmetries().getPermutationGroup().
                pointwiseStabilizerRestricted(stabilizedPoints);
        return result.conjugate(Permutations.createPermutation(mapping));
    }
View Full Code Here

     *                                         calculated)
     */
    public void setSymmetric() {
        if (permutationGroup != null)
            throw new IllegalStateException("Permutation group is already in use.");
        PermutationGroup sym = null;
        int[] counts = structureOfIndices.getTypesCounts();
        for (int c : counts) {
            if (c != 0)
                if (sym == null)
                    sym = PermutationGroup.symmetricGroup(c);
                else
                    sym = sym.directProduct(PermutationGroup.symmetricGroup(c));

        }

        permutationGroup = sym;
        generators.clear();
        generators.addAll(sym.generators());
    }
View Full Code Here

     *                                         calculated)
     */
    public void setAntiSymmetric() {
        if (permutationGroup != null)
            throw new IllegalStateException("Permutation group is already in use.");
        PermutationGroup sym = null;
        int[] counts = structureOfIndices.getTypesCounts();
        for (int c : counts) {
            if (c != 0) {
                if (sym == null)
                    sym = PermutationGroup.antisymmetricGroup(c);
                else
                    sym = sym.directProduct(PermutationGroup.antisymmetricGroup(c));
            }

        }

        permutationGroup = sym;
        generators.clear();
        generators.addAll(sym.generators());
    }
View Full Code Here

    private static Map<Permutation, Boolean> getEpsilonSymmetries(int indicesSize) {
        Map<Permutation, Boolean> symmetries = cachedLeviCivitaSymmetries.get(indicesSize);
        if (symmetries != null)
            return symmetries;
        symmetries = new HashMap<>();
        PermutationGroup lc = PermutationGroup.antisymmetricGroup(indicesSize);
        for (Permutation symmetry : lc)
            symmetries.put(symmetry.toSymmetry(), symmetry.antisymmetry());
        cachedLeviCivitaSymmetries.put(indicesSize, symmetries);
        return symmetries;
    }
View Full Code Here

TOP

Related Classes of cc.redberry.core.groups.permutations.PermutationGroup

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.