Questions tagged [permutation]
For questions about the functionality related to permutations in Mathematica.
273
questions
3
votes
1
answer
91
views
Sort the arguments of a function using replace
I want to sort the arguments of a function f while multiplying with the signature of the permutation, i.e. f is totally antisymmetric function. My idea was something like
...
1
vote
1
answer
99
views
Can I improve my code to extract permutation cycles from a (n,2) matrix?
I've written a routine to extract permutation cycles from a (n,2) matrix, each row giving the format $a\to b$ which represents the first two elements in some $k$ cycle. If $a\to a$, it's a $1$-cycle. ...
5
votes
1
answer
161
views
Find permutation that satisfies conditions
Suppose you what to find a permutation of integers {1, 2, ..., 13} that satisfy some rules.
Rules can be found in variable rules....
2
votes
1
answer
94
views
Pattern Matching and Permutations
I am working with some math students on some problems involving permutations. My Mathematica knowledge is limited and I'm hoping to get some help. Two sample problems:
a)how many ways can the ...
1
vote
2
answers
118
views
How to determine if two colorings of a graph are the same?
A coloring of a graph $G$ with vertex set $V$ is the partitioning of $V$ into so-called color classes so that no two vertices of the same class are adjacent. A $k$-coloring contains exactly $k$ color ...
3
votes
4
answers
175
views
Replacing the heads of an expression in left to right order
I would like to replace the occurrences of the head f in an expression.
The expression only contains two possible heads: f and g.
These heads are applied to exactly two arguments.
Example:
...
2
votes
1
answer
81
views
Problem with permutations
For a given binary array like {0, 1, 1, 0,..}, I need to find the shortest permutation, sorting it in standard order ...
0
votes
1
answer
65
views
Permute subsystems of a matrix?
Suppose I have a matrix $M$ acts on the space $\mathbb C^4\otimes \mathbb C^2\otimes \mathbb C^4\otimes \mathbb C^3$. Is there a method to permute the 2nd subsystem of $M$ and the 4th subsystem of $M$?...
7
votes
9
answers
614
views
Rearrange triple sublists
Given a set of triple lists (all contain element 9!)
tripel = {{5, 10, 9}, {4, 9, 3}, {3, 9, 8}, {4, 5, 9}, {9, 10, 8}}
I would ...
9
votes
9
answers
932
views
Shuffling two lists into each other
Given a subset s of Range[n] and two lists a and b, with ...
1
vote
1
answer
84
views
Value of a function over permutations of two lists
I want to do the sum (in Ising lattice gauge theory)
...
3
votes
2
answers
178
views
Select a subset in the bit-strings with even 1s overlapped - thank you
Model 1
Consider the permutation list of 4-bit-strings:
list = Permutations[{0, 0, 1, 1}, {4}]
which outputs:
{{0, 0, 1, 1}, {0, 1, 0, 1}, {0, 1, 1, 0}, {1, 0, 0, ...
3
votes
1
answer
282
views
Thermodynamics of the 2D Ising model
I want to study the thermodynamics of the 2D Nearest Neighbour Ising model (calculate the average energy, susceptibility, etc.). I have the Hamiltonian
$$\mathcal{H} = J\sum_{\langle i j \rangle} s_i ...
4
votes
4
answers
261
views
How to confirm two sets contain the same vectors in any order?
Say if I have two sets of vectors, for example:
$$v_{1}=((0,0,0),(0,1,0),(0,0,1),(1,1,1))$$
$$v_{2}=((0,1,0),(1,1,1),(0,0,0),(0,0,1))$$
I want to find a way of verifying that both $v_{1}$ and $v_{2}$ ...
1
vote
1
answer
93
views
Elements of a group that send one element to another
If I have a permutation group, say $S_{10}$, how do I get all the permutations that send the set {1, 2, 3} to {5, 6, 7}? I know ...
4
votes
3
answers
212
views
How to list all subgroups of symmetry group S_6?
I learned from https://oeis.org/A005432 that $S_6$ has $1455$ subgroups, how can I list them all in mathematica?
As the comment says, the direct approach cannot solve the problem.
5
votes
3
answers
129
views
Implementing symmetry assumptions in FullSimplify
I want to symmetrise a long expression, M, that involves a function of 4 arguments, f[u1,u2,d1,d2], and its products (for ...
0
votes
0
answers
40
views
Put together all possible combinations of a set of functions, variables, and operators
Using a set of functions, variables, and operators, I'm trying to assemble all of the possible combinations starting with the shortest combination and ending with the longest combination. For example, ...
0
votes
1
answer
166
views
Summation over permutation: $\sum_{\sigma \in S_N} \mathrm{sgn}(\sigma) \prod_{i=1}^N x_{i+\sigma(i)}$
Let $N$ be a natural number, and $S_N$ be the symmetric group over $\{1, \ldots, N\}$. I want to compute
$$\sum_{\sigma \in S_N} \mathrm{sgn}(\sigma) \prod_{i=1}^N x_{i+\sigma(i)}$$
for small $N$ ...
4
votes
2
answers
391
views
How to generate all permutation matrices for 4 qubits?
In quantum mechanics, a qubit can be understood as a 2 by 1 vector denoted by Dirac notation as $$|0\rangle \equiv \left( \begin{array}{c}
1\\
0\\
\end{array} \right) ,|1\rangle \equiv \left( \...
1
vote
1
answer
207
views
Arrange 1-n^2 in n×n grid satisfy products of rows equal to products columns
For which $n\in\mathbb{N}$ is it possible to arrange $\{1,…,n^2\}$ in an $n\times n$ grid so that the set of products of columns equals the set of products of rows?
I can find solution for $3\times 3$ ...
1
vote
2
answers
127
views
Delete the subsets containing the same $2$ integers present in other subsets
From my previous question, if I consider a list like this:
$\{$$\{$$\{$$1,2,3$$\}$,$\{$$4,5,6$$\}$$\}$,
$\{$$\{$$1,2,4$$\}$,$\{$$3,5,6$$\}$$\}$,
$\{$$\{$$1,2,5$$\}$,$\{$$3,4,6$$\}$$\}$,
$\{$$\{$$1,2,6$...
2
votes
1
answer
94
views
Cycle symmetric Sort for arguments of a function. Put trace in canonical order
I need a new Sort for the arguments of TR that maintains cyclicity, TR[a,b,c] = TR[b,c,a] = TR[c,a,b]
cyclicSort[TR[b,a,c]]
TR[a,c,b]
...
7
votes
3
answers
245
views
Permutations with subsets not containing the same elements
I would like to define a function of two integer variables $ \{n, k\} $, with $ k | n $, that would print all the possible permutations of the first $ n$ positive integers, such that the subsets of $ ...
4
votes
2
answers
182
views
Generating all possible 2x2 matrices with unique elements from 1 to 4
If I have a set A={1,2,3,4}, how do I generate all 2x2 matrices with different elements chosen from ...
4
votes
2
answers
167
views
Finding coefficients that impose symmetry
To simplify the main question below,consider the following random multivariate polynomial :
...
1
vote
2
answers
140
views
How to get all necklaces without the full permutations' set?
There are previous posts, such as Delete duplicates from list of lists as if on a necklace,
that give a way to find all necklaces from a set of lists. The methods presented there work well for a small ...
3
votes
4
answers
250
views
Working with tables: add new level of nested tables
I am trying to obtain all possible combinations of elements in a (long) list
factors = {A, B, C};
getCombinations[factors,n]
For n = 3 factors, it should give
<...
6
votes
6
answers
265
views
How to efficiently find all element combination including a certain element in the list
I have the following list :
alist={{5, 6, 7}, {7, 6, 8}, {5, 7, 25}, {7, 8, 26}, {7, 26, 25}, {5, 4, 6}, {4, 12, 6}, {6, 12, 13}, {6, 13, 8}}
I want to find all ...
0
votes
0
answers
48
views
Arranging 4 identical items in 7 spots [closed]
There are 4 unique items, for the sake of the example call them balls. Each ball is exactly the same, and we need to see how many different ways those 4 balls can fit in those 7 slots.
I am not sure ...