Sage CNIP Conjugates, Norms and Inner Products

Conjugates, of complex numbers and of vectors, are straightforward, in QQbar or in CDF.









The term “inner product” means slightly different things to different people. For some, it is the “dot product” that you may have seen in a calculus or physics course. Our inner product could be called the “Hermitian inner product” to emphasize the use of vectors over the complex numbers and conjugating some of the entries. So Sage has a .dot_product(), .inner_product(), and .hermitian_inner_product() — we want to use the last one.

From now on, when we mention an inner product in the context of using Sage, we will mean .hermitian_inner_product(). We will redo the first part of Example CSIP. Notice that the syntax is a bit asymmetric.



Norms are as easy as conjugates. Easier maybe. It might be useful to realize that Sage uses entirely distinct code to compute an exact norm over QQbar versus an approximate norm over CDF, though that is totally transparent as you issue commands. Here is Example CNSV reprised.







We have three different numerical approximations, the latter 30-digit number being an approximation to the answer in the text. But there is no inconsistency between them. The first, an algebraic number, is represented internally as $5*a$ where $a$ is a root of the polynomial equation $x^2-3=0$, in other words it is $5\sqrt{3}$. The CDF value prints with a few digits less than what is carried internally. Notice that our different definitions of the inner product make no difference in the computation of a norm.

One warning now that we are working with complex numbers. It is easy to “clobber” the symbol I used for the imaginary number $i$. In other words, Sage will allow you to assign it to something else, rendering it useless. An identity matrix is a likely reassignment. If you run the next compute cell, be sure to evaluate the compute cell afterward to restore I to its usual role.





We will finish with a verification of Theorem IPN. To test equality it is best if we work with entries from QQbar.