Simplify product of complex numbers









up vote
1
down vote

favorite












I am trying to take product of a complex number with its conjugate. When I take



A*Conjugate[A] // FullSimplify


The output is as desired



Abs[A]^2


But when I try



FullSimplify@(A*Conjugate[A]*B*Conjugate[B])


The output is



A B Conjugate[A] Conjugate[B]


Why mathematica is not showing the output as



Abs[A]^2 Abs[B]^2


I am using Mathematica 11.2.0.










share|improve this question





















  • ComplexExpand does the work: A*Conjugate[A]*B*Conjugate[B] // ComplexExpand.
    – rmw
    Nov 10 at 13:41










  • @rmw - You have let ComplexExpand assume that A and B are real-valued. The OP is working with complex variables.
    – Bob Hanlon
    Nov 10 at 15:29














up vote
1
down vote

favorite












I am trying to take product of a complex number with its conjugate. When I take



A*Conjugate[A] // FullSimplify


The output is as desired



Abs[A]^2


But when I try



FullSimplify@(A*Conjugate[A]*B*Conjugate[B])


The output is



A B Conjugate[A] Conjugate[B]


Why mathematica is not showing the output as



Abs[A]^2 Abs[B]^2


I am using Mathematica 11.2.0.










share|improve this question





















  • ComplexExpand does the work: A*Conjugate[A]*B*Conjugate[B] // ComplexExpand.
    – rmw
    Nov 10 at 13:41










  • @rmw - You have let ComplexExpand assume that A and B are real-valued. The OP is working with complex variables.
    – Bob Hanlon
    Nov 10 at 15:29












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am trying to take product of a complex number with its conjugate. When I take



A*Conjugate[A] // FullSimplify


The output is as desired



Abs[A]^2


But when I try



FullSimplify@(A*Conjugate[A]*B*Conjugate[B])


The output is



A B Conjugate[A] Conjugate[B]


Why mathematica is not showing the output as



Abs[A]^2 Abs[B]^2


I am using Mathematica 11.2.0.










share|improve this question













I am trying to take product of a complex number with its conjugate. When I take



A*Conjugate[A] // FullSimplify


The output is as desired



Abs[A]^2


But when I try



FullSimplify@(A*Conjugate[A]*B*Conjugate[B])


The output is



A B Conjugate[A] Conjugate[B]


Why mathematica is not showing the output as



Abs[A]^2 Abs[B]^2


I am using Mathematica 11.2.0.







simplifying-expressions complex






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 at 11:45









Archimedes

156




156











  • ComplexExpand does the work: A*Conjugate[A]*B*Conjugate[B] // ComplexExpand.
    – rmw
    Nov 10 at 13:41










  • @rmw - You have let ComplexExpand assume that A and B are real-valued. The OP is working with complex variables.
    – Bob Hanlon
    Nov 10 at 15:29
















  • ComplexExpand does the work: A*Conjugate[A]*B*Conjugate[B] // ComplexExpand.
    – rmw
    Nov 10 at 13:41










  • @rmw - You have let ComplexExpand assume that A and B are real-valued. The OP is working with complex variables.
    – Bob Hanlon
    Nov 10 at 15:29















ComplexExpand does the work: A*Conjugate[A]*B*Conjugate[B] // ComplexExpand.
– rmw
Nov 10 at 13:41




ComplexExpand does the work: A*Conjugate[A]*B*Conjugate[B] // ComplexExpand.
– rmw
Nov 10 at 13:41












@rmw - You have let ComplexExpand assume that A and B are real-valued. The OP is working with complex variables.
– Bob Hanlon
Nov 10 at 15:29




@rmw - You have let ComplexExpand assume that A and B are real-valued. The OP is working with complex variables.
– Bob Hanlon
Nov 10 at 15:29










2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted










You can use ComplexExpand



simplify = 
Simplify[ComplexExpand[#, Variables[Level[#, -1]],
TargetFunctions -> Abs, Arg]] &;

A*Conjugate[A] // simplify

(* Abs[A]^2 *)

simplify[A*Conjugate[A]*B*Conjugate[B]]

(* Abs[A]^2 Abs[B]^2 *)





share|improve this answer




















  • Thank you. This will save a lot of time in my calculations :-)
    – Archimedes
    Nov 10 at 15:00

















up vote
1
down vote













It is somewhat counterintuitive, but Mathematica might indeed think that A B Conjugate[A] Conjugate[B] is simpler.



LeafCount[Abs[A]^2 Abs[B]^2]
LeafCount[A B Conjugate[A] Conjugate[B]]



9



7




Notice that LeafCount is not the precise ComplexityFunction used by FullSimplify, but it may still give you an idea.



In the end, simplification is always a matter of taste.






