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
    Jun 30 '20 at 14:19
  • $\begingroup$ Block is used to declare (and assign values to) local variables. You should tell domain restrictions to HermitianMatrixQ. $\endgroup$ Jun 30 '20 at 15:45
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, privacy policy and cookie policy

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