Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let $A_1$ and $A_2$ be two $3\times 3$ hermitian matrices. Then their numerical range is defined as two-dimensional set

\begin{align} \mathbb{S}=\{\left[u^HA_1u,u^HA_2u\right]\in \mathbb{R}^2,u^Hu=1\} \end{align}

where $u$ is a unit-norm vector. Each of the $u^HA_iu,~i=1,2$ is a real number. Thus for a given $u$, I calculate the first co-ordinate as $u^HA_1u$ and second co-ordinate as $u^HA_2u$, then I have to vary $u$ through all possible unit-norm vectors. Thus $\mathbb{S}$ becomes a 2-D set.

EDIT If it is possible to find a solution for the real case, that is fine. But then the matrices $A_1$ and $A_2$ will be of size $6 \times 6$. The reason is you can convert the above set of equations in terms of real variables and real matrices in higher dimensions (twice the dimension to be exact).

share|improve this question
What are the square brackets ? do you take u to be complex ? – b.gatessucks Apr 30 '13 at 9:38
@b.gatessucks Please see the edit. Yes I take $u$ as complex, but if you know solution for real, that is fine as well – dineshdileep Apr 30 '13 at 9:41
up vote 6 down vote accepted

If you consider only real unit vectors then one can parametrize them in spherical coordinates u = {Sin[t] Cos[f], Sin[t] Sin[f], Cos[t]}; this way you can then use ParametricPlot.

Example :

a1 = With[{tmp = RandomReal[{-1, 1}, {3, 3}] + I RandomReal[{-1, 1}, {3, 3}]}, 
         0.5 (tmp + ConjugateTranspose[tmp])];
a2 = With[{tmp = RandomReal[{-1, 1}, {3, 3}] + I RandomReal[{-1, 1}, {3, 3}]}, 
         0.5 (tmp + ConjugateTranspose[tmp])];

range[t_, f_] = {Dot[{Sin[t] Cos[f], Sin[t] Sin[f], Cos[t]}, a1, {Sin[t]Cos[f], Sin[t] Sin[f], Cos[t]}], 
                 Dot[{Sin[t] Cos[f], Sin[t] Sin[f], Cos[t]}, a2, {Sin[t] Cos[f], Sin[t] Sin[f], Cos[t]}]};

(* doubling the t-range to make the plot better *)
ParametricPlot[range[t, f], {t, 0, 2 Pi}, {f, 0, 2 Pi}, Mesh -> None]

enter image description here

share|improve this answer
+1, nice!!. The reason I said real is fine is because, if one can do it for complex, then one can do it for real as well. If your complex matrix is $N\times N$, then you can convert it into a equation in real variables, but then matrix will be of size $2N \times 2N$. Thus in my case, $A_1$ and $A_2$ will be $6\times 6$. Is there any way to extend this solution to real case? – dineshdileep Apr 30 '13 at 15:14
@dineshdileep In the complex case you'd have 5 independent variables and I don't know of any way of handling that continuosly. You could generate a big list of points and then use ListPlot but the result will not be as nice. – b.gatessucks Apr 30 '13 at 15:30
also, why is there some dark, more colored portion inside that shape. Is it because of complex part? – dineshdileep Apr 30 '13 at 16:53
I think it's just an artifact of the plotting routine; you can see a "skeleton" of the continuous plot with ParametricPlot[range[t, f], {t, 0, 2 Pi}, {f, 0, 2 Pi}, Mesh -> None]. However, hopefully some of the experts will have a better answer. – b.gatessucks Apr 30 '13 at 17:43
When I try $EigenValues[a1]$ after executing your code, I don't get real numbers, why is that so? – dineshdileep May 1 '13 at 2:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.