{"id":24404032,"url":"https://github.com/i-a-morozov/ndmap","last_synced_at":"2025-09-30T12:30:22.636Z","repository":{"id":165480194,"uuid":"594963409","full_name":"i-a-morozov/ndmap","owner":"i-a-morozov","description":"Higher order partial derivatives computation with respect to one or several tensor-like variables, applications to nonlinear dynamics","archived":false,"fork":false,"pushed_at":"2024-10-28T05:43:45.000Z","size":25286,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-18T08:44:37.616Z","etag":null,"topics":["automatic-differentiation","fixed-point","nonlinear-dynamics","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i-a-morozov.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-30T05:09:03.000Z","updated_at":"2024-10-28T05:42:56.000Z","dependencies_parsed_at":"2023-11-20T08:29:51.168Z","dependency_job_id":"f38855f0-e0d0-4df3-803e-e9c97e403f2c","html_url":"https://github.com/i-a-morozov/ndmap","commit_stats":null,"previous_names":["i-a-morozov/ndmap"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-a-morozov%2Fndmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-a-morozov%2Fndmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-a-morozov%2Fndmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-a-morozov%2Fndmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i-a-morozov","download_url":"https://codeload.github.com/i-a-morozov/ndmap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234732933,"owners_count":18878416,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automatic-differentiation","fixed-point","nonlinear-dynamics","pytorch"],"created_at":"2025-01-20T03:46:33.594Z","updated_at":"2025-09-30T12:30:21.526Z","avatar_url":"https://github.com/i-a-morozov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ndmap, 2022-2023\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"100\" height=\"100\" src=\"https://github.com/i-a-morozov/ndmap/blob/main/docs/pics/logo.svg\"\u003e\n\u003c/p\u003e\n\nHigher order partial derivatives computation with respect to one or several tensor-like variables.\nTaylor series function approximation (derivative table and series function representation).\nParametric fixed point computation.\n\n# Install \u0026 build\n\n```\n$ pip install git+https://github.com/i-a-morozov/ndmap.git@main\n```\nor\n```\n$ pip install ndmap -U\n```\n\n# Documentation\n\n[![Run In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/i-a-morozov/ndmap/blob/main/docs/source/examples/ndmap.ipynb)\n\n[https://i-a-morozov.github.io/ndmap/](https://i-a-morozov.github.io/ndmap/)\n\n\n# Derivative (composable jacobian)\n\nCompute higher order function (partial) derivatives.\n\n```python\n\u003e\u003e\u003e from ndmap.derivative import derivative\n\u003e\u003e\u003e def fn(x):\n...     return 1 + x + x**2 + x**3 + x**4 + x**5\n... \n\u003e\u003e\u003e import torch\n\u003e\u003e\u003e x = torch.tensor(0.0)\n\u003e\u003e\u003e derivative(5, fn, x)\n[tensor(1.), tensor(1.), tensor(2.), tensor(6.), tensor(24.), tensor(120.)]\n```\n\n```python\n\u003e\u003e\u003e from ndmap.derivative import derivative\n\u003e\u003e\u003e def fn(x):\n...     x1, x2 = x\n...     return x1**2 + x1*x2 + x2**2\n... \n\u003e\u003e\u003e import torch\n\u003e\u003e\u003e x = torch.tensor([0.0, 0.0])\n\u003e\u003e\u003e derivative(2, fn, x, intermediate=False)\ntensor([[2., 1.],\n        [1., 2.]])\n```\n\n```python\n\u003e\u003e\u003e from ndmap.derivative import derivative\n\u003e\u003e\u003e def fn(x, y):\n...     x1, x2 = x\n...     return x1**2*(1 + y) + x2**2*(1 - y)\n... \n\u003e\u003e\u003e import torch\n\u003e\u003e\u003e x = torch.tensor([0.0, 0.0])\n\u003e\u003e\u003e y = torch.tensor(0.0)\n\u003e\u003e\u003e derivative((2, 1), fn, x, y)\n[[tensor(0.), tensor(0.)], [tensor([0., 0.]), tensor([0., 0.])], [tensor([[2., 0.],\n        [0., 2.]]), tensor([[ 2.,  0.],\n        [ 0., -2.]])]]\n```\n\n# Derivative (gradient)\n\nCompute higher order function (partial) derivatives.\n\n```python\n\u003e\u003e\u003e from ndmap.gradient import series\n\u003e\u003e\u003e def fn(x):\n...     return 1 + x + x**2 + x**3 + x**4 + x**5\n... \n\u003e\u003e\u003e import torch\n\u003e\u003e\u003e x = torch.tensor([0.0])\n\u003e\u003e\u003e series((5, ), fn, x, retain=False, series=False)\n{(0,): tensor([1.]),\n (1,): tensor([1.]),\n (2,): tensor([2.]),\n (3,): tensor([6.]),\n (4,): tensor([24.]),\n (5,): tensor([120.])}\n```\n\n```python\n\u003e\u003e\u003e from ndmap.gradient import series\n\u003e\u003e\u003e def fn(x):\n...     x1, x2 = x\n...     return x1**2 + x1*x2 + x2**2\n...\n\u003e\u003e\u003e import torch\n\u003e\u003e\u003e x = torch.tensor([0.0, 0.0])\n\u003e\u003e\u003e series((2, ), fn, x, intermediate=False, retain=False, series=False)\n{(2, 0): tensor(2.), (1, 1): tensor(1.), (0, 2): tensor(2.)}\n\n```\n\n```python\n\u003e\u003e\u003e from ndmap.gradient import series\n\u003e\u003e\u003e def fn(x, y):\n...     x1, x2 = x\n...     y1, = y\n...     return x1**2*(1 + y1) + x2**2*(1 - y1)\n...\n\u003e\u003e\u003e import torch\n\u003e\u003e\u003e x = torch.tensor([0.0, 0.0])\n\u003e\u003e\u003e y = torch.tensor([0.0])\n\u003e\u003e\u003e series((2, 1), fn, x, y, retain=False, series=False)\n{(0, 0, 0): tensor(0.),\n (0, 0, 1): tensor(0.),\n (1, 0, 0): tensor(0.),\n (0, 1, 0): tensor(0.),\n (1, 0, 1): tensor(0.),\n (0, 1, 1): tensor(-0.),\n (2, 0, 0): tensor(2.),\n (1, 1, 0): tensor(0.),\n (0, 2, 0): tensor(2.),\n (2, 0, 1): tensor(2.),\n (1, 1, 1): tensor(0.),\n (0, 2, 1): tensor(-2.)}\n```\n\n# Desription\n\n```python\n\u003e\u003e\u003e import ndmap\n\u003e\u003e\u003e ndmap.__about__\n```\n\n# Animations\n\nStable and unstable invariant manifolds approximation\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"576\" height=\"576\" src=\"https://github.com/i-a-morozov/ndmap/blob/main/docs/pics/manifold.gif\"\u003e\n\u003c/p\u003e\n\nCollision of fixed points\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"576\" height=\"576\" src=\"https://github.com/i-a-morozov/ndmap/blob/main/docs/pics/collision.gif\"\u003e\n\u003c/p\u003e\n\nReduce real part of a hyperbolic fixed point\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"576\" height=\"576\" src=\"https://github.com/i-a-morozov/ndmap/blob/main/docs/pics/change.gif\"\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-a-morozov%2Fndmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi-a-morozov%2Fndmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-a-morozov%2Fndmap/lists"}