What am I doing wrong in this use of split?












2















I'm doing something wrong in the code below that makes the last equation not be written on a line by itself. What I'm trying to do is to split the penultimate equation into two lines. But this happens:



enter image description here



The last equation continues on the right for some reason. Can you spot what is the problem?



usepackage{amsmath}
newcommand{q}[2]{langle #1 | #2 rangle}
newcommand{qr}[1]{|#1rangle}
newcommand{ql}[1]{langle #1|}
DeclareMathOperator{mdc}{mdc}

begin{document}
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
begin{split}
&= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
&qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0\
end{split}
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{align*}

end{document}









share|improve this question


















  • 2





    I'm not quite sure what you're aiming for, but have you tried commenting out the begin{split} and end{split}, and leaving the inner two lines alone?

    – Teepeemm
    11 hours ago











  • Wow. Why am I using split in the first place? I thought this wouldn't work at all.

    – Joep Awinita
    11 hours ago











  • Needless to say, @Teepeemm, you're answered the question completely.

    – Joep Awinita
    11 hours ago











  • But a two line comment takes far less effort than a complete answer. I'm content with letting those wanting to take the time to also take the points.

    – Teepeemm
    10 hours ago
















2















I'm doing something wrong in the code below that makes the last equation not be written on a line by itself. What I'm trying to do is to split the penultimate equation into two lines. But this happens:



enter image description here



The last equation continues on the right for some reason. Can you spot what is the problem?



usepackage{amsmath}
newcommand{q}[2]{langle #1 | #2 rangle}
newcommand{qr}[1]{|#1rangle}
newcommand{ql}[1]{langle #1|}
DeclareMathOperator{mdc}{mdc}

begin{document}
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
begin{split}
&= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
&qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0\
end{split}
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{align*}

end{document}









share|improve this question


















  • 2





    I'm not quite sure what you're aiming for, but have you tried commenting out the begin{split} and end{split}, and leaving the inner two lines alone?

    – Teepeemm
    11 hours ago











  • Wow. Why am I using split in the first place? I thought this wouldn't work at all.

    – Joep Awinita
    11 hours ago











  • Needless to say, @Teepeemm, you're answered the question completely.

    – Joep Awinita
    11 hours ago











  • But a two line comment takes far less effort than a complete answer. I'm content with letting those wanting to take the time to also take the points.

    – Teepeemm
    10 hours ago














2












2








2








I'm doing something wrong in the code below that makes the last equation not be written on a line by itself. What I'm trying to do is to split the penultimate equation into two lines. But this happens:



enter image description here



The last equation continues on the right for some reason. Can you spot what is the problem?



usepackage{amsmath}
newcommand{q}[2]{langle #1 | #2 rangle}
newcommand{qr}[1]{|#1rangle}
newcommand{ql}[1]{langle #1|}
DeclareMathOperator{mdc}{mdc}

begin{document}
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
begin{split}
&= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
&qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0\
end{split}
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{align*}

end{document}









share|improve this question














I'm doing something wrong in the code below that makes the last equation not be written on a line by itself. What I'm trying to do is to split the penultimate equation into two lines. But this happens:



enter image description here



The last equation continues on the right for some reason. Can you spot what is the problem?



usepackage{amsmath}
newcommand{q}[2]{langle #1 | #2 rangle}
newcommand{qr}[1]{|#1rangle}
newcommand{ql}[1]{langle #1|}
DeclareMathOperator{mdc}{mdc}

begin{document}
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
begin{split}
&= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
&qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0\
end{split}
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{align*}

end{document}






align split






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 11 hours ago









Joep AwinitaJoep Awinita

1256




1256








  • 2





    I'm not quite sure what you're aiming for, but have you tried commenting out the begin{split} and end{split}, and leaving the inner two lines alone?

    – Teepeemm
    11 hours ago











  • Wow. Why am I using split in the first place? I thought this wouldn't work at all.

    – Joep Awinita
    11 hours ago











  • Needless to say, @Teepeemm, you're answered the question completely.

    – Joep Awinita
    11 hours ago











  • But a two line comment takes far less effort than a complete answer. I'm content with letting those wanting to take the time to also take the points.

    – Teepeemm
    10 hours ago














  • 2





    I'm not quite sure what you're aiming for, but have you tried commenting out the begin{split} and end{split}, and leaving the inner two lines alone?

    – Teepeemm
    11 hours ago











  • Wow. Why am I using split in the first place? I thought this wouldn't work at all.

    – Joep Awinita
    11 hours ago











  • Needless to say, @Teepeemm, you're answered the question completely.

    – Joep Awinita
    11 hours ago











  • But a two line comment takes far less effort than a complete answer. I'm content with letting those wanting to take the time to also take the points.

    – Teepeemm
    10 hours ago








2




2





I'm not quite sure what you're aiming for, but have you tried commenting out the begin{split} and end{split}, and leaving the inner two lines alone?

– Teepeemm
11 hours ago





I'm not quite sure what you're aiming for, but have you tried commenting out the begin{split} and end{split}, and leaving the inner two lines alone?

– Teepeemm
11 hours ago













Wow. Why am I using split in the first place? I thought this wouldn't work at all.

– Joep Awinita
11 hours ago





Wow. Why am I using split in the first place? I thought this wouldn't work at all.

– Joep Awinita
11 hours ago













Needless to say, @Teepeemm, you're answered the question completely.

– Joep Awinita
11 hours ago





Needless to say, @Teepeemm, you're answered the question completely.

– Joep Awinita
11 hours ago













But a two line comment takes far less effort than a complete answer. I'm content with letting those wanting to take the time to also take the points.

– Teepeemm
10 hours ago





But a two line comment takes far less effort than a complete answer. I'm content with letting those wanting to take the time to also take the points.

– Teepeemm
10 hours ago










3 Answers
3






active

oldest

votes


















2














In addition to getting rid of the unneeded split environment, you may want to (a) typeset the U_f terms more compactly, i.e., as U_{!f}, (b) replace various left[ and right] directives with bigl[ and bigr], and (c) replace ... with dots.



enter image description here



documentclass{article}
usepackage{mathtools} % for 'DeclarePairedDelimiter' macro
DeclarePairedDelimiterqrlvertrangle
newcommand{Uf}{U_{!f}}

begin{document}

begin{align*}
qr{psi_2}
&= Uf qr{psi_1}\
&= Uf frac{1}{sqrt{2^4}}
bigl[qr0 + qr1 + qr2+qr3 +qr4
+qr5 +qr6 + qr7bigr] qr0 qr0\
&= Uf frac{1}{sqrt{2^4}}
bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0
+qr4qr0+qr5qr0+qr6qr0 + qr7qr0bigr] qr0\
&= frac{1}{sqrt{2^4}}
bigl[Ufqr0qr0 + Ufqr1qr0 + Ufqr2qr0+Ufqr3qr0 \
&qquadqquad
+ Ufqr4qr0+Ufqr5qr0+Ufqr6qr0
+ Ufqr7qr0bigr] qr0\
&= frac{1}{sqrt{2^4}}
bigl[qr0qr2 + qr1qr4 + dots
+ qr{i}qr{f(i)} + dots + qr7qr1bigr] qr0,
end{align*}
end{document}





share|improve this answer































    1














    I suggest using the multlined environment from mathtools, and the DeclarePairedDelimiter command from the same package, which will produce scaling , qr and ql:



    documentclass{article}
    usepackage{mathtools}
    DeclarePairedDelimiterXnorm[1]lVertrVert{ifblank{#1}{: · :}{#1}}
    DeclarePairedDelimiterXPP{twonorm }[1]{}{lVert}{rVert}{_{2}}{ifblank{#1}{: · :}{#1}}
    DeclarePairedDelimiterXq[2]{langle}{rangle}%
    {#1,delimsizevert,mathopen{}#2}
    DeclarePairedDelimiter{qr}vertrangle
    DeclarePairedDelimiter{ql}langle rvert
    DeclareMathOperator{mdc}{mdc}

    begin{document}

    begin{align*}
    qr{psi_2} &= U_f qr{psi_1}\
    &= U_f frac{1}{sqrt{2^4}} bigl[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}bigr] qr0 qr0\
    &= U_f frac{1}{sqrt{2^4}}bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0bigr] qr0\
    &= begin{multlined}[t] frac{1}{sqrt{2^4}} bigl[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
    qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0bigr] qr0
    end{multlined}\
    &= frac{1}{sqrt{2^4}}bigl[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1bigr] qr0,
    end{align*}

    end{document}


    enter image description here






    share|improve this answer


























    • The left and right directives don't succeed in making "big" square brackets -- better to use bigl[ and bigr], right? :-)

      – Mico
      10 hours ago











    • That's right. Actually, I didn't think about this problem, but I see I should have, to make the formula a little less unpleasant to read. I'll fix that. Thanks!

      – Bernard
      9 hours ago



















    0














    I think the reason you are getting this result is that the second linebreak inside the split environment should be outside, like this:



    begin{align*}
    qr{psi_2} &= U_f qr{psi_1}\
    &= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
    &= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
    begin{split}
    &= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
    &qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
    end{split}\
    &= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
    end{align*}


    Besides the recomendations given in Bernard's answer, I'd also suggest using the split environment inside equation* instead of align*, since it seems you're trying to typeset just one (albeit multi-line) equation:



    documentclass{article}
    usepackage{amsmath}
    newcommand{q}[2]{langle #1 | #2 rangle}
    newcommand{qr}[1]{|#1rangle}
    newcommand{ql}[1]{langle #1|}
    DeclareMathOperator{mdc}{mdc}

    begin{document}

    begin{equation*}
    begin{split}
    qr{psi_2} &= U_f qr{psi_1}\
    &= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
    &= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
    &=!begin{multlined}[t] frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
    qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
    end{multlined}\
    &= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
    end{split}
    end{equation*}

    end{document}





    share|improve this answer










    New contributor




    Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.
















    • 1





      But how to align the equal signs within equation? align is appropriate here.

      – Sigur
      10 hours ago













    • I forgot to add that I'd recomend using the split environment to align the equal signs and the multlined environment to break one the lines into two.

      – Vinicius M. G. Silveira
      10 hours ago











    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    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: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476218%2fwhat-am-i-doing-wrong-in-this-use-of-split%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    In addition to getting rid of the unneeded split environment, you may want to (a) typeset the U_f terms more compactly, i.e., as U_{!f}, (b) replace various left[ and right] directives with bigl[ and bigr], and (c) replace ... with dots.



    enter image description here



    documentclass{article}
    usepackage{mathtools} % for 'DeclarePairedDelimiter' macro
    DeclarePairedDelimiterqrlvertrangle
    newcommand{Uf}{U_{!f}}

    begin{document}

    begin{align*}
    qr{psi_2}
    &= Uf qr{psi_1}\
    &= Uf frac{1}{sqrt{2^4}}
    bigl[qr0 + qr1 + qr2+qr3 +qr4
    +qr5 +qr6 + qr7bigr] qr0 qr0\
    &= Uf frac{1}{sqrt{2^4}}
    bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0
    +qr4qr0+qr5qr0+qr6qr0 + qr7qr0bigr] qr0\
    &= frac{1}{sqrt{2^4}}
    bigl[Ufqr0qr0 + Ufqr1qr0 + Ufqr2qr0+Ufqr3qr0 \
    &qquadqquad
    + Ufqr4qr0+Ufqr5qr0+Ufqr6qr0
    + Ufqr7qr0bigr] qr0\
    &= frac{1}{sqrt{2^4}}
    bigl[qr0qr2 + qr1qr4 + dots
    + qr{i}qr{f(i)} + dots + qr7qr1bigr] qr0,
    end{align*}
    end{document}





    share|improve this answer




























      2














      In addition to getting rid of the unneeded split environment, you may want to (a) typeset the U_f terms more compactly, i.e., as U_{!f}, (b) replace various left[ and right] directives with bigl[ and bigr], and (c) replace ... with dots.



      enter image description here



      documentclass{article}
      usepackage{mathtools} % for 'DeclarePairedDelimiter' macro
      DeclarePairedDelimiterqrlvertrangle
      newcommand{Uf}{U_{!f}}

      begin{document}

      begin{align*}
      qr{psi_2}
      &= Uf qr{psi_1}\
      &= Uf frac{1}{sqrt{2^4}}
      bigl[qr0 + qr1 + qr2+qr3 +qr4
      +qr5 +qr6 + qr7bigr] qr0 qr0\
      &= Uf frac{1}{sqrt{2^4}}
      bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0
      +qr4qr0+qr5qr0+qr6qr0 + qr7qr0bigr] qr0\
      &= frac{1}{sqrt{2^4}}
      bigl[Ufqr0qr0 + Ufqr1qr0 + Ufqr2qr0+Ufqr3qr0 \
      &qquadqquad
      + Ufqr4qr0+Ufqr5qr0+Ufqr6qr0
      + Ufqr7qr0bigr] qr0\
      &= frac{1}{sqrt{2^4}}
      bigl[qr0qr2 + qr1qr4 + dots
      + qr{i}qr{f(i)} + dots + qr7qr1bigr] qr0,
      end{align*}
      end{document}





      share|improve this answer


























        2












        2








        2







        In addition to getting rid of the unneeded split environment, you may want to (a) typeset the U_f terms more compactly, i.e., as U_{!f}, (b) replace various left[ and right] directives with bigl[ and bigr], and (c) replace ... with dots.



        enter image description here



        documentclass{article}
        usepackage{mathtools} % for 'DeclarePairedDelimiter' macro
        DeclarePairedDelimiterqrlvertrangle
        newcommand{Uf}{U_{!f}}

        begin{document}

        begin{align*}
        qr{psi_2}
        &= Uf qr{psi_1}\
        &= Uf frac{1}{sqrt{2^4}}
        bigl[qr0 + qr1 + qr2+qr3 +qr4
        +qr5 +qr6 + qr7bigr] qr0 qr0\
        &= Uf frac{1}{sqrt{2^4}}
        bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0
        +qr4qr0+qr5qr0+qr6qr0 + qr7qr0bigr] qr0\
        &= frac{1}{sqrt{2^4}}
        bigl[Ufqr0qr0 + Ufqr1qr0 + Ufqr2qr0+Ufqr3qr0 \
        &qquadqquad
        + Ufqr4qr0+Ufqr5qr0+Ufqr6qr0
        + Ufqr7qr0bigr] qr0\
        &= frac{1}{sqrt{2^4}}
        bigl[qr0qr2 + qr1qr4 + dots
        + qr{i}qr{f(i)} + dots + qr7qr1bigr] qr0,
        end{align*}
        end{document}





        share|improve this answer













        In addition to getting rid of the unneeded split environment, you may want to (a) typeset the U_f terms more compactly, i.e., as U_{!f}, (b) replace various left[ and right] directives with bigl[ and bigr], and (c) replace ... with dots.



        enter image description here



        documentclass{article}
        usepackage{mathtools} % for 'DeclarePairedDelimiter' macro
        DeclarePairedDelimiterqrlvertrangle
        newcommand{Uf}{U_{!f}}

        begin{document}

        begin{align*}
        qr{psi_2}
        &= Uf qr{psi_1}\
        &= Uf frac{1}{sqrt{2^4}}
        bigl[qr0 + qr1 + qr2+qr3 +qr4
        +qr5 +qr6 + qr7bigr] qr0 qr0\
        &= Uf frac{1}{sqrt{2^4}}
        bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0
        +qr4qr0+qr5qr0+qr6qr0 + qr7qr0bigr] qr0\
        &= frac{1}{sqrt{2^4}}
        bigl[Ufqr0qr0 + Ufqr1qr0 + Ufqr2qr0+Ufqr3qr0 \
        &qquadqquad
        + Ufqr4qr0+Ufqr5qr0+Ufqr6qr0
        + Ufqr7qr0bigr] qr0\
        &= frac{1}{sqrt{2^4}}
        bigl[qr0qr2 + qr1qr4 + dots
        + qr{i}qr{f(i)} + dots + qr7qr1bigr] qr0,
        end{align*}
        end{document}






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 10 hours ago









        MicoMico

        280k31381770




        280k31381770























            1














            I suggest using the multlined environment from mathtools, and the DeclarePairedDelimiter command from the same package, which will produce scaling , qr and ql:



            documentclass{article}
            usepackage{mathtools}
            DeclarePairedDelimiterXnorm[1]lVertrVert{ifblank{#1}{: · :}{#1}}
            DeclarePairedDelimiterXPP{twonorm }[1]{}{lVert}{rVert}{_{2}}{ifblank{#1}{: · :}{#1}}
            DeclarePairedDelimiterXq[2]{langle}{rangle}%
            {#1,delimsizevert,mathopen{}#2}
            DeclarePairedDelimiter{qr}vertrangle
            DeclarePairedDelimiter{ql}langle rvert
            DeclareMathOperator{mdc}{mdc}

            begin{document}

            begin{align*}
            qr{psi_2} &= U_f qr{psi_1}\
            &= U_f frac{1}{sqrt{2^4}} bigl[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}bigr] qr0 qr0\
            &= U_f frac{1}{sqrt{2^4}}bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0bigr] qr0\
            &= begin{multlined}[t] frac{1}{sqrt{2^4}} bigl[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
            qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0bigr] qr0
            end{multlined}\
            &= frac{1}{sqrt{2^4}}bigl[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1bigr] qr0,
            end{align*}

            end{document}


            enter image description here






            share|improve this answer


























            • The left and right directives don't succeed in making "big" square brackets -- better to use bigl[ and bigr], right? :-)

              – Mico
              10 hours ago











            • That's right. Actually, I didn't think about this problem, but I see I should have, to make the formula a little less unpleasant to read. I'll fix that. Thanks!

              – Bernard
              9 hours ago
















            1














            I suggest using the multlined environment from mathtools, and the DeclarePairedDelimiter command from the same package, which will produce scaling , qr and ql:



            documentclass{article}
            usepackage{mathtools}
            DeclarePairedDelimiterXnorm[1]lVertrVert{ifblank{#1}{: · :}{#1}}
            DeclarePairedDelimiterXPP{twonorm }[1]{}{lVert}{rVert}{_{2}}{ifblank{#1}{: · :}{#1}}
            DeclarePairedDelimiterXq[2]{langle}{rangle}%
            {#1,delimsizevert,mathopen{}#2}
            DeclarePairedDelimiter{qr}vertrangle
            DeclarePairedDelimiter{ql}langle rvert
            DeclareMathOperator{mdc}{mdc}

            begin{document}

            begin{align*}
            qr{psi_2} &= U_f qr{psi_1}\
            &= U_f frac{1}{sqrt{2^4}} bigl[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}bigr] qr0 qr0\
            &= U_f frac{1}{sqrt{2^4}}bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0bigr] qr0\
            &= begin{multlined}[t] frac{1}{sqrt{2^4}} bigl[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
            qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0bigr] qr0
            end{multlined}\
            &= frac{1}{sqrt{2^4}}bigl[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1bigr] qr0,
            end{align*}

            end{document}


            enter image description here






            share|improve this answer


























            • The left and right directives don't succeed in making "big" square brackets -- better to use bigl[ and bigr], right? :-)

              – Mico
              10 hours ago











            • That's right. Actually, I didn't think about this problem, but I see I should have, to make the formula a little less unpleasant to read. I'll fix that. Thanks!

              – Bernard
              9 hours ago














            1












            1








            1







            I suggest using the multlined environment from mathtools, and the DeclarePairedDelimiter command from the same package, which will produce scaling , qr and ql:



            documentclass{article}
            usepackage{mathtools}
            DeclarePairedDelimiterXnorm[1]lVertrVert{ifblank{#1}{: · :}{#1}}
            DeclarePairedDelimiterXPP{twonorm }[1]{}{lVert}{rVert}{_{2}}{ifblank{#1}{: · :}{#1}}
            DeclarePairedDelimiterXq[2]{langle}{rangle}%
            {#1,delimsizevert,mathopen{}#2}
            DeclarePairedDelimiter{qr}vertrangle
            DeclarePairedDelimiter{ql}langle rvert
            DeclareMathOperator{mdc}{mdc}

            begin{document}

            begin{align*}
            qr{psi_2} &= U_f qr{psi_1}\
            &= U_f frac{1}{sqrt{2^4}} bigl[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}bigr] qr0 qr0\
            &= U_f frac{1}{sqrt{2^4}}bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0bigr] qr0\
            &= begin{multlined}[t] frac{1}{sqrt{2^4}} bigl[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
            qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0bigr] qr0
            end{multlined}\
            &= frac{1}{sqrt{2^4}}bigl[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1bigr] qr0,
            end{align*}

            end{document}


            enter image description here






            share|improve this answer















            I suggest using the multlined environment from mathtools, and the DeclarePairedDelimiter command from the same package, which will produce scaling , qr and ql:



            documentclass{article}
            usepackage{mathtools}
            DeclarePairedDelimiterXnorm[1]lVertrVert{ifblank{#1}{: · :}{#1}}
            DeclarePairedDelimiterXPP{twonorm }[1]{}{lVert}{rVert}{_{2}}{ifblank{#1}{: · :}{#1}}
            DeclarePairedDelimiterXq[2]{langle}{rangle}%
            {#1,delimsizevert,mathopen{}#2}
            DeclarePairedDelimiter{qr}vertrangle
            DeclarePairedDelimiter{ql}langle rvert
            DeclareMathOperator{mdc}{mdc}

            begin{document}

            begin{align*}
            qr{psi_2} &= U_f qr{psi_1}\
            &= U_f frac{1}{sqrt{2^4}} bigl[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}bigr] qr0 qr0\
            &= U_f frac{1}{sqrt{2^4}}bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0bigr] qr0\
            &= begin{multlined}[t] frac{1}{sqrt{2^4}} bigl[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
            qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0bigr] qr0
            end{multlined}\
            &= frac{1}{sqrt{2^4}}bigl[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1bigr] qr0,
            end{align*}

            end{document}


            enter image description here







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 9 hours ago

























            answered 10 hours ago









            BernardBernard

            171k775202




            171k775202













            • The left and right directives don't succeed in making "big" square brackets -- better to use bigl[ and bigr], right? :-)

              – Mico
              10 hours ago











            • That's right. Actually, I didn't think about this problem, but I see I should have, to make the formula a little less unpleasant to read. I'll fix that. Thanks!

              – Bernard
              9 hours ago



















            • The left and right directives don't succeed in making "big" square brackets -- better to use bigl[ and bigr], right? :-)

              – Mico
              10 hours ago











            • That's right. Actually, I didn't think about this problem, but I see I should have, to make the formula a little less unpleasant to read. I'll fix that. Thanks!

              – Bernard
              9 hours ago

















            The left and right directives don't succeed in making "big" square brackets -- better to use bigl[ and bigr], right? :-)

            – Mico
            10 hours ago





            The left and right directives don't succeed in making "big" square brackets -- better to use bigl[ and bigr], right? :-)

            – Mico
            10 hours ago













            That's right. Actually, I didn't think about this problem, but I see I should have, to make the formula a little less unpleasant to read. I'll fix that. Thanks!

            – Bernard
            9 hours ago





            That's right. Actually, I didn't think about this problem, but I see I should have, to make the formula a little less unpleasant to read. I'll fix that. Thanks!

            – Bernard
            9 hours ago











            0














            I think the reason you are getting this result is that the second linebreak inside the split environment should be outside, like this:



            begin{align*}
            qr{psi_2} &= U_f qr{psi_1}\
            &= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
            &= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
            begin{split}
            &= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
            &qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
            end{split}\
            &= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
            end{align*}


            Besides the recomendations given in Bernard's answer, I'd also suggest using the split environment inside equation* instead of align*, since it seems you're trying to typeset just one (albeit multi-line) equation:



            documentclass{article}
            usepackage{amsmath}
            newcommand{q}[2]{langle #1 | #2 rangle}
            newcommand{qr}[1]{|#1rangle}
            newcommand{ql}[1]{langle #1|}
            DeclareMathOperator{mdc}{mdc}

            begin{document}

            begin{equation*}
            begin{split}
            qr{psi_2} &= U_f qr{psi_1}\
            &= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
            &= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
            &=!begin{multlined}[t] frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
            qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
            end{multlined}\
            &= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
            end{split}
            end{equation*}

            end{document}





            share|improve this answer










            New contributor




            Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.
















            • 1





              But how to align the equal signs within equation? align is appropriate here.

              – Sigur
              10 hours ago













            • I forgot to add that I'd recomend using the split environment to align the equal signs and the multlined environment to break one the lines into two.

              – Vinicius M. G. Silveira
              10 hours ago
















            0














            I think the reason you are getting this result is that the second linebreak inside the split environment should be outside, like this:



            begin{align*}
            qr{psi_2} &= U_f qr{psi_1}\
            &= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
            &= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
            begin{split}
            &= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
            &qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
            end{split}\
            &= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
            end{align*}


            Besides the recomendations given in Bernard's answer, I'd also suggest using the split environment inside equation* instead of align*, since it seems you're trying to typeset just one (albeit multi-line) equation:



            documentclass{article}
            usepackage{amsmath}
            newcommand{q}[2]{langle #1 | #2 rangle}
            newcommand{qr}[1]{|#1rangle}
            newcommand{ql}[1]{langle #1|}
            DeclareMathOperator{mdc}{mdc}

            begin{document}

            begin{equation*}
            begin{split}
            qr{psi_2} &= U_f qr{psi_1}\
            &= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
            &= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
            &=!begin{multlined}[t] frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
            qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
            end{multlined}\
            &= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
            end{split}
            end{equation*}

            end{document}





            share|improve this answer










            New contributor




            Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.
















            • 1





              But how to align the equal signs within equation? align is appropriate here.

              – Sigur
              10 hours ago













            • I forgot to add that I'd recomend using the split environment to align the equal signs and the multlined environment to break one the lines into two.

              – Vinicius M. G. Silveira
              10 hours ago














            0












            0








            0







            I think the reason you are getting this result is that the second linebreak inside the split environment should be outside, like this:



            begin{align*}
            qr{psi_2} &= U_f qr{psi_1}\
            &= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
            &= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
            begin{split}
            &= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
            &qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
            end{split}\
            &= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
            end{align*}


            Besides the recomendations given in Bernard's answer, I'd also suggest using the split environment inside equation* instead of align*, since it seems you're trying to typeset just one (albeit multi-line) equation:



            documentclass{article}
            usepackage{amsmath}
            newcommand{q}[2]{langle #1 | #2 rangle}
            newcommand{qr}[1]{|#1rangle}
            newcommand{ql}[1]{langle #1|}
            DeclareMathOperator{mdc}{mdc}

            begin{document}

            begin{equation*}
            begin{split}
            qr{psi_2} &= U_f qr{psi_1}\
            &= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
            &= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
            &=!begin{multlined}[t] frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
            qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
            end{multlined}\
            &= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
            end{split}
            end{equation*}

            end{document}





            share|improve this answer










            New contributor




            Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.










            I think the reason you are getting this result is that the second linebreak inside the split environment should be outside, like this:



            begin{align*}
            qr{psi_2} &= U_f qr{psi_1}\
            &= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
            &= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
            begin{split}
            &= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
            &qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
            end{split}\
            &= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
            end{align*}


            Besides the recomendations given in Bernard's answer, I'd also suggest using the split environment inside equation* instead of align*, since it seems you're trying to typeset just one (albeit multi-line) equation:



            documentclass{article}
            usepackage{amsmath}
            newcommand{q}[2]{langle #1 | #2 rangle}
            newcommand{qr}[1]{|#1rangle}
            newcommand{ql}[1]{langle #1|}
            DeclareMathOperator{mdc}{mdc}

            begin{document}

            begin{equation*}
            begin{split}
            qr{psi_2} &= U_f qr{psi_1}\
            &= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
            &= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
            &=!begin{multlined}[t] frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
            qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
            end{multlined}\
            &= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
            end{split}
            end{equation*}

            end{document}






            share|improve this answer










            New contributor




            Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            share|improve this answer



            share|improve this answer








            edited 10 hours ago





















            New contributor




            Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            answered 10 hours ago









            Vinicius M. G. SilveiraVinicius M. G. Silveira

            12




            12




            New contributor




            Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





            New contributor





            Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






            Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.








            • 1





              But how to align the equal signs within equation? align is appropriate here.

              – Sigur
              10 hours ago













            • I forgot to add that I'd recomend using the split environment to align the equal signs and the multlined environment to break one the lines into two.

              – Vinicius M. G. Silveira
              10 hours ago














            • 1





              But how to align the equal signs within equation? align is appropriate here.

              – Sigur
              10 hours ago













            • I forgot to add that I'd recomend using the split environment to align the equal signs and the multlined environment to break one the lines into two.

              – Vinicius M. G. Silveira
              10 hours ago








            1




            1





            But how to align the equal signs within equation? align is appropriate here.

            – Sigur
            10 hours ago







            But how to align the equal signs within equation? align is appropriate here.

            – Sigur
            10 hours ago















            I forgot to add that I'd recomend using the split environment to align the equal signs and the multlined environment to break one the lines into two.

            – Vinicius M. G. Silveira
            10 hours ago





            I forgot to add that I'd recomend using the split environment to align the equal signs and the multlined environment to break one the lines into two.

            – Vinicius M. G. Silveira
            10 hours ago


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX 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.


            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%2ftex.stackexchange.com%2fquestions%2f476218%2fwhat-am-i-doing-wrong-in-this-use-of-split%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

            "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

            Alcedinidae

            Origin of the phrase “under your belt”?