Did I find the right examples for you? yes no

All Samples(88)  |  Call(73)  |  Derive(0)  |  Import(15)
A permutation, alternatively known as an 'arrangement number' or 'ordering'
is an arrangement of the elements of an ordered list into a one-to-one
mapping with itself. The permutation of a given arrangement is given by
indicating the positions of the elements after re-arrangment [2]_. For
example, if one started with elements [x, y, a, b] (in that order) and
they were reordered as [x, y, b, a] then the permutation would be
[0, 1, 3, 2]. Notice that (in SymPy) the first element is always referred
to as 0 and the permutation uses the indices of the elements in the
original ordering, not the elements (a, b, etc...) themselves.
(more...)

src/s/y/sympy-HEAD/sympy/combinatorics/perm_groups.py   sympy(Download)
 
from sympy.core import Basic
from sympy.combinatorics import Permutation
from sympy.combinatorics.permutations import (_af_commutes_with, _af_invert,
    _af_rmul, _af_rmuln, _af_pow, Cycle)
            'to define the group')
        if any(isinstance(a, Cycle) for a in args):
            args = [Permutation(a) for a in args]
        if has_variety(a.size for a in args):
            degree = kwargs.pop('degree', None)
            if degree is None:
                degree = max(a.size for a in args)
            for i in range(len(args)):
                if args[i].size != degree:
                    args[i] = Permutation(args[i], size=degree)
            if strict:
                return False
            g = Permutation(g, size=self.degree)
        if g in self.generators:
            return True
 
        # start with the identity permutation
        result = Permutation(list(range(self.degree)))
        m = len(self)
        for i in range(n):

src/s/y/sympy-0.7.5/sympy/combinatorics/perm_groups.py   sympy(Download)
 
from sympy.core import Basic
from sympy.combinatorics import Permutation
from sympy.combinatorics.permutations import (_af_commutes_with, _af_invert,
    _af_rmul, _af_rmuln, _af_pow, Cycle)
            'to define the group')
        if any(isinstance(a, Cycle) for a in args):
            args = [Permutation(a) for a in args]
        if has_variety(a.size for a in args):
            degree = kwargs.pop('degree', None)
            if degree is None:
                degree = max(a.size for a in args)
            for i in range(len(args)):
                if args[i].size != degree:
                    args[i] = Permutation(args[i], size=degree)
            if strict:
                return False
            g = Permutation(g, size=self.degree)
        if g in self.generators:
            return True
 
        # start with the identity permutation
        result = Permutation(list(range(self.degree)))
        m = len(self)
        for i in range(n):

src/s/y/sympy-HEAD/sympy/combinatorics/polyhedron.py   sympy(Download)
from __future__ import print_function, division
 
from sympy.core import Basic, Tuple, FiniteSet
from sympy.core.compatibility import as_int
from sympy.combinatorics import Permutation as Perm
        # use the identity permutation if none are given
        obj._pgroup = PermutationGroup((
            pgroup or [Perm(range(len(corners)))] ))
        return obj
 
            # map face to vertex: the resulting list of vertices are the
            # permutation that we seek for the double
            new_pgroup.append(Perm([fmap[f] for f in reorder]))
        return new_pgroup
 
    #
    _t_pgroup = [
        Perm([[1, 2, 3], [0]]),  # cw from top
        Perm([[0, 1, 2], [3]]),  # cw from front face
        Perm([[0, 3, 2], [1]]),  # cw from back right face

src/s/y/sympy-0.7.5/sympy/combinatorics/polyhedron.py   sympy(Download)
from __future__ import print_function, division
 
from sympy.core import Basic, Tuple, FiniteSet
from sympy.core.compatibility import as_int
from sympy.combinatorics import Permutation as Perm
        # use the identity permutation if none are given
        obj._pgroup = PermutationGroup((
            pgroup or [Perm(range(len(corners)))] ))
        return obj
 
            # map face to vertex: the resulting list of vertices are the
            # permutation that we seek for the double
            new_pgroup.append(Perm([fmap[f] for f in reorder]))
        return new_pgroup
 
    #
    _t_pgroup = [
        Perm([[1, 2, 3], [0]]),  # cw from top
        Perm([[0, 1, 2], [3]]),  # cw from front face
        Perm([[0, 3, 2], [1]]),  # cw from back right face

src/s/y/sympy-HEAD/sympy/tensor/tensor.py   sympy(Download)
    >>> V = S2('V')
    """
    from sympy.combinatorics import Permutation
    def tableau2bsgs(a):
        if len(a) == 1:
 
    if not args:
        return TensorSymmetry([[], [Permutation(1)]])
    if len(args) == 2 and isinstance(args[1][0], Permutation):
        return TensorSymmetry(args)

src/s/y/sympy-0.7.5/sympy/tensor/tensor.py   sympy(Download)
    >>> V = S2('V')
    """
    from sympy.combinatorics import Permutation
 
    def tableau2bsgs(a):
 
    if not args:
        return TensorSymmetry(Tuple(), Tuple(Permutation(1)))
 
    if len(args) == 2 and isinstance(args[1][0], Permutation):

src/s/y/sympy-HEAD/sympy/printing/tests/test_str.py   sympy(Download)
def test_Permutation_Cycle():
    from sympy.combinatorics import Permutation, Cycle
 
    # general principle: economically, canonically show all moved elements
    # and the size of the permutation.
    Permutation.print_cyclic = False
    for p, s in [
        (Permutation([]),
        'Permutation([])'),
        (Permutation([], size=1),
        'Permutation([0])'),
        (Permutation([], size=2),
        'Permutation([0, 1])'),
        (Permutation([], size=10),

src/s/y/sympy-0.7.5/sympy/printing/tests/test_str.py   sympy(Download)
def test_Permutation_Cycle():
    from sympy.combinatorics import Permutation, Cycle
 
    # general principle: economically, canonically show all moved elements
    # and the size of the permutation.
    Permutation.print_cyclic = False
    for p, s in [
        (Permutation([]),
        'Permutation([])'),
        (Permutation([], size=1),
        'Permutation([0])'),
        (Permutation([], size=2),
        'Permutation([0, 1])'),
        (Permutation([], size=10),

src/s/y/sympy-HEAD/sympy/diffgeom/diffgeom.py   sympy(Download)
from sympy.simplify import simplify
from sympy.core.compatibility import reduce
from sympy.combinatorics import Permutation
 
# TODO you are a bit excessive in the use of Dummies

src/s/y/sympy-0.7.5/sympy/diffgeom/diffgeom.py   sympy(Download)
from sympy.simplify import simplify
from sympy.core.compatibility import reduce
from sympy.combinatorics import Permutation
 
# TODO you are a bit excessive in the use of Dummies

  1 | 2  Next