Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Using vector with variables over a finite field

I'm trying to write a code that does some manipulation on a vector of variables and then checks something for each of their assignments. The manipulation includes multiplying the vector by a matrix. Everything is over GF(2) so for $n$ variables there are $2^n$ options which is fine with me.

I've seen that the following code works for declaring a vector with variables

x, y, z = var('x y z')

vector([x, y, z])

My problem is that these variables aren't from GF(2), and so when I try multiplying it by a matrix which is indeed declared over GF(2), it throws an exception.

The specific exception is TypeError: positive characteristic not allowed in symbolic computations.

Is there any workaround for still doing the manipulation?

click to hide/show revision 2
retagged

Using vector with variables over a finite field

I'm trying to write a code that does some manipulation on a vector of variables and then checks something for each of their assignments. The manipulation includes multiplying the vector by a matrix. Everything is over GF(2) so for $n$ variables there are $2^n$ options which is fine with me.

I've seen that the following code works for declaring a vector with variables

x, y, z = var('x y z')

vector([x, y, z])

My problem is that these variables aren't from GF(2), and so when I try multiplying it by a matrix which is indeed declared over GF(2), it throws an exception.

The specific exception is TypeError: positive characteristic not allowed in symbolic computations.

Is there any workaround for still doing the manipulation?