# Revision history [back]

### 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.

### 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 the following: [[-11*x0^2 + x0*x1 + 10*x1^2 + 15*x1*x2 + 15*x0*x3 + 14*x1*x3 + 14*x2*x3 + 8*x3^2 + 5*x0*x4 + 13*x1*x4 + 2*x2*x4 - 12*x3*x4 - 9*x4^2 - 14*x1*x5 - 9*x2*x5 - 11*x3*x5 + 14*x4*x5 + 13*x5^2], [15*x0^2 + 9*x0*x1 - 12*x1^2 - 5*x0*x2 + 5*x2^2 + 3*x0*x3 + 2*x2*x3 - 15*x3^2 + 3*x0*x4 - 11*x1*x4 + 8*x2*x4 - 7*x3*x4 + 14*x4^2 + 10*x0*x5 - 7*x1*x5 - 11*x2*x5 + 3*x3*x5 - 5*x4*x5 - 11*x5^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.

### 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 eqn where eqn looks like the following: [[-11*x0^2 + x0*x1 + 10*x1^2 + 15*x1*x2 + [[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 + 14*x2*x3 + 8*x3^2 + 5*x0*x4 + 13*x1*x4 + 2*x2*x4 - 12*x3*x4 - 9*x4^2 - 14*x1*x5 - 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 - 11*x3*x5 + 14*x4*x5 + 13*x5^2], [15*x0^2 + 9*x0*x1 - 12*x1^2 - 5*x0*x2 + 5*x2^2 + 3*x0*x3 + 2*x2*x3 - 15*x3^2 + 3*x0*x4 - 11*x1*x4 + 8*x2*x4 - 7*x3*x4 + 14*x4^2 + 10*x0*x5 - 7*x1*x5 - 11*x2*x5 + 3*x3*x5 - 5*x4*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.

### 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.

### 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.

### 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.