Message Boards Message Boards

GROUPS:

Unexpected behavior of Assuming

Posted 3 months ago
509 Views
|
4 Replies
|
1 Total Likes
|

Hello Community Users,

I have encoutered the following issues using "Assuming":

I define a simple matrix that will be tested whether it is Hermitean.

(mat = {{0, Exp[I \[Phi]]}, {Exp[-I \[Phi]], 0}}) // MatrixForm

If I define the condition that phi is real valued, I expect the defined matrix to be Hermitean. So I tried to use Assuming to define this constraint

Assuming[\[Phi] \[Element] Reals, {$Assumptions, 
  HermitianMatrixQ[mat], ConjugateTranspose[mat] == mat, 
  Simplify[ConjugateTranspose[mat]] == mat}]

This is the corresponding output:

(* {[Phi] [Element] Reals, False, {{0, E^( I Conjugate[[Phi]])}, {E^(-I Conjugate[[Phi]]), 0}} == {{0, E^( I [Phi])}, {E^(-I [Phi]), 0}}, True} *)

"Assuming" apparently understands the constraint, but seems to fail with the evaluation, i.e. the matrix is reported not to be Hermitean. Next I perform the evaluation step by step. If I use additional "Simplify" (without specifying additional constraints) to process the ConjugateTransposed matrix under the assumption phi element Real, I get the expected result that the conjugated transposed matrix is equivalent to the original matrix, which according to the documentation is exactly the condition that HermiteanMatrixQ should evaluate.

Can anybody shed some light on this issue?

Thank you and best regards,

Michael

4 Replies

Michael,

I guess the core of the problem is that the matrix mat per se (i.e. for general \[Phi]) is not Hermitian. Then HermitianMatrixQ[mat] evaluates to False, this is the first action that happend, and then it is too late for any assumptions to have an effect. To see this try e.g.:

Simplify[HermitianMatrixQ[mat], \[Phi] \[Element] Reals] // Trace // TableForm
Posted 2 months ago

Hello Hendrik,

thank you for your feedback. If I follow your explanation, then Assuming is evaluating the expression before using the assumption. However, this does not follow the description of what "Assuming" should do as given in the documentation:

Quote: "Assuming[assum,expr] evaluates expr with assum appended to $Assumptions, so that assum is included in the default assumptions ...."

In the end the observed behavior imits the use of "Assuming" quite severly. I would prefer a function that is really evaluation the assumptions before evaluation the expression (as stated in the documentation).

Best regards,

Michael

Michael,

here is a workaround (from the documentation!):

HermitianMatrixQ[mat, SameTest -> (Simplify[#1 - #2, \[Phi] \[Element] Reals] == 0 &)]

or:

Assuming[\[Phi] \[Element] Reals, HermitianMatrixQ[mat, SameTest -> (Simplify[#1 - #2] == 0 &)]]

or:

$Assumptions = {\[Phi] \[Element] Reals};
HermitianMatrixQ[mat, SameTest -> (Simplify[#1 - #2] == 0 &)]
Posted 2 months ago

Hello Henrik,

thanks for pointing this out!

Best wishes,

Michael

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract