Problem 2. Consider the density matrix

ρ=12(1111)

and another matrix A which is 2×2 real valued and symmetric. Assuming that the tr(ρA)=1 and tr(ρA2)=1. Recosntruct the matrix from this information.

16.1 μs

Solution 2.

16.8 μs
350 μs

Setting up some usefull sympy functions.

10.4 μs
64.5 μs

Define the the matrices ρ, A, and A2, recall A is real and symmetric.

20.6 μs
202 ms

The matrix ρA then looks like:

14.9 μs

[0.5A0.5A0.5A0.5A0.5A+0.5A0.5A+0.5A] 

3.4 ms

Now defining expressions corresponding to the conditions tr(ρA)=1 and tr(ρA2)=1.

17.7 μs
expr1

0.5A1.0A+0.5A+1 

6.4 ms
expr2

0.5A21.0AA+1.0A21.0AA+0.5A21 

20.8 ms
139 ms

The solutions for the matrix A is then:

A=[AA+1.0A+1.0A]

where A22 is some real valued constant.

6.5 ms

Run this command to plug solution into original symbolic variable.

A.subs(solution...)
8.9 μs