Ask Your Question

Revision history [back]

How to create a constrained symbolic vector

I am trying to emulate the following Mathematica code that returns the desired result. https://www.dropbox.com/s/awk0dj5po9kd0ap/Screen%20Shot%202022-03-19%20at%201.11.51%20PM.png?dl=0 The part I can't figure is how to constrain a symbolic vector to 1 and still retain it's vector form

How to create a constrained symbolic vector

I am trying to emulate the following Mathematica code that returns the desired result. https://www.dropbox.com/s/awk0dj5po9kd0ap/Screen%20Shot%202022-03-19%20at%201.11.51%20PM.png?dl=0 The part I can't figure is how to constrain a symbolic vector to 1 and still retain it's vector formform Here's what I have so far, but it doesn't work:

p1,p2,p3=var('p1,p2,p3') A1=matrix(QQ,[[1,-1],[-1,1]]) sum1=p1+p2 sum1=1 P1=matrix(SR,[p1,p2]) result1=P1A1P1.transpose() result1.simplify_full()

How to create a constrained symbolic vector

I am trying to emulate the following Mathematica code that returns the desired result. https://www.dropbox.com/s/awk0dj5po9kd0ap/Screen%20Shot%202022-03-19%20at%201.11.51%20PM.png?dl=0 The part I can't figure is how to constrain a symbolic vector to 1 and still retain it's vector form Here's what I have so far, but it doesn't work:

p1,p2,p3=var('p1,p2,p3')
A1=matrix(QQ,[[1,-1],[-1,1]])
sum1=p1+p2
sum1=1
P1=matrix(SR,[p1,p2])
result1=P1A1P1.transpose()
result1.simplify_full()

result1=P1*A1*P1.transpose() result1.simplify_full()