share|improve this answer




















    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: "387"
    ;
    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',
    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%2fmathematica.stackexchange.com%2fquestions%2f185739%2fsimplify-product-of-complex-numbers%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    You can use ComplexExpand



    simplify = 
    Simplify[ComplexExpand[#, Variables[Level[#, -1]],
    TargetFunctions -> Abs, Arg]] &;

    A*Conjugate[A] // simplify

    (* Abs[A]^2 *)

    simplify[A*Conjugate[A]*B*Conjugate[B]]

    (* Abs[A]^2 Abs[B]^2 *)





    share|improve this answer




















    • Thank you. This will save a lot of time in my calculations :-)
      – Archimedes
      Nov 10 at 15:00














    up vote
    1
    down vote



    accepted










    You can use ComplexExpand



    simplify = 
    Simplify[ComplexExpand[#, Variables[Level[#, -1]],
    TargetFunctions -> Abs, Arg]] &;

    A*Conjugate[A] // simplify

    (* Abs[A]^2 *)

    simplify[A*Conjugate[A]*B*Conjugate[B]]

    (* Abs[A]^2 Abs[B]^2 *)





    share|improve this answer




















    • Thank you. This will save a lot of time in my calculations :-)
      – Archimedes
      Nov 10 at 15:00












    up vote
    1
    down vote



    accepted







    up vote
    1
    down vote



    accepted






    You can use ComplexExpand



    simplify = 
    Simplify[ComplexExpand[#, Variables[Level[#, -1]],
    TargetFunctions -> Abs, Arg]] &;

    A*Conjugate[A] // simplify

    (* Abs[A]^2 *)

    simplify[A*Conjugate[A]*B*Conjugate[B]]

    (* Abs[A]^2 Abs[B]^2 *)





    share|improve this answer












    You can use ComplexExpand



    simplify = 
    Simplify[ComplexExpand[#, Variables[Level[#, -1]],
    TargetFunctions -> Abs, Arg]] &;

    A*Conjugate[A] // simplify

    (* Abs[A]^2 *)

    simplify[A*Conjugate[A]*B*Conjugate[B]]

    (* Abs[A]^2 Abs[B]^2 *)






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 10 at 13:33









    Bob Hanlon

    58.2k23594




    58.2k23594











    • Thank you. This will save a lot of time in my calculations :-)
      – Archimedes
      Nov 10 at 15:00
















    • Thank you. This will save a lot of time in my calculations :-)
      – Archimedes
      Nov 10 at 15:00















    Thank you. This will save a lot of time in my calculations :-)
    – Archimedes
    Nov 10 at 15:00




    Thank you. This will save a lot of time in my calculations :-)
    – Archimedes
    Nov 10 at 15:00










    up vote
    1
    down vote













    It is somewhat counterintuitive, but Mathematica might indeed think that A B Conjugate[A] Conjugate[B] is simpler.



    LeafCount[Abs[A]^2 Abs[B]^2]
    LeafCount[A B Conjugate[A] Conjugate[B]]



    9



    7




    Notice that LeafCount is not the precise ComplexityFunction used by FullSimplify, but it may still give you an idea.



    In the end, simplification is always a matter of taste.






    share|improve this answer
























      up vote
      1
      down vote













      It is somewhat counterintuitive, but Mathematica might indeed think that A B Conjugate[A] Conjugate[B] is simpler.



      LeafCount[Abs[A]^2 Abs[B]^2]
      LeafCount[A B Conjugate[A] Conjugate[B]]



      9



      7




      Notice that LeafCount is not the precise ComplexityFunction used by FullSimplify, but it may still give you an idea.



      In the end, simplification is always a matter of taste.






      share|improve this answer






















        up vote
        1
        down vote










        up vote
        1
        down vote









        It is somewhat counterintuitive, but Mathematica might indeed think that A B Conjugate[A] Conjugate[B] is simpler.



        LeafCount[Abs[A]^2 Abs[B]^2]
        LeafCount[A B Conjugate[A] Conjugate[B]]



        9



        7




        Notice that LeafCount is not the precise ComplexityFunction used by FullSimplify, but it may still give you an idea.



        In the end, simplification is always a matter of taste.






        share|improve this answer












        It is somewhat counterintuitive, but Mathematica might indeed think that A B Conjugate[A] Conjugate[B] is simpler.



        LeafCount[Abs[A]^2 Abs[B]^2]
        LeafCount[A B Conjugate[A] Conjugate[B]]



        9



        7




        Notice that LeafCount is not the precise ComplexityFunction used by FullSimplify, but it may still give you an idea.



        In the end, simplification is always a matter of taste.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 10 at 11:51









        Henrik Schumacher

        46.8k466134




        46.8k466134



























            draft saved

            draft discarded
















































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





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2fmathematica.stackexchange.com%2fquestions%2f185739%2fsimplify-product-of-complex-numbers%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

            Kleinkühnau

            Makov (Slowakei)

            Deutsches Schauspielhaus