Message Boards Message Boards


Recognize the norm of a vector using Assumptions?

Posted 8 months ago
1 Reply
1 Total Likes


In my recent calculations for theoretical physics homework I have to do some bigger matrix multiplications. It would be nice if Mathematica could recognize for example Sqrt[b1^2+b2^2+b3^2] as the norm of my vector B or some other name I gave it an advance.

I tried working with Assumptions and (Full-)Simplify but it didn't help in any way. Thank you for some help! Nicolai

Here are some ideas:

myNorm[x_] := \[LeftDoubleBracketingBar]x\[RightDoubleBracketingBar];
sqrtToNorm =
  {Sqrt[b1^2 + b2^2 + b3^2] -> myNorm[B],
   Sqrt[c1^2 + c2^2 + c3^2] -> myNorm[C]};
normToSqrt = Map[Reverse, sqrtToNorm];
Sqrt[b1^2 + b2^2 + b3^2] +
  Sqrt[c1^2 + c2^2 + c3^2] /. sqrtToNorm
% /. normToSqrt
Norm[{b1, b2, b3}] /. Abs -> Identity /.
Sqrt[a^2 + b^2 + c^2] /.

 Sqrt[x_^2 + y_^2 + z_^2] :> myNorm[{x, y, z}]
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract