Home

sqrtQ2

sqrtQ2 refers to the mathematical expression sqrt(Q^2), the principal square root of the square of a quantity Q. It is used to denote a nonnegative value derived from Q, often interpreted as the magnitude or absolute value of Q when Q is a real number.

For real numbers, sqrt(Q^2) equals |Q|. This follows from the definition of the square root as the

In the complex plane, the situation is more nuanced. The identity sqrt(z^2) is not simply z for

From a computational perspective, sqrtQ2 is often implemented as the absolute value of Q for real inputs,

Applications of sqrtQ2 include converting signed quantities to their magnitudes, computing distances, and forming nonnegative scalars

See also: absolute value, square root, magnitude, norm, complex numbers, principal value.

nonnegative
root
of
a
nonnegative
quantity.
For
example,
sqrt((-5)^2)
=
sqrt(25)
=
5,
even
though
Q
was
-5.
The
expression
thus
enforces
nonnegativity
and
yields
the
magnitude
of
Q
in
the
real
case.
complex
z.
Because
the
square
root
is
multivalued,
the
principal
value
of
sqrt(z^2)
may
equal
z
or
-z
depending
on
the
argument
(angle)
of
z.
Consequently,
sqrt(z^2)
can
differ
from
z
in
complex
analysis,
and
care
is
needed
when
manipulating
such
expressions.
via
sqrt(Q*Q)
or
abs(Q).
Floating-point
rounding
near
zero
can
produce
tiny
negative
artifacts,
so
normalization
with
a
small
epsilon
is
sometimes
applied
to
maintain
nonnegativity.
in
optimization,
physics,
and
engineering
contexts
where
a
magnitude-like
quantity
is
required.