Orthogonalize[{E^x, E^(w^1*x), E^(w^2*x), E^(w^3*x)}, 
  Integrate[#1 *Conjugate[#2], {x, -Pi, Pi}] &]

I am trying to orthogonalize the first 4 expression using my own custom inner product which is the integral of F(x)[G(x)]* from -pi to pi. I want the second argument of the product (G(x)) to be the complex conjugate but I cannot figure out how to do that. Any tips?

  • 1
    $\begingroup$ At a minimum try E^x instead of e^x. $\endgroup$
    – Somos
    Feb 3 '19 at 2:47
  • $\begingroup$ Thanks for the heads up. I changed it but it still seems to error out due to the integration. $\endgroup$ Feb 3 '19 at 2:58
  • 1
    $\begingroup$ Next step. What is the value of w? Is it a complex number? Also, what is the error message? $\endgroup$
    – Somos
    Feb 3 '19 at 8:27
  • $\begingroup$ I changed some things and it is no longer erroring but instead giving me a long answer. Should Mathematica be displaying Conjugate[i] instead of -i? $\endgroup$ Feb 3 '19 at 17:40
  • $\begingroup$ Try replacing i with I if you want $\sqrt{-1}$. $\endgroup$
    – Somos
    Feb 3 '19 at 17:42

I think the inner-product function needs to be linear in the second argument, meaning you need to reverse the order of the parameters in your inner-product function. If you set w=a+I*b and reverse your inner-product function:

F = Integrate[ComplexExpand[Conjugate[#1]]*#2, {x, -Pi, Pi}] &

then this simplified example works:

S = Orthogonalize[{E^x, E^(w^1*x)}, F]


F[S[[1]], S[[1]]]
(* 1 *)
F[S[[1]], S[[2]]]
(* 0 *)

With your four terms it should work too, but will take a long time.

Keep in mind that the manual on Orthogonalize says that "The $e_i$ can be any expressions for which $f$ always yields real results." Your example does not satisfy this condition (some of the overlap integrals are complex-valued); what I wrote above about linearity in the second argument may or may not work properly.

  • $\begingroup$ There is an example u = Orthogonalize[RandomComplex[1 + I, {4, 4}]] in the help. $\endgroup$
    – user64494
    Feb 3 '19 at 18:49
  • $\begingroup$ Look in en.wikipedia.org/wiki/Inner_product_space concerning linearity in the second argument. This property is not required. $\endgroup$
    – user64494
    Feb 3 '19 at 18:56
  • $\begingroup$ Seem to work, thanks! $\endgroup$ Feb 3 '19 at 19:03
  • $\begingroup$ @user64494 you're correct about the mathematical definitions (wiki link); however this is not how it's implemented in Mathematica. When I define F = Integrate[#1*ComplexExpand[Conjugate[#2]], {x, -Pi, Pi}] & to make the inner-product function linear in the first argument, as initially proposed, then the result is incorrect in the sense that F[S[[1]], S[[2]]] does not give zero. $\endgroup$
    – Roman
    Feb 3 '19 at 19:36
  • $\begingroup$ Upgrade your math. BTW, Maple produces answer to the original question with $w=(-1)^{\frac 1 4}$ in approximately 400 seconds. $\endgroup$
    – user64494
    Feb 3 '19 at 19:47

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.