-3
$\begingroup$

I want to evaluate the CholeskyDecomposition of the following symmetric matrix symMat

mm = Table[Subscript[m, i, j], {i, 1, 3}, {j, 1, 3}]
symMat = Table[
  If[i >= j, mm[[i, j]], mm[[j, i]]], {i, 1, 3}, {j, 1, 3}]

It works but as Mathematica works with complex numbers I have some Conjugate commands in the result. How to tel that all parameters are Reals. I have found a nice post which use

    $Assumptions = _ ∈ Reals

But it has no effect. I have also tried

$Assumptions = 
 Subscript[m, 2, 1] \[Element] Reals && 
  Subscript[m, 1, 1] \[Element] Reals &&
  Subscript[m, 3, 1] \[Element] Reals 

In all cases it doesn't work. Any idea ?

$\endgroup$
  • 1
    $\begingroup$ Did you use any function that uses those Assumptions, like Reduce or Simplify? How about ComplexExpand in this case? $\endgroup$ – Marius Ladegård Meyer Feb 11 '17 at 8:45
  • $\begingroup$ Your two suggestions doesn't work $\endgroup$ – cyrille.piatecki Feb 11 '17 at 9:30
  • $\begingroup$ I would appreciate to know why I deserve a downgrading note for a non trivial problem $\endgroup$ – cyrille.piatecki Feb 11 '17 at 10:08
  • $\begingroup$ Does $Assumptions = Element[Flatten[mm], Reals] give what you need? $\endgroup$ – kglr Feb 11 '17 at 10:50
  • 2
    $\begingroup$ Probably this does not answer your question in general, but CholeskyDecomposition[symMat] //. Conjugate[x_] -> x seems to work in this case. $\endgroup$ – Marius Ladegård Meyer Feb 11 '17 at 14:30
3
$\begingroup$

Just setting $Assumptions does not mean that those assumptions are taken into consideration during evaluation; you also need to apply a function to your result that is "sensitive" to $Assumptions. In practice, these tend to be those functions that take an Assumptions option, such as Simplify, FullSimplify, Refine, FunctionExpand, Integrate...

For instance, this does the job in your case:

Simplify[CholeskyDecomposition[symMat], Element[_, Reals]]

Mathematica graphics

Further details can be found in this tutorial: Using Assumptions.

$\endgroup$
  • $\begingroup$ Nice Thanks MarcoB $\endgroup$ – cyrille.piatecki Feb 12 '17 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.