I am facing a problem in plotting the Piecewise function. I simplified my problem to take the following form:
where \[Sigma][i]
are Pauli matrices. My code is:
\[Sigma][1] = PauliMatrix[1]; \[Sigma][2] =
PauliMatrix[2]; \[Sigma][3] = PauliMatrix[3];
DM = {{2 t, 0, 0, 8}, {0, 8, 10, 0}, {0, 15, 5, 0}, {2, 0, 0, 3}};
x[i_] = Tr[DM.(KroneckerProduct[\[Sigma][i], \[Sigma][i]])];
X = {{x[1], x[2], x[3]}};
{\[Lambda]1, \[Lambda]2, \[Lambda]3, \[Lambda]4} = Eigenvalues[DM];
MR = Piecewise[{{Tr[DM.DM\[Transpose]] - Norm[X],
X != 0}, {Max[\[Lambda]1, \[Lambda]2, \[Lambda]3, \[Lambda]4],
X = 0}}]
Plot[MR, {t, 0, 100}]