{"id":41616724,"url":"https://github.com/oameye/helmholtzdecomposition","last_synced_at":"2026-04-29T16:03:27.865Z","repository":{"id":313812481,"uuid":"1052705609","full_name":"oameye/HelmholtzDecomposition","owner":"oameye","description":"Analytical Helmholtz decomposition of vector fields in n dimensions","archived":false,"fork":false,"pushed_at":"2025-09-08T15:21:29.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-08T17:27:29.471Z","etag":null,"topics":["analytical","helmholtz-decomposition","vector-fields"],"latest_commit_sha":null,"homepage":"","language":"Mathematica","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oameye.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-08T12:41:00.000Z","updated_at":"2025-09-08T15:21:59.000Z","dependencies_parsed_at":"2025-09-08T17:37:48.254Z","dependency_job_id":null,"html_url":"https://github.com/oameye/HelmholtzDecomposition","commit_stats":null,"previous_names":["oameye/helmholtzdecomposition"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/oameye/HelmholtzDecomposition","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oameye%2FHelmholtzDecomposition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oameye%2FHelmholtzDecomposition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oameye%2FHelmholtzDecomposition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oameye%2FHelmholtzDecomposition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oameye","download_url":"https://codeload.github.com/oameye/HelmholtzDecomposition/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oameye%2FHelmholtzDecomposition/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32432917,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T13:34:34.882Z","status":"ssl_error","status_checked_at":"2026-04-29T13:34:29.830Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["analytical","helmholtz-decomposition","vector-fields"],"created_at":"2026-01-24T12:52:55.128Z","updated_at":"2026-04-29T16:03:27.858Z","avatar_url":"https://github.com/oameye.png","language":"Mathematica","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HelmholtzDecomposition\n\nAnalytical Helmholtz decomposition of n-dimensional vector fields, following Richters \u0026 Glötzl, *Analytical Helmholtz Decomposition of n-Dimensional Vector Fields* ([10.1016/j.jmaa.2023.127138](https://doi.org/10.1016/j.jmaa.2023.127138)). Given a vector field `f`, the decomposition\n\n```\nf = g + r,    Curl[g] == 0,    Div[r] == 0\n```\n\nis constructed once and exposed through a single function `HelmholtzDecomposition` returning a queryable result object.\n\n## Install\n\n```mathematica\nPacletInstall[\"https://github.com/oameye/HelmholtzDecomposition/releases/download/v2.0.0/HelmholtzDecomposition-2.0.0.paclet\"]\n```\n\nOr, working from a checkout:\n\n```mathematica\nPacletDirectoryLoad[\"/path/to/HelmholtzDecomposition\"];\nNeeds[\"HelmholtzDecomposition`\"];\n```\n\n## Quick start\n\n```mathematica\nNeeds[\"HelmholtzDecomposition`\"];\n\nhd = HelmholtzDecomposition[{x^2 + y, x y}, {x, y}];\n\nhd[\"Gradient\"]                 (* {x^2 + y^2/2, x y} *)\nhd[\"Rotational\"]               (* {-(1/2)(-2 + y) y, 0} *)\nhd[\"Potential\"]                (* scalar P with Grad[P] == g *)\nhd[\"Verify\"]                   (* \u003c|GradientCurlFree -\u003e True, ...|\u003e *)\n\nList @@ hd                     (* {g, r}, handy for destructuring *)\n```\n\n## API — one function, queryable result\n\n```mathematica\nhd = HelmholtzDecomposition[f, xvec, opts]   (* explicit coords *)\nhd = HelmholtzDecomposition[f, opts]         (* auto-detect coords from f *)\n```\n\nThe result has head `HelmholtzDecomposition` and renders as a collapsible summary box in notebooks. It is queried by string property:\n\n| Property | Meaning |\n|---|---|\n| `\"Gradient\"` | curl-free component `g` |\n| `\"Rotational\"` | divergence-free component `r` |\n| `\"Potential\"` | scalar `P` with `Grad[P, xvec] == g` |\n| `\"AntisymmetricPotential\"` | the n-dimensional 2-form `Rij` whose row-divergence is `r` |\n| `\"VectorPotentialA\"` | (3D only) vector `A` with `Curl[A] == r` |\n| `\"PotentialMatrix\"` | the underlying potential matrix `Fij` |\n| `\"Residual\"` | `f - g - r`, simplified |\n| `\"Verify\"` | `\u003c|\"GradientCurlFree\", \"RotationalDivergenceFree\", \"ResidualZero\"|\u003e` |\n| `\"Field\"`, `\"Coordinates\"` | the inputs |\n| `\"Properties\"` | the list of valid property names |\n| `\"Association\"` | the raw underlying Association |\n\n`List @@ hd` returns `{g, r}` (handy for destructuring), `Normal[hd]` returns the underlying Association, `Length[hd]` returns the field dimension. Querying an unknown property returns `$Failed` with a message.\n\n### Options\n\n```mathematica\nHelmholtzDecomposition[f, xvec,\n  SimplificationFunction -\u003e FullSimplify,   (* or Simplify, Identity, ... *)\n  Assumptions :\u003e $Assumptions,              (* forwarded to the simplifier *)\n  Verbose -\u003e False,                         (* trace the algorithm via Echo *)\n  Caching -\u003e True,                          (* memoize on (f, xvec, simp, asm, tc) *)\n  TimeConstraint -\u003e Infinity                (* circuit breaker forwarded to the simplifier *)\n]\n```\n\n`Identity` is special-cased so `SimplificationFunction -\u003e Identity` skips simplification cleanly.\n\n### Caching\n\nResults are memoized by default on the tuple `(f, xvec, SimplificationFunction, Assumptions)`. Repeated calls cost effectively nothing. Drop the cache with `ClearHelmholtzCache[]` (returns the number of evicted entries), or pass `Caching -\u003e False` for a single bypass.\n\n### Failure modes\n\nThe function returns `$Failed` (with a typed message under `HelmholtzDecomposition::*`) on:\n\n- length mismatch between `f` and `xvec` (`::nomatch`)\n- ambiguous coordinate auto-detection (`::autocoord`)\n- atomic terms outside the polynomial / exponential / sine / cosine grammar (`::nodec`)\n- query for an unknown property (`::nokey`)\n- query for `\"VectorPotentialA\"` outside 3D (`::baddim`)\n- non-boolean `Verbose` (`::badverbose`)\n\n## Notes\n\n**Simplifier contract.** `SimplificationFunction` must accept the call shape `simp[expr, asm, TimeConstraint -\u003e tc]`. `FullSimplify`, `Simplify`, and the special-cased `Identity` all satisfy this. A custom simplifier `myFn[expr_] := ...` would receive arguments it doesn't expect; wrap with `Function[{e, _, _}, myFn[e]]` if needed.\n\n**Cache key is the symbolic expression.** The cache is keyed on `(f, xvec, simp, asm, tc)` as written, not on currently-bound values. If you call `HelmholtzDecomposition[{x^2}, {x}]`, then assign `x = 5`, then call again, the cached object is returned — even though `f` would now evaluate to `{25}`. This is the right semantic (the field is a symbolic expression, parameters bind at access) but worth knowing.\n\n**Property access re-evaluates.** `hd[\"Field\"]` returns the stored expression and re-evaluates against current bindings. So `hd[\"Field\"]` after `x = 5` evaluates to a numeric vector. Same caveat.\n\n## Citation and license\n\nPlease cite the original paper and Zenodo repository when using this code.\n\n- [Zenodo repository](https://zenodo.org/records/7680297)\n- Erhard Glötzl, Oliver Richters. *Helmholtz decomposition and potential functions for n-dimensional analytic vector fields*. [10.1016/j.jmaa.2023.127138](https://doi.org/10.1016/j.jmaa.2023.127138)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foameye%2Fhelmholtzdecomposition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foameye%2Fhelmholtzdecomposition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foameye%2Fhelmholtzdecomposition/lists"}