Corresponding value of a parameter
Hello, I am quite new to Sage and I have the following question. In my computations I have a quadratic form: $x^T A x = b $ , where the matrix A is defined already as a symmetric matrix, and x is defined as
import itertools
X = itertools.product([0,1], repeat = n)
for x in X:
x = vector(x)
print x
as all combination of $[0,1]$ repeated n times. I got a set of values for $b$ and extracted few of them from the set. Now, I need to identify which $x$ is corresponding to a particular value of $b$. Is there any command to do so? If it is possible. Thank you for help.
I don't understand two things. There is no variable x or b in your code. Furthermore, if you run this code what you get is an empty iterator W and a vector w equal to (1,1,...,1)
(note that you forgot the line import itertools in your command)
My apologies for ambiguity. I have edited the post. Hope it is now clearer.
the whole code with defined previously matrix A looks like this:
@Xenia It is much clearer now. I updated my answer below.