2021-04-07 17:42:40 +0200 received badge ● Popular Question (source) 2020-11-19 19:04:26 +0200 received badge ● Notable Question (source) 2019-12-18 11:11:12 +0200 received badge ● Popular Question (source) 2019-06-04 13:20:00 +0200 received badge ● Famous Question (source) 2019-06-04 13:20:00 +0200 received badge ● Notable Question (source) 2019-06-04 13:20:00 +0200 received badge ● Popular Question (source) 2018-04-08 20:40:45 +0200 asked a question A way of checking that a multivariate system of equations has a solution? Is there a way to check that a multivariate system of polynomial equations does indeed have a solution(or not)? The context i am using this in is as follows: say i have a system of multivariate polynomial equations over a finite field, i then put values in for some of the variables, and then i need to check if the resulting system in the remaining unassigned variables has a solution or not? If not, then i will reassign different values to the other variables until a system with a solution is yielded. Of course because the assigning of these values is random there is a high chance the system has a solution anyway, but in the event that it does not is where i need a way to check whether a solution exists or not. 2018-04-08 13:01:19 +0200 received badge ● Citizen Patrol (source) 2018-03-29 15:40:59 +0200 received badge ● Commentator 2018-03-29 15:40:59 +0200 commented question Does anyone know how to implement a simple XL Algorithm in sage? I have had a look at that but i don't really understand what is going on there because it doesn't seem to provide a solution, also i need to do it for a polynomial system. They define a polynomial system with the following sr = mq.SR(1,1,1,4, gf2=True, polybori=True, order='lex') F,s = sr.polynomial_system()and i don't really get what kind of polynomial system has actually been implemented there :/ 2018-03-29 14:45:45 +0200 asked a question Does anyone know how to implement a simple XL Algorithm in sage? I need to implement the XL algorithm in sage, which i can use to solve over-determined systems of polynomial equations (more equations than variables). Any help on how to do this? 2018-03-29 14:22:09 +0200 marked best answer Finding the matrix of a linear affine transformation and its inverse How do i get the matrix representation of an affine transformation and it's inverse in sage? I am more so interested in doing this for random affine transformations as i am using them in a multivariate cryptography scheme but for example the following affine transformation over GF(3)  [1 0 0 2 0 2]  [2 2 1 1 2 0]  [2 0 0 2 2 2]  x |-> [2 2 0 1 1 1] x +  [1 0 2 0 2 0]  [0 0 0 2 0 2]   2018-03-21 18:50:48 +0200 received badge ● Supporter (source) 2018-03-21 18:41:40 +0200 commented answer Creating a symbolic matrix in a loop and then substituting values in for the variables? After trying this it says that The dimension of the ideal is 2, but it should be 0 ...i require the dimension to be zero so finitely many solutions though, is there a way around this? When i check what the ideal of s is i get the following: Ideal (0, 0) of Multivariate Polynomial Ring in x4, x5 over Finite Field of size 31  2018-03-21 16:45:49 +0200 commented answer Creating a symbolic matrix in a loop and then substituting values in for the variables? Okay thanks for that, that seems to have worked for me. But i have now ran into another issue. After substitution of these random values i have made the resulting equations in the remaining variables equal to random values in GF(q) for example [-3*x4 + 2*x5 + 8, -11*x4 + 6*x5 + 3] = [4,5] but when i try to use the solve function to solve the equations for x4 and x5 with the following l=solve(s, Ry.gens()) where s is the list of equations given above in which each equation has been made equal to a value in GF(q) i get the following error TypeError: x4 is not a valid variable. and even if i try to solve in the explicit example above as follows l=solve(s, x4, x5) it simply keeps on returning an empty list [] regardless of what the equations turn out ... 2018-03-21 14:05:34 +0200 commented answer Creating a symbolic matrix in a loop and then substituting values in for the variables? The error occurs after running [phi(f) for f in List]. And in answer to your question above about why in the definition of eqn i have [[f], [[g]], this is because the equations are actually formed from the following: eqn =[tp1*P[i]*tp1.transpose() for i in range(o)] where tp1=matrix(P.gens()) and tp1. transpose is just the transpose of that matrix and the central matrix P[i] is a square nxn matrix of values in GF(q) that i have determined. This multiplication when n=6looks like [x0, x1, x2, x3, x4, x5]*P[i]*[x0, x1, x2, x3, x4, x5].transpose and this yields a matrix with 1 element, and that element is the multivariate equation, and that is why the equations in the list eqn are of the form: 1x1 dense matrices over Multivariate Polynomial Ring in x0,...,x5 over GF(q) 2018-03-21 09:03:24 +0200 commented answer Creating a symbolic matrix in a loop and then substituting values in for the variables? After changing Rx to P=PolynomialRing(K,'x',n) where K.=GF(q) as my polynomials are members of a ring P i defined earlier (although the generators of Rx in your example above and P are actually exactly the same) i now get the following errors: raise TypeError("%s fails to convert into the map's domain %s, but a pushforward method is not properly implemented" % (x, D)) TypeError: [3*x0^2 + 11*x0*x1 + 9*x1^2 - 10*x0*x2 - 9*x1*x2 - 10*x2^2 - 11*x0*x3 + 8*x1*x3 - 3*x2*x3 - 11*x3^2 + 9*x0*x4 + x1*x4 - 3*x3*x4 - 8*x4^2 + 3*x0*x5 + 3*x1*x5 + 2*x2*x5 - 15*x3*x5 + 4*x4*x5 + 13*x5^2] fails to convert into the map's domain Multivariate Polynomial Ring in x0, x1, x2, x3, x4, x5 over Finite ... 2018-03-21 01:24:43 +0200 commented answer Creating a symbolic matrix in a loop and then substituting values in for the variables? Thanks a lot for this. However when i have tried to implement this as follows: Rx=PolynomialRing(GF(q),n,'x') Ry=PolynomialRing(GF(q),n-v,['x%s'%p for p in[v..n-1]]) images = [GF(q).random_element() for i in range(v)]+list(Ry.gens()) phi=Rx.hom(images,Ry) List=[eqn[j] for j in range(o)] [phi(f) for f in List] Where eqn is my list of o random multivariate equations in n variables But when running this it shows the following error TypeError: [10*x0^2 + 11*x0*x1 - 12*x1^2 - 14*x0*x2 + 8*x1*x2 + 6*x2^2 - 15*x0*x3 - 13*x1*x3 - 7*x2*x3 + 9*x3^2 - 13*x0*x4 + 11*x1*x4 + 6*x2*x4 - 15*x3*x4 + 11*x4^2 - 13*x0*x5 + 12*x1*x5 + 6*x2*x5 - 8*x4*x5 + x5^2] fails to convert ... 2018-03-20 22:51:34 +0200 asked a question Evaluating a list of multivariate equations at random values. I have a list of multivariate equations, there are o multivariate equations in the list where o is an integer and v = 2o, the variables that make up the equations are the generators of P = PolynomialRing(K,'x',n) where n = v + o so for example if o = 2 then v = 4 and n = 6 so the variables that make up the multivariate equations in the list would be P.gens() = (x0, x1, x2, x3, x4, x5). Now i need to substitute in random values from GF(q) for the first v variables in each of the multivariate equations in the list so in the example above where v = 4 random values from GF(q)would be substituted in for the variables x0, x1, x2, x3in each of the multivariate equations in the list, leaving equations in only two variables x4 and x5. I have tried to implement this but i don't really know where to start as i know i am doing something wrong but what i have is the following. If the list of multivariate equations is called eqn for example. for i in range(v): xi = var('x'+str(i)) eqnsub0 = eqn[i].subs({x[i]:GF(q).random_element()})  I already know this is very wrong as the indexing will already go out of bounds since v > o but i don't really know where to start with this. Any help would be great, thanks. 2018-03-20 18:28:59 +0200 commented answer Creating a symbolic matrix in a loop and then substituting values in for the variables? Thanks for your help i have edited the question to be more specific with what i require as i realize my initial question was not as precise. If you can help with that that would be great. 2018-03-20 17:47:16 +0200 received badge ● Student (source) 2018-03-20 15:44:10 +0200 asked a question Creating a symbolic matrix in a loop and then substituting values in for the variables? I need to create a symbolic matrix in terms of the variables xi with one row of n elements for a given integer n, so for example if n=5 i would need to compute the matrix [x0, x1, x2, x3, x4] As a follow on from this i then need to substitute in random values from a finite field say GF(q) for the first v number of variables in the matrix for a given integer v < n . So for example if v = 3 then i would need to substitute in random values from GF(q) for the first x0, x1, x2 variables of the matrix to get something like [GF(q).random_element(), GF(q).random_element(), GF(q).random_element(), x3, x4 ] of course i need to be able to do this for any integers n and v i choose. Any help about how to do this in sage would be great, thanks. EDIT: I need to substitute in random values from a finite field say GF(q) for the first v number of variables for a given integer v < n into each of the multivariate equations in a list. So for example, if my list of multivariate equations is given by eqn where eqn looks like the following: [[10*x0^2 + 11*x0*x1 - 12*x1^2 - 14*x0*x2 + 8*x1*x2 + 6*x2^2 - 15*x0*x3 - 13*x1*x3 - 7*x2*x3 + 9*x3^2 - 13*x0*x4 + 11*x1*x4 + 6*x2*x4 - 15*x3*x4 + 11*x4^2 - 13*x0*x5 + 12*x1*x5 + 6*x2*x5 - 8*x4*x5 + x5^2], [4*x0^2 + 8*x0*x1 - 3*x1^2 - 8*x0*x2 - 3*x1*x2 - 10*x2^2 + 5*x0*x3 - 14*x1*x3 - 5*x2*x3 - 12*x3^2 - 10*x0*x4 + 8*x1*x4 - 10*x2*x4 - 4*x3*x4 + 6*x4^2 - 11*x0*x5 - 3*x1*x5 - 9*x2*x5 + 9*x3*x5 + 4*x4*x5 - 11*x5^2]] when o = 2 then i need to substitute random values from GF(q) into the first v variables, to obtain a list of multivariate equations in only the remaining variables that have not been substituted. 2018-03-20 15:27:11 +0200 received badge ● Scholar (source) 2018-03-19 23:11:56 +0200 commented answer Multiplying matrices with different parents I think you may be correct with that list interpretation that makes a lot more sense to me, a list of 6x6 matrices as a result is what i require, how would i go about doing this using lists then?? I haven't actually used lists in sage yet :/ 2018-03-19 19:46:11 +0200 commented answer Multiplying matrices with different parents Yes that's basically what i want to do, except what i need is not quite as simple as that. I basically have a column vector in which each of it's components is a multivariate equation for example the one i have given above, i need to multiply each of these multivariate equations in the column vector by the 6x6 matrix, so i am trying to treat each multivariate equation as a 1x1 matrix to do so, but i get the error i noted in my question. I don't know if i have made much sense here :/ 2018-03-19 19:00:57 +0200 asked a question Multiplying matrices with different parents I am trying to multiple a symbolic 1x1 matrix with one element in it, by a square matrix over a finite field. for example [-9*x0^2 - 11*x0*x1 - 5*x1^2 - 11*x0*x2 - 4*x1*x2 + 7*x2^2 + 13*x1*x3 + 8*x2*x3 + 4*x3^2 - 6*x0*x4 - 4*x1*x4 - 15*x2*x4 + 9*x0*x5 - 8*x1*x5 - 5*x2*x5 - 3*x3*x5]  to be multiplied with them matrix [18 23 14 1 6 21] [24 3 3 0 2 0] [17 25 2 16 23 8] [ 8 21 16 5 1 9] [14 28 8 17 12 12] [ 6 24 18 19 3 1]  however when i try this i get the following error: TypeError: unsupported operand parent(s) for *: 'Full MatrixSpace of 1 by 1 dense matrices over Multivariate Polynomial Ring in x0, x1, x2, x3, x4, x5 over Finite Field of size 31' and 'Full MatrixSpace of 6 by 6 dense matrices over Finite Field of size 31' Is there a way to do this?