Straight to the point
I have a function
DiracPoint[{theta_, phi_}] :=
Module[{c1, c2, c3, x, y, cond1, cond2, cond3, cond4},
(*Define c_j*)
{c1, c2, c3} = 1 - 3 Sin[theta]^2 Cos[phi - 2 Pi (# - 1)/3]^2 & /@ {1,2,3};
(*excludes points with no solution*)
If[0 <= ((c2 + c3)^2 - c1^2)/(4 c2 c3) <= 1,
cond1 = (c2 + c3) Cos[Sqrt[3] x/2] == -c1 Cos[3 y/2];(*Re[f]=0*)
cond2 = (c2 - c3) Sin[Sqrt[3] x/2] == c1 Sin[3 y/2];(*Im[f]=0*)
cond3 = Abs[y] <= 2 Pi/3;(*Bound x within hexagon*)
cond4 = Abs[x] <= (4 Pi/3 - Abs[y])/Sqrt[3];(*Bound y within hexagon*)
{x, y}/.Solve[cond1 && cond2 && cond3 && cond4, {x, y}]
, Null]
]
which needs modifying to run successfully and quickly for all angles in the range 0<=theta<=Pi
and 0<=phi<=2Pi
. Non-exact and numerical solutions are absolutely fine. At the minute this function only works for a few values of exact input. Otherwise Solve fails to work, or it takes forever to run. Any suggestions? The function should (I believe) return two sets of coordinates {{x1,y1},{x2,y2}}, or Null, or for a few special angles more than 2 sets of coordinates.
Extra details if needed
I'm trying to develop a Mathematica function which finds the $(x,y)$ solutions to the equation $f=0$ in a region of space bounded by a hexagon centered at the origin, with side length $4\pi/3\sqrt{3}$ as shown below. The function is
$f=\mathcal{C}_1 \exp(-iy)+\mathcal{C}_2 \exp(-\sqrt{3}ix/2) + \mathcal{C}_3 \exp(-\sqrt{3}ix/2)$
where $\mathcal{C}_j = 1-3\sin^2\theta\cos^2(\phi-2\pi(j-1)/3)$ and the bounding region of space is
As $f=0$ implies we also need $Re[f]=0$ and $Im[f]=0$, satisfying $f=0$ is equivalent to satisfying the two equations:
$(\mathcal{C}_2 + \mathcal{C}_3)\cos(\sqrt{3}x/2)=-\mathcal{C}_1\cos(3y/2)$
$(\mathcal{C}_2 - \mathcal{C}_3)\sin(\sqrt{3}x/2)=\mathcal{C}_1\cos(3y/2)$
So I desire a function DiracPoint[{theta_,phi_}]
which (quickly) returns the set of coordinates {x,y}
that satisfy the above requirements. I have tried various approaches, but I keep running into problems of wrong or incomplete solutions, or exact methods taking forever to compute. Successful development of this function will aid with research that develops on this paper here (should be publicly available). It's possible to find analytical solution for a given $(\theta,\phi)$ but a numerical solution will help greatly with visualisation.
Many thanks for any and all help.
cc = {c1, c2, c3} = 1 - 3 Sin[theta]^2 Cos[phi - 2 Pi (# - 1)/3]^2 & /@ {1, 2, 3}; v = {E^(-I y), E^(-Sqrt@3/2 I x), E^(-Sqrt@3/2 I x)}; f = cc.v; llr = Re[TrigExpand@f // ExpToTrig] /. __ + Re[x_] :> x; lli = Im[TrigExpand@f // ExpToTrig] /. Im[__] + x_ :> x /. Re -> Identity; Reduce[{lli == 0 && llr == 0}, {x, y}]
$\endgroup$False
. The code provided also doesn't take into account the requirement that solutions are bounded by the hexagon, but one task at a time I guess :) $\endgroup$