|pkg_img| |doi| |tests| |coverage| |sonarcloud|
.. |tests| image:: https://github.com/rparini/cxroots/workflows/tests/badge.svg
:target: https://github.com/rparini/cxroots/actions
.. |doi| image:: https://zenodo.org/badge/79802240.svg
:target: https://zenodo.org/badge/latestdoi/79802240
.. |pkg_img| image:: https://badge.fury.io/py/cxroots.svg
:target: https://badge.fury.io/py/cxroots
.. |sonarcloud| image:: https://sonarcloud.io/api/project_badges/measure?project=rparini_cxroots&metric=alert_status
:target: https://sonarcloud.io/summary/new_code?id=rparini_cxroots
.. |coverage| image:: https://coveralls.io/repos/github/rparini/cxroots/badge.svg
:target: https://coveralls.io/github/rparini/cxroots
cxroots
=======
cxroots is a Python package for finding all the roots of a function, *f(z)*, of a single complex variable within a given contour, *C*, in the complex plane. It requires only that both:
- *f(z)* has no roots or poles on *C*
- *f(z)* is analytic in the interior of *C*
The implementation is primarily based on [KB]_ and evaluates contour integrals involving *f(z)* and its derivative *f'(z)* to determine the roots. If *f'(z)* is not provided then it is approximated using a finite difference method. The roots are further refined using Newton-Raphson if *f'(z)* is given or Muller's method if not. See the `documentation <https://rparini.github.io/cxroots/>`_ for a more details and a tutorial.
With `Python <http://www.python.org/>`_ installed you can install cxroots by entering in the terminal/command line
.. code:: bash
pip install cxroots
Example
-------
.. code:: python
from numpy import exp, cos, sin
f = lambda z: (exp(2*z)*cos(z)-1-sin(z)+z**5)*(z*(z+2))**2
from cxroots import Circle
C = Circle(0,3)
roots = C.roots(f)
roots.show()
.. Relative images do not display on pypi
.. image:: https://github.com/rparini/cxroots/blob/master/README_resources/readme_example.png?raw=true
.. code:: python
print(roots)
.. literalinclude readme_example.txt doesn't work on github
.. code::
Multiplicity | Root
------------------------------------------------
2 | -2.000000000000 +0.000000000000i
1 | -0.651114070264 -0.390425719088i
1 | -0.651114070264 +0.390425719088i
3 | 0.000000000000 +0.000000000000i
1 | 0.648578080954 -1.356622683988i
1 | 0.648578080954 +1.356622683988i
1 | 2.237557782467 +0.000000000000i
See also
--------
The Fortran 90 package `ZEAL <https://elsevier.digitalcommonsdata.com/datasets/yc9vv7rwyj/1>`_ is a direct implementation of [KB]_.
Citing cxroots
--------------
\R. Parini. *cxroots: A Python module to find all the roots of a complex analytic function within a given contour* (2018), https://github.com/rparini/cxroots https://doi.org/10.5281/zenodo.7013117
BibTex:
.. code::
@misc{cxroots,
author = {Robert Parini},
title = {{cxroots: A Python module to find all the roots of a complex analytic function within a given contour}},
doi = {10.5281/zenodo.7013116},
url = {https://github.com/rparini/cxroots},
year = {2018}
}
----------
Development
-----------
- Install the `pre-commit <https://pre-commit.com/>`_ and then run :code:`pre-commit install`. The pre-commit scripts can also be run manually with :code:`pre-commit run --all-files`
- The project uses `ruff <https://docs.astral.sh/ruff/>`_ for formatting and linting. It is run as part of the pre-commit hook and is recommended to be run on save in the developer's editor.
Release Procedure
-----------------
Making a release on GitHub with the tag vX.Y.Z will update the documentation on `master` and push cxroots at the tagged commit to PyPI.
The documentation can be manually generated by running `./create_docs` in the `docs_src` directory.
References
----------
.. [KB] \P. Kravanja and M. Van Barel. *Computing the Zeros of Analytic Functions*. Springer, Berlin, Heidelberg, 2000.
Raw data
{
"_id": null,
"home_page": null,
"name": "cxroots",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "roots, zeros, complex, analytic, functions",
"author": null,
"author_email": "Robert Parini <robert.parini@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/5f/7c/8527d086499bf4f2a7789445e1f1ee7ccf879a70165050781736ad9df296/cxroots-3.1.0.tar.gz",
"platform": null,
"description": "|pkg_img| |doi| |tests| |coverage| |sonarcloud|\n\n.. |tests| image:: https://github.com/rparini/cxroots/workflows/tests/badge.svg\n :target: https://github.com/rparini/cxroots/actions\n\n.. |doi| image:: https://zenodo.org/badge/79802240.svg\n :target: https://zenodo.org/badge/latestdoi/79802240\n\n.. |pkg_img| image:: https://badge.fury.io/py/cxroots.svg\n :target: https://badge.fury.io/py/cxroots\n\n.. |sonarcloud| image:: https://sonarcloud.io/api/project_badges/measure?project=rparini_cxroots&metric=alert_status\n :target: https://sonarcloud.io/summary/new_code?id=rparini_cxroots\n\n.. |coverage| image:: https://coveralls.io/repos/github/rparini/cxroots/badge.svg\n\t:target: https://coveralls.io/github/rparini/cxroots\n\n\ncxroots\n=======\n\ncxroots is a Python package for finding all the roots of a function, *f(z)*, of a single complex variable within a given contour, *C*, in the complex plane. It requires only that both:\n\n- *f(z)* has no roots or poles on *C*\n- *f(z)* is analytic in the interior of *C*\n\nThe implementation is primarily based on [KB]_ and evaluates contour integrals involving *f(z)* and its derivative *f'(z)* to determine the roots. If *f'(z)* is not provided then it is approximated using a finite difference method. The roots are further refined using Newton-Raphson if *f'(z)* is given or Muller's method if not. See the `documentation <https://rparini.github.io/cxroots/>`_ for a more details and a tutorial.\n\nWith `Python <http://www.python.org/>`_ installed you can install cxroots by entering in the terminal/command line\n\n.. code:: bash\n\n pip install cxroots\n\nExample\n-------\n\n.. code:: python\n\n from numpy import exp, cos, sin\n f = lambda z: (exp(2*z)*cos(z)-1-sin(z)+z**5)*(z*(z+2))**2\n \n from cxroots import Circle\n C = Circle(0,3)\n roots = C.roots(f)\n roots.show()\n\n\n.. Relative images do not display on pypi\n.. image:: https://github.com/rparini/cxroots/blob/master/README_resources/readme_example.png?raw=true\n\n.. code:: python\n\n print(roots)\n\n\n.. literalinclude readme_example.txt doesn't work on github\n.. code::\n\n\t Multiplicity | Root \n\t------------------------------------------------\n\t 2 | -2.000000000000 +0.000000000000i\n\t 1 | -0.651114070264 -0.390425719088i\n\t 1 | -0.651114070264 +0.390425719088i\n\t 3 | 0.000000000000 +0.000000000000i\n\t 1 | 0.648578080954 -1.356622683988i\n\t 1 | 0.648578080954 +1.356622683988i\n\t 1 | 2.237557782467 +0.000000000000i\n\n\nSee also\n--------\n\nThe Fortran 90 package `ZEAL <https://elsevier.digitalcommonsdata.com/datasets/yc9vv7rwyj/1>`_ is a direct implementation of [KB]_.\n\nCiting cxroots\n--------------\n\n \\R. Parini. *cxroots: A Python module to find all the roots of a complex analytic function within a given contour* (2018), https://github.com/rparini/cxroots https://doi.org/10.5281/zenodo.7013117\n\nBibTex:\n\n.. code::\n\n\t@misc{cxroots,\n\t author = {Robert Parini},\n\t title = {{cxroots: A Python module to find all the roots of a complex analytic function within a given contour}},\n doi = {10.5281/zenodo.7013116},\n url = {https://github.com/rparini/cxroots},\n\t year = {2018}\n\t}\n\n----------\n\nDevelopment\n-----------\n- Install the `pre-commit <https://pre-commit.com/>`_ and then run :code:`pre-commit install`. The pre-commit scripts can also be run manually with :code:`pre-commit run --all-files`\n- The project uses `ruff <https://docs.astral.sh/ruff/>`_ for formatting and linting. It is run as part of the pre-commit hook and is recommended to be run on save in the developer's editor.\n\nRelease Procedure\n-----------------\nMaking a release on GitHub with the tag vX.Y.Z will update the documentation on `master` and push cxroots at the tagged commit to PyPI.\n\nThe documentation can be manually generated by running `./create_docs` in the `docs_src` directory.\n\nReferences\n----------\n\n.. [KB] \\P. Kravanja and M. Van Barel. *Computing the Zeros of Analytic Functions*. Springer, Berlin, Heidelberg, 2000.\n\n\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Find all the roots (zeros) of a complex analytic function within a given contour in the complex plane.",
"version": "3.1.0",
"project_urls": {
"Changelog": "https://github.com/rparini/cxroots/blob/master/changelog.md",
"Documentation": "https://rparini.github.io/cxroots/",
"Homepage": "https://rparini.github.io/cxroots/",
"Issues": "https://github.com/rparini/cxroots/issues",
"Repository": "https://github.com/rparini/cxroots"
},
"split_keywords": [
"roots",
" zeros",
" complex",
" analytic",
" functions"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "20f2c244a04ccc9c792299161604ae7b66895a054e1734d84358ba7b032f42d2",
"md5": "5d96906f409c25ca763c85b98ef3c5b9",
"sha256": "88674499465fa134f6d1462d82a99f9be3a443037b0ca5bcdcf3c351f8e29637"
},
"downloads": -1,
"filename": "cxroots-3.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5d96906f409c25ca763c85b98ef3c5b9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 54180,
"upload_time": "2025-02-02T17:55:45",
"upload_time_iso_8601": "2025-02-02T17:55:45.138740Z",
"url": "https://files.pythonhosted.org/packages/20/f2/c244a04ccc9c792299161604ae7b66895a054e1734d84358ba7b032f42d2/cxroots-3.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5f7c8527d086499bf4f2a7789445e1f1ee7ccf879a70165050781736ad9df296",
"md5": "9e74447ea4ec0ca59942b507a0c1c746",
"sha256": "ead64a95439e66128a027901fccb4c9c3953620336206ad18d9ac8513bada5b9"
},
"downloads": -1,
"filename": "cxroots-3.1.0.tar.gz",
"has_sig": false,
"md5_digest": "9e74447ea4ec0ca59942b507a0c1c746",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 47677908,
"upload_time": "2025-02-02T17:55:49",
"upload_time_iso_8601": "2025-02-02T17:55:49.614782Z",
"url": "https://files.pythonhosted.org/packages/5f/7c/8527d086499bf4f2a7789445e1f1ee7ccf879a70165050781736ad9df296/cxroots-3.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-02 17:55:49",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rparini",
"github_project": "cxroots",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "scipy",
"specs": [
[
"==",
"1.14.1"
]
]
},
{
"name": "numpy",
"specs": [
[
"==",
"2.2.1"
]
]
},
{
"name": "numpydoc",
"specs": [
[
"==",
"1.8.0"
]
]
},
{
"name": "mpmath",
"specs": [
[
"==",
"1.3.0"
]
]
},
{
"name": "rich",
"specs": [
[
"==",
"13.9.4"
]
]
},
{
"name": "matplotlib",
"specs": [
[
"==",
"3.10.0"
]
]
},
{
"name": "pytest",
"specs": [
[
"==",
"8.3.4"
]
]
},
{
"name": "pytest-xdist",
"specs": [
[
"==",
"3.6.1"
]
]
},
{
"name": "pytest-cov",
"specs": [
[
"==",
"6.0.0"
]
]
},
{
"name": "setuptools",
"specs": [
[
">=",
"65.5.1"
]
]
}
],
"lcname": "cxroots"
}