I have a group defined by G := Group((1,2,3),(1,2,4),(5,6,7),(5,6,8),(1,2)(5,6));. How can I compute the equivalence classes of elements in G (or a representative of each equivalence class) with respect to the equivalence relation a ~ b <=> there exist integers m,n such that a = c^n b c^m, where c is some fixed element of G?
Related
Consider each function below such as f, f2, f3 and f4 with the basis I. How can we express each f such that f_i=\sum a_i I_i and each a_i\geq 0?
Example
We demonstrate the polynomials below with M2 and Mathematica.
Macaulay2:
i1 : R=RR[x1,x2,x3,MonomialOrder=>Lex];
f=x3-x1*x2;
f2=x3*x2-x1;
f3=x1-0.2;
f4=x1-x3+0.8;
i5 : I=ideal(x1-0.2,-x1+0.5,x2,-x2+1,x3-1,-x3+1); G=gb(I);
We can express f3 with elements of I, namely with zeroth term
i11 : I_0==f3
o11 = true
We can express f4 with I_5 and I_0
i17 : I_5+I_0==f4
o17 = true
Can we express f and f2 with I?
Mathematica: f and f-2 cannot be expressed in terms of the I but f-1 can be expressed in I but negative terms so cannot use Handelman's theorem on it.
but
f-2 is not non-negative (choose x3=1,x1=2 so 1-0-2=-1<0)
f is non-negative (x3=1 so 1-x1x2>0) and
f-1 is not non-negative (x3=1,x2>0 so -x1x2<0).
and by Handelman's theorem, all computations are inconclusive because the the third term -x1 is negative. More about Mathematica aspects here.
How can we express a polynomial in terms of other polynomials and each quotient term is positive like PolynomialReduce in Mathematica but each quotient term positive?
Note that in this answer, I am using your terminology, in which R is the polynomial ring and RR is the ring of real numbers. I should also say that almost never use the ring RR, since computations in macaulay2 over the real numbers are not always reliable, always use the ring of rationals QQ or a positive characteristic field like QQ/(101).
Your f and f2 polynomials are not linear, so you can not even write them as a linear combination of I_0,...,I_5 (i.e. the generators of I).
Furthermore the ideal I as you defined it contains a scalar so it is what mathematicians call the unit ideal. It means I=R, that is the whole polynomial ring.
So you can write f and f2 as a combination of I_0,...,I_5 but not a linear one.
It means that f = \sum g_i I_i with g_i polynomials where at least one of them is not a number.
Remark. For an arbitrary ring R, the elements are usually called scalars, but when R is a polynomial ring, let's say R=RR[x_1,...x_n] then usually the constant polynomials (which are exactly the real numbers, i.e. elements of RR) are called scalars. This is just a common and of course confusing terminology.
Here is an example,
i2 : R=QQ[x_1,x_2]
o2 = R
o2 : PolynomialRing
i3 : I=ideal(x_1-1,x_2,x_1+1)
o3 = ideal (x - 1, x , x + 1)
1 2 1
o3 : Ideal of R
i4 : I == R
o4 = true
i5 : J = ideal(x_1,x_2)
o5 = ideal (x , x )
1 2
o5 : Ideal of R
i6 : J == R
o6 = false
You see that the ideal I has x_1-1,x_2,x_1+1 so the element (x_1+1)-(x_1-1) = 2 also belongs to I, so I has a constant polynomial which is a unit element (a unit element in a ring is an element that has an inverse) which implies that I=R. For a proof of this fact visit, https://math.stackexchange.com/questions/552173/if-an-ideal-contains-the-unit-then-it-is-the-whole-ring
On the other hand J does not have any constant polynomial, so J is not the whole ring R.
Given a separable 2-qubit state
φ = φ0 ⊗ φ1
with
φi= ai0|0> + ai1|1>
φ thus can be written as
φ = b00|00> + b01|01> + b10|10> + b11|11>
with
bij = a0ia1j.
Now let some bij be given, i.e. an arbitrary 2-qubit state
φ = b00|00> + b01|01> + b10|10> + b11|11>
Let B = (bij). By Schmidt decomposition there are 2x2 matrices U, V, Σ, such that
U, V unitary
Σ positive semidefinite diagonal
B = U ∘ Σ ∘ V*
Let σ0, σ1 be the two diagonal elements of Σ.
The state φ = b00|00> + b01|01> + b10|10> + b11|11> is entangled if and only if σ0 + σ1 > 1.
QUESTION
Given a state φ = b00|00> + b01|01> + b10|10> + b11|11> and its Schmidt decomposition B = U ∘ Σ ∘ V*, such that σ0 + σ1 ≤ 1, i.e. the state is separable. This means there are φi= ai0|0> + ai1|1>, such that φ can be written as
φ = φ0 ⊗ φ1
How do I calculate A = (aij) from B = (bij), i.e. from U, V, Σ?
This is the reverse of
bij = a0ia1j
given that bij defines a separable state.
If you're given a pure state and promised that it's separable, you don't need the Schmidt decomposition to compute the parts. Just lay the amplitudes out in a grid, read off the proportions between the columns for one part and read off the proportions between the rows for the other.
That is to say, the statement that a 2-qubit system φ is separable so φ = αβ guarantees that φ₀₀/φ₀₁ = φ₁₀/φ₁₁ = β₀/β₁ and that φ₀₀/φ₁₀ = φ₀₁/φ₁₁ = α₀/α₁. And knowing α₀/α₁ is enough to solve for α, except for the global phase factor. (Note: work with proportions α₀:α₁ instead of ratios α₀/α₁ if α₁ might be zero.)
This generalizes to systems with more qubits. A given subset of qubits is separable if and only if grouping by all the other qubits gives you a bunch of parts with agreeing proportions between their pieces. And the proportions between the pieces constrain everything except the global phase factor.
Using the Schmidt decomposition as a shortcut
The Schmidt decomposition does make this easier. It does all the hard 'reconstructing the proportions' work. If a pure system is separable then its SVD decomposition should only have one non-zero singular value, and that singular value should equal 1. So you have something like:
|1 0 0 ...|
U |0 0 0 ...| V
|0 0 0 ...|
|... . ...|
But that's just multiplying the first column of U by the first row of V! So we have a system with n*m entries being created from a system with n entries and a system with m entries... Yup, the first column and the first row contain the amplitudes of α and β.
Example
My circuit simulator Quirk has built-in inline amplitude displays that perform this kind of separation (without doing an SVD). You can see the code that does it on github, though it's all GPU based so not particularly clear.
(It was by far the most complicated display to write, since it has to do the grouping then compare all the groups. But some groups might have no amplitude so they have to be ignored, and there may be noise in the system from float errors so you should focus on the big groups and... blergh.)
Also you can play with it in the simulator itself. Here's an example circuit using those displays:
You might also find this blog post intuitively useful.
I am trying to understand Big-O notation through a book I have and it is covering Big-O by using functions although I am a bit confused. The book says that O(g(n)) where g(n) is the upper bound of f(n). So I understand that means that g(n) gives the max rate of growth for f(n) at larger values of n.
and that there exists an n_0 where the rate of growth of cg(n) (where c is some constant) and f(n) have the same rate of growth.
But what I am confused is on these examples on finding Big O in mathmatical functions.
This book says findthe upper bound for f(n) = n^4 +100n^2 + 50
they then state that n^4 +100n^2 + 50 <= 2n^4 (unsure why the 2n^4)
then they some how find n_0 =11 and c = 2, I understand why the big O is O(n^4) but I am just confused about the rest.
This is all discouraging as I don't understand but I feel like this is an important topic that I must understand.
If any one is curious the book is Data Structures and Algorithms Made Easy by Narasimha Karumanchi
Not sure if this post belongs here or in the math board.
Preparations
First, lets state, loosely, the definition of f being in O(g(n)) (note: O(g(n)) is a set of functions, so to be picky, we say that f is in O(...), rather than f(n) being in O(...)).
If a function f(n) is in O(g(n)), then c · g(n) is an upper bound on
f(n), for some constant c such that f(n) is always ≤ c · g(n),
for large enough n (i.e. , n ≥ n0 for some constant n0).
Hence, to show that f(n) is in O(g(n)), we need to find a set of constants (c, n0) that fulfils
f(n) < c · g(n), for all n ≥ n0, (+)
but this set is not unique. I.e., the problem of finding the constants (c, n0) such that (+) holds is degenerate. In fact, if any such pair of constants exists, there will exist an infinite amount of different such pairs.
Showing that f ∈ O(n^4)
Now, lets proceed and look at the example that confused you
Find an upper asymptotic bound for the function
f(n) = n^4 + 100n^2 + 50 (*)
One straight-forward approach is to express the lower-order terms in (*) in terms of the higher order terms, specifically, w.r.t. bounds (... < ...).
Hence, we see if we can find a lower bound on n such that the following holds
100n^2 + 50 ≤ n^4, for all n ≥ ???, (i)
We can easily find when equality holds in (i) by solving the equation
m = n^2, m > 0
m^2 - 100m - 50 = 0
(m - 50)^2 - 50^2 - 50 = 0
(m - 50)^2 = 2550
m = 50 ± sqrt(2550) = { m > 0, single root } ≈ 100.5
=> n ≈ { n > 0 } ≈ 10.025
Hence, (i) holds for n ≳ 10.025, bu we'd much rather present this bound on n with a neat integer value, hence rounding up to 11:
100n^2 + 50 ≤ n^4, for all n ≥ 11, (ii)
From (ii) it's apparent that the following holds
f(n) = n^4 + 100n^2 + 50 ≤ n^4 + n^4 = 2 · n^4, for all n ≥ 11, (iii)
And this relation is exactly (+) with c = 2, n0 = 11 and g(n) = n^4, and hence we've shown that f ∈ O(n^4). Note again, however, that the choice of constants c and n0 is one of convenience, that is not unique. Since we've shown that (+) holds for on set of constants (c,n0), we can show that it holds for an infinite amount of different such choices of constants (e.g., it naturally holds for c=10 and n0=20, ..., and so on).
Consider m by n matrices M, all of whose entries are 0 or 1. For a given M, the question is whether there exists a non zero vector v, all of whose entries are -1, 0 or 1 for which Mv = 0. For example,
[0 1 1 1]
M_1 = [1 0 1 1]
[1 1 0 1]
In this example, there is no such vector v.
[1 0 0 0]
M_2 = [0 1 0 0]
[0 0 1 0]
In this example, the vector (0,0,0,1) gives M_2v = 0.
Given an m and n, I would like to find if there exists such an M so that there is no non-zero v such that Mv = 0.
If m = 3 and n = 4 then the answer is yes as we can see above.
I am currently solving this problem by trying all different M and v which is very expensive.
However, is it possible to express the problem as an integer
programming problem or constraint programming problem so I can use an
existing software package, such as SCIP instead which might be more
efficient.
This question is probably more mathematical than progamming. I haven't found the final answer yet, but at least some ideas are here:
We can re-state the problem in the following way.
Problem A: Fix positive integers m and n. Let S be the set of n-dimensional vectors whose entries are 0 or 1. Does there exist any m by n matrix M whose entries are 0 or 1, such that, for any two different vectors v_1 and v_2 in S, the vectors Mv_1 and Mv_2 are different. (Or, you may say that, the matrix M, considered as an application from n-dimensional vectors to m-dimensional vectors, is injective on the set S.)
In brief: given the pair (m, n), does there exist such an injective M?
Problem A is equivalent to the original problem. Indeed, if Mv_1 = Mv_2 for two different v_1 and v_2 in S, then we have M(v_1 - v_2) = 0, and the vector v_1 - v_2 will have only 0, 1, - 1 as entries. The inverse is obviously also true.
Another reinterpretation is:
Problem B: Let m, n be a positive integer and S be the set of n-dimensional vectors whose entries are 0 and 1. Can we find m vectors r_1, ..., r_m in S, such that, for any pair of different vectors v_1 and v_2 in S, there exists an r_i, which satisfies <v_1, r_i> != <v_2, r_i>? Here <x, y> is the usual inner product.
In brief: can we choose m vectors in S to distinguish everyone in S by taking inner product with the chosen ones?
Problem B is equivalent to Problem A, because you can identify the matrix M with m vectors in S.
In the following, I will use both descriptions of the problem freely.
Let's call the pair (m, n) a "good pair" if the answer to Problem A (or B) is yes.
With the description of Problem B, it is clear that, for a given n, there is a minimal m such that (m, n) is a good pair. Let us write m(n) for this minimal m associated to n.
Similarly, for a given m, there is a maximal n such that (m, n) is good. This is because, if (m, n) is good, i.e. there is an injective M as stated in Problem A, then for any n' <= n, erasing any n - n' columns of M will give an injective M'. Let us write n(m) for this maximal n associated to m.
So the task becomes to calculate the functions m(n) and/or n(m).
We first prove several lemmas:
Lemma 1: We have m(n + k) <= m(n) + m(k).
Proof: If M is an m(n) by n injective matrix for the pair (m(n), n) and K is an m(k) by k injective matrix for the pair (m(k), k), then the (m(n) + n(k)) by (n + k) matrix
[M 0]
[0 K]
works for the pair (m(n) + 1, n + 1). To see this, let v_1 and v_2 be any pair of different (n + k)-dimensional vectors. We may cut both of them into two pieces: the first n entries, and the last k entries. If the first pieces of them are not equal, then they can be distinguished by one of the first m(n) rows of the above matrix; if the first pieces of them are equal, then the second pieces of them must be different, hence they can be distinguished by one of the last m(k) rows of the above matrix.
Remark: The sequence m(n) is thus a subadditive sequence.
A simple corollary:
Corollary 2: We have m(n + 1) <= m(n) + 1, hence m(n) <= n.
Proof: Take k = 1 in Lemma 1.
Note that, from other known values of m(n) you can get better upper bounds. For example, since we know that m(4) <= 3, we have m(4n) <= 3n. Anyway, these always give you O(n) upper bounds.
The next lemma gives you a lower bound.
Lemma 3: m(n) >= n / log2(n + 1).
Proof: Let T be the set of m(n)-dimensional vectors whose entries lie in {0, 1, ..., n}. Any m(n) by n matrix M gives a map from S to T, sending v to Mv.
Since there exists an M such that the above map is injective, then necessarily the size of the set T is at least the size of the set S. The size of T is (n + 1)^m, and the size of S is 2^n, thus we have:
(n + 1)^m(n) >= 2^n
or equivalently, m(n) >= n / log2(n + 1).
Back to programming
I have to say that I haven't figured out a good algorithm.
You might restate the problem as a Set Cover Problem, as follows:
Let U be the set of n dimensional vectors with entries 1, 0 or - 1, and let S be as above. Every vector w in S gives a subset C_w of U: C_w = {v in U: <w, v> != 0}. The question is then: can we find m vectors w such that the union of the subsets C_w is equal to U.
The general Set Cover Problem is NP complete, but in the above Wiki link there is an integer linear program formulation.
Anyway, this cannot take you much further than n = 10, I guess.
I'll keep editting this answer if I have further results.
i think using Boolean matrix multiplication will allow you to solve the Mv=0 problem with only 1's & 0's more efficiently. Using this method you should be able to solve without worrying about rank deficiencies due to the RHS equaling zero. Here is a link to documentation on some algorithms for using BMM:
http://theory.stanford.edu/~virgi/cs367/lecture2.pdf
If I understand the question, you are asking for a given m,n if there exists a Matrix M, (Linear Transformation), with a trivial kernal, that is Ker(M)={0}.
Recall that this is the same as the Nullspace of M being zero 0, Null(M)=0.
For the system Mv=0 the nullspace is {0} if the rank of the matrix M is equal to the dimension of v. So your question comes down to asking about the existence of a mxn matrix with rank dim(v)=m.
The problem in this form has been discussed here
Generate "random" matrix of certain rank over a fixed set of elements
You can also frame this question in terms of determinants because if M has determinant=0 then the nullspace is nontrivial. So you can think about this question in terms of constucting a matrix with entries in {-1,0,1} with a desired determinant.
I hope this helps.
Say you have a matrix A which is of size P × P and a number Q < P can be used to
take a partition of said matrix, where:
A1 is the upper-left sub matrix, with dimension Q × Q,
A2 is the upper-right sub matrix, with dimension Q × (P-Q),
A3 is the lower-left sub matrix, with dimension (P-Q) × Q,
A4 is the lower-rightsub matrix, with dimension (P-Q) × (P-Q).
Which looks like this:
A1 | A2
A = ---+----
A3 | A4
How can you calculate the matrix:
Where 0q is a Q × Q matrix with zero elements.
I'm learning from a book called "Discovering Statistics using R" and although it discusses partitioned matrices, it doesn't show how to calculate one like the one given above and unfortunately I'm having no luck on the programming or maths based searches...
Any help, either mathematically and/or example R code would be great. Thanks in advance.
R has various ways to grab blocks from matrices. For instance, you can use a vector of indexes to reference a set of rows or set of columns using the extract function [, as shown in this example. (The option drop=FALSE is needed if you must handle the case p=1 or q=1 so that R continues to treat the results as matrices and not just vectors.)
#
# Create a symmetric p-d matrix of size p+q.
#
p <- 2; q <- 3 # Both must be 1 or greater
x <- matrix(rnorm((p+q)^2 * 2), ncol=p+q)
a <- cov(x)
#
# Compute b.
#
i <- 1:p; j <- 1:q + p # Indexes of the blocks
b <- a[i,i, drop=FALSE] -
a[i,j, drop=FALSE] %*% solve(a[j,j, drop=FALSE], a[j,i, drop=FALSE])
Matrix inversion is implemented by solve (which is numerically more stable and efficient than computing the inverse of a[j,j] and multiplying that by a[j,i]), the single remaining multiplication is carried out by %*%, and - subtracts one matrix from another component by component. In this fashion the code closely parallels the mathematical expression in the question.