Skip to main content
`Ctrl`+`K`

# scipy.special.wrightomega

scipy.special.wrightomega(z, out=None) = <ufunc 'wrightomega'>

  Wright Omega function.

  Defined as the solution to

  \[\omega + \log(\omega) = z\]

  where \(\log\) is the principal branch of the complex logarithm.

  Parameters:
    z array_like

      Points at which to evaluate the Wright Omega function

    out ndarray, optional

      Optional output array for the function values

  Returns:
    omega scalar or ndarray

      Values of the Wright Omega function

  See also

  `lambertw`

    The Lambert W function

  Notes

  Added in version 0.19.0.

  The function can also be defined as

  \[\omega(z) = W_{K(z)}(e^z)\]

  where \(K(z) = \lceil (\Im(z) - \pi)/(2\pi) \rceil\) is the unwinding number and \(W\) is the Lambert W function.

  The implementation here is taken from [1].

  References

  [1]

  Lawrence, Corless, and Jeffrey, “Algorithm 917: Complex Double-Precision Evaluation of the Wright \(\omega\) Function.” ACM Transactions on Mathematical Software, 2012. DOI:10.1145/2168773.2168779.

  Examples

      >>> import numpy as np
      >>> from scipy.special import wrightomega, lambertw

      >>> wrightomega([-2, -1, 0, 1, 2])
      array([0.12002824, 0.27846454, 0.56714329, 1.        , 1.5571456 ])

  Complex input:

      >>> wrightomega(3 + 5j)
      (1.5804428632097158+3.8213626783287937j)

  Verify that `wrightomega(z)` satisfies `w + log(w) = z`:

      >>> w = -5 + 4j
      >>> wrightomega(w + np.log(w))
      (-5+4j)

  Verify the connection to `lambertw`:

      >>> z = 0.5 + 3j
      >>> wrightomega(z)
      (0.0966015889280649+1.4937828458191993j)
      >>> lambertw(np.exp(z))
      (0.09660158892806493+1.4937828458191993j)

      >>> z = 0.5 + 4j
      >>> wrightomega(z)
      (-0.3362123489037213+2.282986001579032j)
      >>> lambertw(np.exp(z), k=1)
      (-0.33621234890372115+2.282986001579032j)