Revision history [back]

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

W = itertools.product([0,1], repeat = n)
for w in W: w = vector(w)


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.

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

W = itertools.product([0,1], repeat = n)
for w in W: w = vector(w)


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.

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

W import itertools
X = itertools.product([0,1], repeat = n)
for w x in W: w X:
x = vector(w)
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.

 4 retagged FrédéricC 4453 ●3 ●37 ●94

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.