1
$\begingroup$

Mathematica doesn't want to enforce assumptions on an expression. I define a complex outer product for a vector f

Scalar[a_, b_] := Dot[a, Conjugate[b]]
f = {Cos[a/2], E^(I b) Sin[a/2]};
Outer[Scalar, f, f]

If I try to define $Assumptions or use Assuming to say that a and b are Real elements, it does not simplify the expression for Outer.

$\endgroup$
3
  • 2
    $\begingroup$ Simplify[Outer[Scalar[{#}, {#2}] &, f, f], Assumptions -> Element[{a, b}, Reals]] or Assuming[{Element[{a, b}, Reals]}, Simplify[Outer[Scalar[{#}, {#2}] &, f, f]]] ? $\endgroup$ – kglr Nov 26 '17 at 22:36
  • $\begingroup$ $Assumptions and Assuming only help with functions that have an Assumptions option. Neither Dot nor Outer take assumptions so there is nothing done with the assumptions. $\endgroup$ – Bob Hanlon Nov 27 '17 at 1:04
  • $\begingroup$ @kglr That worked! Maybe how you defined the scalar product with the extra symbols helped to simplify. $\endgroup$ – Buddhapus Nov 27 '17 at 5:53
0
$\begingroup$
Simplify[Outer[Scalar[{#}, {#2}] &, f, f], Assumptions -> Element[{a, b}, Reals]]//TeXForm

$\left( \begin{array}{cc} \cos ^2\left(\frac{a}{2}\right) & \frac{1}{2} e^{-i b} \sin (a) \\ \frac{1}{2} e^{i b} \sin (a) & \sin ^2\left(\frac{a}{2}\right) \\ \end{array} \right)$

or

Assuming[{Element[{a, b}, Reals]}, Simplify[Outer[Scalar[{#}, {#2}] &, f, f]]]//TeXForm

$\left( \begin{array}{cc} \cos ^2\left(\frac{a}{2}\right) & \frac{1}{2} e^{-i b} \sin (a) \\ \frac{1}{2} e^{i b} \sin (a) & \sin ^2\left(\frac{a}{2}\right) \\ \end{array} \right)$

$\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.