WeBWorK Problems

Complex Eigenvectors

Re: Complex Eigenvectors

by Davide Cervone -
Number of replies: 0
The main problem in this case is that the "<" of the Vector context isn't available in Complex context, so you can't create vectors. (And you can't use ijk format, since i is the complex i not the vector i). So to get what you want, you just have to define "<" to do the right thing:

    Context("Complex");
    Context()->parens->add("<" => {close => ">", type => "Vector"});

Then you can use expressions like

    $v = Compute("<1+i,2-3i>");

to get a vector of complex values. Note that things like "norm", "unit", cross product, and dot product from the vector context will not be defined, but if you want those, too, they can be added as well.