Skip to content(if available)orjump to list(if available)

Calculating the norm of a complex number

cool_dude85

>Since complex numbers are also a vector space (of dimension 1)

This statement seems very likely to confuse someone who doesn't know about or understand how to compute the norm of a complex number.

Complex numbers are a 1-dimensional vector space over the complex numbers themselves, but are probably more readily understood as a two-dimensional vector space over the reals. Any field is a vector space of dimension 1 over itself.

youoy

He does this to justify that we can define a norm over C, because the definitions speaks about vector spaces.

For me that section is not necessary, because he justifies the formula for the norm based on the definition of the norm, which in turn is historically justified by the norm over R2, which is by no doubt the first example of norm discovered (Pythagoras theorem).

andrewla

The trouble is that complex conjugation is not holomorphic (analytic) over the complex numbers.

It's incredibly useful as an operator, and it appears all over the place in Hilbert spaces and other complex-probability situations, but fundamentally it defies attempts to use it for analytic purposes (like differential equations or contour integration).

Useful when you need to treat the complex plane as a vector space or are interested in the topology of a complex function, but a pain to deal with in almost any other context.

rachofsunshine

For those of you wondering why on Earth such a simple function wouldn't be well-behaved, it can help to think about what you can do with the conjugate.

In particular, since sums of holomorphic functions are holomorphic, the sum f(z) = z + z* of the identity function g(z) = z and conjugate function h(z) = z* would need to be holomorphic. But z + z* cancels out the imaginary part of z and therefore maps the complex plane to the real line - and it should be obvious that a map from C to R cannot possibly preserve the properties of C in any intuitive way.

Roughly speaking, the conjugate fails to be holomorphic because it maps C to its mirror image, rather than C itself, in much the same way that reflecting a circle is different from rotating it.

bobbylarrybobby

Constant functions are holomorphic without preserving the properties of C

The issue is that the Cauchy Riemann equations don't hold. (You would need 1==-1)

rachofsunshine

Picard's theorem tells us constant functions are the only example of that, though (more or less because 0 == -0 [1] and that's only true for 0).

[1] I sincerely apologize to anyone who works with floats for this statement.

Tainnor

> The trouble is that complex conjugation is not holomorphic (analytic) over the complex numbers.

Even more generally, a real-differentiable function is complex differentiable iff its (Wirtinger) derivative with respect to z* is 0.

aabajian

Does the problem boil down to selecting the real part of a complex number? Correct me if I'm wrong, but the conjugate of z is merely 2*Re(z) - z. For example, the conjugate of a + bi is 2*a - (a + bi) = a - bi.

kevinventullo

Maybe worth noting that it is real-analytic.

rdtsc

You can try it out in Python directly which natively support complex numbers (just use j instead of i):

   >>> import math
   >>> z=1+2j
   >>> z*complex.conjugate(z)
   (5+0j)
   >>> math.sqrt((z*complex.conjugate(z)).real)
   2.23606797749979
   >>> abs(z)
   2.23606797749979
As we can see abs(z) does the right thing. Try it with a negative imaginary part too and "nicer" values:

   >> z = 3-4j
   >>> math.sqrt((z*complex.conjugate(z)).real)
   5.0
   >>> abs(z)
   5.0

jcgrillo

This is what made me fall in love with python. It's over now, but it was nice while it lasted.

btdmaster

Conjugate is also a method:

  x=1
  x.conjugate()

  x=1+2j
  x.conjugate()

hpcjoe

Same in Julia, but no need to "import math", its already built in :D

    joe@zap:~ $ julia
                   _
       _       _ _(_)_     |  Documentation: https://docs.julialang.org    
      (_)     | (_) (_)    |
       _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
      | | | | | | |/ _` |  |
      | | |_| | | | (_| |  |  Version 1.10.5 (2024-08-27)
     _/ |\__'_|_|_|\__'_|  |
    |__/                   |

    julia> z=1+2*im
    1 + 2im

    julia> z*conj(z)
    5 + 0im

    julia> sqrt(z*conj(z))
    2.23606797749979 + 0.0im

    julia> abs(z)
    2.23606797749979

zahlman

it isn't necessary in Python, either. GP is only importing it for square roots, but exponentiation (via the ** operator) by .5 works fine with complex numbers in Python as well. It even handles complex exponents (although you'd have to look up the branch cut semantics etc. in the documentation):

    >>> (1+1j)**(1+1j)
    (0.2739572538301211+0.5837007587586147j)
Ironically, the `math` library doesn't handle that:

    >>> math.pow(1+1j, 1+1j)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: must be real number, not complex

Tainnor

I don't understand the starting point of this blog post. Why should one intuitively think that |z|^2 = zz? I've never seen anyone been confused by this. It's like writing an article about why 2*3 can't be 5 or something.

griffzhowl

> Why should one intuitively think that |z|^2 = zz?

I guess because it's true for the reals. But yeah, I agree anyone who has got 10 minutes into an explanation of complex arithmetic should have got that far... I guess it's directed at people not acquainted with complex numbers much at all

mikewarot

Because it happens to work when Z has no imaginary component.

billti

Multiplying any two complex numbers 'a' and 'b' gives you a complex number z whose magnitude is the magnitude of 'a' times the magnitude of 'b' (that's covered in the article). I always thing of a 'complex conjugate' as a reflection across the real number line (i.e. has the opposite angle or 'phase'), so when a complex number and its conjugate are multiplied the angle disappears and you're left with no imaginary component, thus just the real part which IS the magnitude. (As a^2 + 0 = c^2)

I hadn't worked with complex numbers much for most of my life, but getting into quantum computing recently it is ALL complex numbers (and linear algebra). It's fascinating (for a certain mindset at least, which I guess I fall into), but it is a lot of mental work and repetition before it starts to feel in any way 'comfortable'.

youoy

Once you have decided to use the geometrical representation of the complex numbers, the justification of the norm of a complex number is Pythagoras's theorem.

If you want a more "complex numbers" justification, you can say that you want to make the vector "real" by moving it to the real line, so you multiply it by the inverse rotation of the complex number that you are looking at. If you instead multiply it by the conjugate, then you need to compute the square root of the output since it multiplies by the radius again.

I hope this helps!

kgwgk

> Why z squared is not a norm-square Now it's time to go back to the question we started the post with. Why isn't zz (or z^2) the norm-square? [several paragraphs later]. Looking at the formal definition of the norm, it's clear right away that won't do. The norm is defined as a real-valued function, whereas zz is not real-valued.

That much is clear much righter away just by noticing that for the simplest imaginary number imaginable (z=i) zz is negative but the norm-squared is positive-valued.

Adrock

A simple demonstration of why this is necessary is to consider the distance between the points 1 and i on the complex plane. If you naively compute the distance between them using the familiar Euclidean formula √(a²+b²) you get:

√(1²+i²) = √(1-1) = 0

That can't be right...

Adrock

Sorry, it was a poor reference to this:

https://www.reddit.com/r/mathmemes/s/c7gtvXrnz8

null

[deleted]

null

[deleted]

kgwgk

Even simpler is trying to calculate |i| (i.e. the distance between the points 0 and i on the complex plane) as √i² = √-1 = i.

nokan

you are calculating inner product of otrhogonal vectors. For distance it should be abs(a-b) it will result to sqrt(2).

mikewarot

I wondered what happens when you try to do this in more than 2 dimensions? It turns out that you can just extend the negation of the imaginary part before proceeding.

https://math.libretexts.org/Bookshelves/Abstract_and_Geometr....

siktirlanibne

zz* !? Why not z*z if you're nitpicking already? inb4 WFH killed Commutators.