Ask Your Question

endomorphisme59's profile - activity

2024-01-31 22:44:35 +0200 edited question Solving a linear system of equations depending of a parameter

Solving a linear system of equations depending of a parameter Hi, Let $a$ be a fixed parameter, and let $$(S) : \begin{

2024-01-31 22:44:13 +0200 edited question Solving a linear system of equations depending of a parameter

Solving a linear system of equations depending of a parameter Hi, Let $a$ be a fixed parameter, and let [(S) : \begin{c

2024-01-31 22:43:57 +0200 edited question Solving a linear system of equations depending of a parameter

Solving a linear system of equations depending of a parameter Hi, Let $a$ be a fixed parameter, and let $$(S) : \begin{

2024-01-31 22:43:05 +0200 edited question Solving a linear system of equations depending of a parameter

Solving a linear system of equations depending of a parameter Hi, Let $a$ be a fixed parameter, and let $(S) : \begin{c

2024-01-31 22:42:46 +0200 edited question Solving a linear system of equations depending of a parameter

Solving a linear system of equations depending of a parameter Hi, Let $a$ be a fixed parameter, and let $(S) : \begin{c

2024-01-31 22:42:12 +0200 asked a question Solving a linear system of equations depending of a parameter

Solving a linear system of equations depending of a parameter Hi, Let $a$ be a fixed parameter, and let $(S) : \begin{c

2023-10-25 15:00:26 +0200 commented answer Simplify a matrix with symbolic variables

Thank you !

2023-10-25 15:00:00 +0200 marked best answer Simplify a matrix with symbolic variables

Hello,

I've tried the following code in SageMath, but I don't succeed in getting a simplified expression (even using the method .simplify_full()) :

var('w_2, w_3, w_4', domain='complex')
a_2=sqrt(1-norm(w_2))*sqrt(1-norm(w_3))
a_3=sqrt(1-norm(w_3))*sqrt(1-norm(w_4))
b_2=-conjugate(w_3)*sqrt(1-norm(w_2))*sqrt(1-norm(w_4))
C=Matrix([[0, w_2, a_2, b_2], [0,0,w_3,a_3], [0,0,0,w_4], [0,0,0,0]])
Id=matrix.identity(4)
T=Id-C*(C.H)
T.simplify_full()

I get the "awfull" outcome

[-sqrt(-w_2*conjugate(w_2) + 1)*sqrt(-w_4*conjugate(w_4) + 1)*w_3*conjugate(sqrt(-w_2*conjugate(w_2) + 1))*conjugate(sqrt(-w_4*conjugate(w_4) + 1))*conjugate(w_3) - sqrt(-w_2*conjugate(w_2) + 1)*sqrt(-w_3*conjugate(w_3) + 1)*conjugate(sqrt(-w_2*conjugate(w_2) + 1))*conjugate(sqrt(-w_3*conjugate(w_3) + 1)) - w_2*conjugate(w_2) + 1                                                                                                  sqrt(-w_2*conjugate(w_2) + 1)*sqrt(-w_4*conjugate(w_4) + 1)*conjugate(sqrt(-w_3*conjugate(w_3) + 1))*conjugate(sqrt(-w_4*conjugate(w_4) + 1))*conjugate(w_3) - sqrt(-w_2*conjugate(w_2) + 1)*sqrt(-w_3*conjugate(w_3) + 1)*conjugate(w_3)                                                                                                                                                                                                                                                  sqrt(-w_2*conjugate(w_2) + 1)*sqrt(-w_4*conjugate(w_4) + 1)*conjugate(w_3)*conjugate(w_4)                                                                                                                                                                                                                                                                                                                                          0]
[                                                                                                 sqrt(-w_3*conjugate(w_3) + 1)*sqrt(-w_4*conjugate(w_4) + 1)*w_3*conjugate(sqrt(-w_2*conjugate(w_2) + 1))*conjugate(sqrt(-w_4*conjugate(w_4) + 1)) - w_3*conjugate(sqrt(-w_2*conjugate(w_2) + 1))*conjugate(sqrt(-w_3*conjugate(w_3) + 1))                                                                                                                                                                    -sqrt(-w_3*conjugate(w_3) + 1)*sqrt(-w_4*conjugate(w_4) + 1)*conjugate(sqrt(-w_3*conjugate(w_3) + 1))*conjugate(sqrt(-w_4*conjugate(w_4) + 1)) - w_3*conjugate(w_3) + 1                                                                                                                                                                                                                                                                -sqrt(-w_3*conjugate(w_3) + 1)*sqrt(-w_4*conjugate(w_4) + 1)*conjugate(w_4)                                                                                                                                                                                                                                                                                                                                          0]

[                                                                                                                                                                                                                                                 w_3*w_4*conjugate(sqrt(-w_2*conjugate(w_2) + 1))*conjugate(sqrt(-w_4*conjugate(w_4) + 1))                                                                                                                                                                                                                                                     -w_4*conjugate(sqrt(-w_3*conjugate(w_3) + 1))*conjugate(sqrt(-w_4*conjugate(w_4) + 1))                                                                                                                                                                                                                                                                                                                    -w_4*conjugate(w_4) + 1                                                                                                                                                                                                                                                                                                                                          0]
[                                                                                                                                                                                                                                                                                                                                         0                                                                                                                                                                                                                                                                                                                                          0                                                                                                                                                                                                                                                                                                                                          0                                                                                                                                                                                                                                                                                                                                      1]

whereas when we compute this "by hand", we can show that

T= [[norm(w_3*w_4)*(1-norm(w_2)), -conjugate(w_3)*sqrt(1-norm(w_2))*sqrt(1-norm(w_3))*norm(w_4), conjugate(w_3*w_4)*sqrt(1-norm(w_2))*sqrt(1-norm(w_4))],
     [-w_3*sqrt(1-norm(w_2))*sqrt(1-norm(w_3))*norm(w_4), norm(w_4)*(1-norm(w_3)), -conjugate(w_4)*sqrt(1-norm(w_3))*sqrt(1-norm(w_4))],
     [w_3*w_4*sqrt(1-norm(w_2))*sqrt(1-norm(w_4)), -w_4*sqrt(1-norm(w_3))*sqrt(1-norm(w_4)), 1-norm(w_4)]]

Thus, when I want to diagonalize T using the T.eigenvalues() and T.eigenvectors_right(), I get something really complicated... whereas we can show "by hand" that the eigenvalues are just 0 and 1-norm(w_2*w_3*w_4)...

How could we manage to get those simple expressions with Sage Math ?

Thanks in advance for your help !

2023-10-25 14:59:47 +0200 commented question Simplify a matrix with symbolic variables

Of course... I've forgotten the last row (but this row is quite trivial...).

2023-10-19 16:27:33 +0200 edited question Simplify a matrix with symbolic variables

Simplify a matrix with symbolic variables Hello, I've tried the following code in SageMath, but I don't succeed in gett

2023-10-19 16:27:00 +0200 asked a question Simplify a matrix with symbolic variables

Simplify a matrix with symbolic variables Hello, I've tried the following code in SageMath, but I don't succeed in gett

2023-10-19 13:56:35 +0200 commented answer How to define *complex* symbolic variables

Thank you :)

2023-10-19 13:56:15 +0200 marked best answer How to define *complex* symbolic variables

Hello,

I am quite new with SageMath, and I don't succeed in defining complex symbolic variables.

In the following example, SageMath seems to compute as if the variables were real (and not complex) :

var('w_2')
T=Matrix([[0, w_2], [0,0]])
S=T*(T.H)
S.eigenvalues()

The output of this command is

[w_2^2, 0]

whereas the expected result was

[norm(w_2), 0]

How can I tell SageMath that my symbolic variables are complex ones ?

Thanks in advance for your help !

2023-10-19 13:56:15 +0200 received badge  Scholar (source)
2023-10-19 10:49:10 +0200 received badge  Editor (source)
2023-10-19 10:49:10 +0200 edited question How to define *complex* symbolic variables

How to define *complex* symbolic variables Hello, I am quite new with SageMath, and I don't succeed in defining complex

2023-10-19 10:13:09 +0200 asked a question How to define *complex* symbolic variables

How to define *complex* symbolic variables Hello, I am quite new with SageMath, and I don't succeed in defining complex