1
$\begingroup$

How can I learn Mathematica that the ham matrix with symbolic elements is Hermitian?

Block[{jz \[Element] Reals, j \[Element] Reals, b \[Element] Reals}, 
      HermitianMatrixQ[{{(jz + 2 b)/2, 0, 0, 0}, {0, (-jz + 2 b)/2, j, 
        0}, {0, j, (-jz - 2 b)/2, 0}, {0, 0, 0, (jz - 2 b)/2}}]]
$\endgroup$
2
  • 1
    $\begingroup$ Block, With, Module etc. must take assignments, not predicates or assumptions. $\endgroup$
    – flinty
    Commented Jun 30, 2020 at 14:19
  • $\begingroup$ Block is used to declare (and assign values to) local variables. You should tell domain restrictions to HermitianMatrixQ. $\endgroup$ Commented Jun 30, 2020 at 15:45

1 Answer 1

3
$\begingroup$

By using the SameTest option and Simplify:

HermitianMatrixQ[{
  {(jz + 2 b)/2, 0, 0, 0},
  {0, (-jz + 2 b)/2, j, 0},
  {0, j, (-jz - 2 b)/2, 0},
  {0, 0, 0, (jz - 2 b)/2}
  }, SameTest -> (Simplify[#1 - #2, {jz ∈ Reals, j ∈ Reals, b ∈ Reals}] == 0 &)]

(* result: True *)

This option is covered in the documentation

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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