Gram--Schmidt ortogonalization for complex functions












0












$begingroup$


I am trying to perform the Gram--Schmidt orthogonalization on a set of continuos complex functions. Numerical solution would be quite sufficient for me.



I have three continuous functions of complex argument on $[0,pi]$:



$$
f_1(x) = sin(x) \
f_2(x) = sin(2x) \
f_3(x) = sin(3x) \
$$



These are obviously orthogonal and I have checked that my Maple and Octave algorithms confirm that.



However, even a slight detour to the complex plane ruins the final set orthogonality. For example:



$$
f_1(x) = sin(x - 0.01mathrm{i}x) \
f_2(x) = sin(2x) \
$$



Then by the modified Gram-Schmidt:



$$
g_1 = frac{f_1}{sqrt{langle f_1,f_1rangle}} \
g_2 = f_2 - langle g_1,f_2rangle g_1 \
g_2 := frac{g_2}{sqrt{langle g_2,g_2rangle}}
$$



where ${langle r,s rangle} = int_0^pi fg^* mathrm{d}x$.



Yet only the real part of ${langle g_1,g_2 rangle}$ is zero (to the machine precision). The imaginary part is non-vanishing. Since I have tried the same procedure in Maple as well as in Octave obtaining the same results (I mean exactly the same, no implementation bias) I must be missing something more fundamental. Any help and/or hints, please?










share|cite|improve this question









$endgroup$








  • 1




    $begingroup$
    Are you sure you are not just having rounding errors?
    $endgroup$
    – SmileyCraft
    Jan 25 at 21:22






  • 2




    $begingroup$
    Maybe you just need to change $langle g_1,f_2rangle$ to $langle f_2,g_1rangle$. The order does matter, but I do not know off the top of my head which order you need here. Recall $langle x,yrangle=overline{langle y,xrangle}$.
    $endgroup$
    – SmileyCraft
    Jan 25 at 21:24










  • $begingroup$
    @SmileyCraft I cannot fully exclude that but the results in the two mentioned environments match and they do not alter for any computational points refinement. That's suspicious.
    $endgroup$
    – Victor Pira
    Jan 25 at 21:24










  • $begingroup$
    @SmileyCraft YES!!! That was it!
    $endgroup$
    – Victor Pira
    Jan 25 at 21:28
















0












$begingroup$


I am trying to perform the Gram--Schmidt orthogonalization on a set of continuos complex functions. Numerical solution would be quite sufficient for me.



I have three continuous functions of complex argument on $[0,pi]$:



$$
f_1(x) = sin(x) \
f_2(x) = sin(2x) \
f_3(x) = sin(3x) \
$$



These are obviously orthogonal and I have checked that my Maple and Octave algorithms confirm that.



However, even a slight detour to the complex plane ruins the final set orthogonality. For example:



$$
f_1(x) = sin(x - 0.01mathrm{i}x) \
f_2(x) = sin(2x) \
$$



Then by the modified Gram-Schmidt:



$$
g_1 = frac{f_1}{sqrt{langle f_1,f_1rangle}} \
g_2 = f_2 - langle g_1,f_2rangle g_1 \
g_2 := frac{g_2}{sqrt{langle g_2,g_2rangle}}
$$



where ${langle r,s rangle} = int_0^pi fg^* mathrm{d}x$.



Yet only the real part of ${langle g_1,g_2 rangle}$ is zero (to the machine precision). The imaginary part is non-vanishing. Since I have tried the same procedure in Maple as well as in Octave obtaining the same results (I mean exactly the same, no implementation bias) I must be missing something more fundamental. Any help and/or hints, please?










share|cite|improve this question









$endgroup$








  • 1




    $begingroup$
    Are you sure you are not just having rounding errors?
    $endgroup$
    – SmileyCraft
    Jan 25 at 21:22






  • 2




    $begingroup$
    Maybe you just need to change $langle g_1,f_2rangle$ to $langle f_2,g_1rangle$. The order does matter, but I do not know off the top of my head which order you need here. Recall $langle x,yrangle=overline{langle y,xrangle}$.
    $endgroup$
    – SmileyCraft
    Jan 25 at 21:24










  • $begingroup$
    @SmileyCraft I cannot fully exclude that but the results in the two mentioned environments match and they do not alter for any computational points refinement. That's suspicious.
    $endgroup$
    – Victor Pira
    Jan 25 at 21:24










  • $begingroup$
    @SmileyCraft YES!!! That was it!
    $endgroup$
    – Victor Pira
    Jan 25 at 21:28














0












0








0





$begingroup$


I am trying to perform the Gram--Schmidt orthogonalization on a set of continuos complex functions. Numerical solution would be quite sufficient for me.



I have three continuous functions of complex argument on $[0,pi]$:



$$
f_1(x) = sin(x) \
f_2(x) = sin(2x) \
f_3(x) = sin(3x) \
$$



These are obviously orthogonal and I have checked that my Maple and Octave algorithms confirm that.



However, even a slight detour to the complex plane ruins the final set orthogonality. For example:



$$
f_1(x) = sin(x - 0.01mathrm{i}x) \
f_2(x) = sin(2x) \
$$



Then by the modified Gram-Schmidt:



$$
g_1 = frac{f_1}{sqrt{langle f_1,f_1rangle}} \
g_2 = f_2 - langle g_1,f_2rangle g_1 \
g_2 := frac{g_2}{sqrt{langle g_2,g_2rangle}}
$$



