I wrote this post to remind myself of something.
When evaluating the order of convergence of numerical simulation results, we usually use either the infinity norm or the L2 norm. In practice, I usually only use the L2 norm, unless I am dealing with a numerical method where the infinity norm and the L2 norm have different orders of convergence.
But if you are using Python and NumPy for the evaluation, be aware that numpy.linalg.norm, and also scipy.linalg.norm, returns the l2 norm, not the L2 norm. Although the official documentation does show the equation being used, I rarely read the documentation for this function that carefully. It is just a norm calculation. What could go wrong? That was what I thought.
Checking the order of convergence is an essential part of verifying a numerical simulation program. What happened to me was that I could not get the theoretical order of convergence for one of my programs when using the L2 norm. I thought there might be a bug in the code, so I spent about a day debugging it and found nothing.
Then I suddenly decided to use the infinity norm. It gave me the expected theoretical value. That was the moment when I seriously read the official documentation of numpy.linalg.norm for the first time.