title: How to do nonlinear complex root finding in Python
body: <p>I want to do a root search for the following nonlinear equations, I do it in Python but it doesn't work. my code is below</p>
  
  <pre><code>from pylab import *
  import scipy
  import scipy.optimize
  
  def z1(x,y):
      temp=1+1j+x+2*y;
      return temp
  
  def z2(x,y):
      temp=-1j-2*x+sqrt(3)*y;
      return temp
  
  def func(x):
      temp=[z1(x[0],x[1])-1.0/(1-1.0/(z2(x[0],x[1]))),1-2.0/(z2(x[0],x[1])-4.0/z1(x[0],x[1]))]
      return temp
  
  result=scipy.optimize.fsolve(func,[1+1j,1+1j])
  
  print result
  </code></pre>
  
  <p>when I run it, it shows errors:</p>
  
  <p>---> 30 result=scipy.optimize.fsolve(func,[1+1j,1+1j])</p>
  
  <p>C:\Python27\lib\site-packages\scipy\optimize\minpack.py in fsolve(func, x0, args, fprime, full_output, col_deriv, xtol, maxfev, band, epsfcn, factor, diag)</p>
  
  <pre><code>123             maxfev = 200*(n + 1)
  
  124         retval = _minpack._hybrd(func, x0, args, full_output, xtol,
  </code></pre>
  
  <p>--> 125                 maxfev, ml, mu, epsfcn, factor, diag)</p>
  
  <pre><code>126     else:
  
  127         _check_func('fsolve', 'fprime', Dfun, x0, args, n, (n,n))
  </code></pre>