where ${langle r,s rangle} = int_0^pi fg^* mathrm{d}x$.



Yet only the real part of ${langle g_1,g_2 rangle}$ is zero (to the machine precision). The imaginary part is non-vanishing. Since I have tried the same procedure in Maple as well as in Octave obtaining the same results (I mean exactly the same, no implementation bias) I must be missing something more fundamental. Any help and/or hints, please?










share|cite|improve this question









$endgroup$




I am trying to perform the Gram--Schmidt orthogonalization on a set of continuos complex functions. Numerical solution would be quite sufficient for me.



I have three continuous functions of complex argument on $[0,pi]$:



$$
f_1(x) = sin(x) \
f_2(x) = sin(2x) \
f_3(x) = sin(3x) \
$$



These are obviously orthogonal and I have checked that my Maple and Octave algorithms confirm that.



However, even a slight detour to the complex plane ruins the final set orthogonality. For example:



$$
f_1(x) = sin(x - 0.01mathrm{i}x) \
f_2(x) = sin(2x) \
$$



Then by the modified Gram-Schmidt:



$$
g_1 = frac{f_1}{sqrt{langle f_1,f_1rangle}} \
g_2 = f_2 - langle g_1,f_2rangle g_1 \
g_2 := frac{g_2}{sqrt{langle g_2,g_2rangle}}
$$



where ${langle r,s rangle} = int_0^pi fg^* mathrm{d}x$.



Yet only the real part of ${langle g_1,g_2 rangle}$ is zero (to the machine precision). The imaginary part is non-vanishing. Since I have tried the same procedure in Maple as well as in Octave obtaining the same results (I mean exactly the same, no implementation bias) I must be missing something more fundamental. Any help and/or hints, please?







complex-analysis orthogonality






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Jan 25 at 21:19









Victor PiraVictor Pira

878




878








  • 1




    $begingroup$
    Are you sure you are not just having rounding errors?
    $endgroup$
    – SmileyCraft
    Jan 25 at 21:22






  • 2




    $begingroup$
    Maybe you just need to change $langle g_1,f_2rangle$ to $langle f_2,g_1rangle$. The order does matter, but I do not know off the top of my head which order you need here. Recall $langle x,yrangle=overline{langle y,xrangle}$.
    $endgroup$
    – SmileyCraft
    Jan 25 at 21:24










  • $begingroup$
    @SmileyCraft I cannot fully exclude that but the results in the two mentioned environments match and they do not alter for any computational points refinement. That's suspicious.
    $endgroup$
    – Victor Pira
    Jan 25 at 21:24










  • $begingroup$
    @SmileyCraft YES!!! That was it!
    $endgroup$
    – Victor Pira
    Jan 25 at 21:28














  • 1




    $begingroup$
    Are you sure you are not just having rounding errors?
    $endgroup$
    – SmileyCraft
    Jan 25 at 21:22






  • 2




    $begingroup$
    Maybe you just need to change $langle g_1,f_2rangle$ to $langle f_2,g_1rangle$. The order does matter, but I do not know off the top of my head which order you need here. Recall $langle x,yrangle=overline{langle y,xrangle}$.
    $endgroup$
    – SmileyCraft
    Jan 25 at 21:24










  • $begingroup$
    @SmileyCraft I cannot fully exclude that but the results in the two mentioned environments match and they do not alter for any computational points refinement. That's suspicious.
    $endgroup$
    – Victor Pira
    Jan 25 at 21:24










  • $begingroup$
    @SmileyCraft YES!!! That was it!
    $endgroup$
    – Victor Pira
    Jan 25 at 21:28








1




1




$begingroup$
Are you sure you are not just having rounding errors?
$endgroup$
– SmileyCraft
Jan 25 at 21:22




$begingroup$
Are you sure you are not just having rounding errors?
$endgroup$
– SmileyCraft
Jan 25 at 21:22




2




2




$begingroup$
Maybe you just need to change $langle g_1,f_2rangle$ to $langle f_2,g_1rangle$. The order does matter, but I do not know off the top of my head which order you need here. Recall $langle x,yrangle=overline{langle y,xrangle}$.
$endgroup$
– SmileyCraft
Jan 25 at 21:24




$begingroup$
Maybe you just need to change $langle g_1,f_2rangle$ to $langle f_2,g_1rangle$. The order does matter, but I do not know off the top of my head which order you need here. Recall $langle x,yrangle=overline{langle y,xrangle}$.
$endgroup$
– SmileyCraft
Jan 25 at 21:24












$begingroup$
@SmileyCraft I cannot fully exclude that but the results in the two mentioned environments match and they do not alter for any computational points refinement. That's suspicious.
$endgroup$
– Victor Pira
Jan 25 at 21:24




$begingroup$
@SmileyCraft I cannot fully exclude that but the results in the two mentioned environments match and they do not alter for any computational points refinement. That's suspicious.
$endgroup$
– Victor Pira
Jan 25 at 21:24












$begingroup$
@SmileyCraft YES!!! That was it!
$endgroup$
– Victor Pira
Jan 25 at 21:28




$begingroup$
@SmileyCraft YES!!! That was it!
$endgroup$
– Victor Pira
Jan 25 at 21:28










0






active

oldest

votes











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3087631%2fgram-schmidt-ortogonalization-for-complex-functions%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3087631%2fgram-schmidt-ortogonalization-for-complex-functions%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Mario Kart Wii

The Binding of Isaac: Rebirth/Afterbirth

What does “Dominus providebit” mean?