{"id":19489965,"url":"https://github.com/cchandre/rg","last_synced_at":"2026-05-01T23:34:24.786Z","repository":{"id":50489904,"uuid":"338342916","full_name":"cchandre/RG","owner":"cchandre","description":"Renormalization for the break-up of invariant tori in Hamiltonian flows","archived":false,"fork":false,"pushed_at":"2023-03-24T16:00:43.000Z","size":265,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-08T08:42:45.807Z","etag":null,"topics":["expm","hamiltonian","hamiltonian-dynamics","invariant-tori","kolmogorov-arnold-moser","numpy","python3","renormalization-group","scipy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cchandre.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":"2021-02-12T14:33:19.000Z","updated_at":"2023-03-24T16:10:36.000Z","dependencies_parsed_at":"2024-11-10T21:10:40.070Z","dependency_job_id":"d5303938-8c37-48cf-95f7-e2714072cc0e","html_url":"https://github.com/cchandre/RG","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cchandre%2FRG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cchandre%2FRG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cchandre%2FRG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cchandre%2FRG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cchandre","download_url":"https://codeload.github.com/cchandre/RG/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240732046,"owners_count":19848622,"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":["expm","hamiltonian","hamiltonian-dynamics","invariant-tori","kolmogorov-arnold-moser","numpy","python3","renormalization-group","scipy"],"created_at":"2024-11-10T21:10:34.878Z","updated_at":"2026-05-01T23:34:24.752Z","avatar_url":"https://github.com/cchandre.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Renormalization group (RG) for the break-up of invariant tori in Hamiltonian flows\n\n- [`RG_dict.py`](https://github.com/cchandre/RG/blob/main/RG_dict.py): to be edited to change the parameters of the RG computation (see below for a dictionary of parameters)\n\n- [`RG.py`](https://github.com/cchandre/RG/blob/main/RG.py): contains the RG classes and main functions defining the RG map\n\n- [`RG_modules.py`](https://github.com/cchandre/RG/blob/main/RG_modules.py): contains the methods to execute the RG map\n\nOnce [`RG_dict.py`](https://github.com/cchandre/RG/blob/main/RG_dict.py) has been edited with the relevant parameters, run the file as \n```sh\npython3 RG.py\n```\nor \n```sh\nnohup python3 -u RG.py \u0026\u003eRG.out \u003c /dev/null \u0026\n```\nThe list of Python packages and their version are specified in [`requirements.txt`](https://github.com/cchandre/RG/blob/main/requirements.txt)\n\n___\n##  Parameter dictionary\n\n- *Method*: string; 'iterates', 'surface', 'region', 'line'; choice of method\n  - 'iterates': starting from two Hamiltonians *H*\u003csub\u003e1\u003c/sub\u003e and *H*\u003csub\u003e2\u003c/sub\u003e defined with the modes *K* and amplitudes *AmpInf* and *AmpSup* respectively, the method first refines *H*\u003csub\u003e1\u003c/sub\u003e and *H*\u003csub\u003e2\u003c/sub\u003e close to the critical surface using a dichotomy procedure. Second, it iterates these two Hamiltonians by iterating and refining with the renormalization map\n  - 'line': for the family of Hamiltonians defined by the modes *K* in the direction *DirLine* with *ModesLine*=1, determines the critical threshold \n  - 'surface': computes the critical surface in the plane of Fourier modes defined by *K* and *ModesLine* (the two modes *K* with *ModesLine*=1)\n  - 'region': in the plane of Fourier modes defined by *K* and *ModesLine* (the two modes *K* with *ModesLine*=1) with amplitudes in the range defined by *AmpInf* and *AmpSup*, determines the number of iterations for the Hamiltonian to converge (negative integers) or diverge (positive integers)\n- *Iterates*: integer; number of iterates to compute for *Method*='iterates'\n- *Nxy*: integer; number of points along each direction for *Method*='surface' or 'region'\n- *RelDist*: float; relative distance of approach for the computation of critical values\n####\n- *N*: *n*x*n* integer matrix with determinant ±1\n- *omega0*: array of *n* floats; frequency vector **\u0026omega;** of the invariant torus; should be an eigenvector of \u003csup\u003e\u0026dagger;\u003c/sup\u003e*N* (transposed matrix of *N*)\n- *Omega*: array of *n* floats; vector **\u0026Omega;** of the perturation in action\n- *K*: 2-dimensional tuple of integers; wavevectors (j,**\u0026nu;**)=(j,k\u003csub\u003e1\u003c/sub\u003e,...,k\u003csub\u003en\u003c/sub\u003e) of the perturbation \n- *AmpInf*: array of *len(K)* floats; minimal amplitudes of the perturbation \n- *AmpSup*: array of *len(K)* floats; maximum amplitudes of the perturbation\n- *CoordLine*: 1d array of floats; min and max values of the amplitudes of the potential used in *Method*='line'   \n- *ModesLine*: tuple of 0 and 1 of length *len(K)*; specify which modes are being varied (1 for a varied mode)     \n- *DirLine*: 1d array of floats; direction of the one-parameter family used in *Method*='line' \n####\n- *L*: integer; truncation in Fourier series (angles) \n- *J*: integer; truncation in Taylor series  (actions) \n####\n- *ChoiceIm*: string; 'AK2000', 'K1999', 'AKW1998'; definition of *I\u003csup\u003e-\u003c/sup\u003e* \n- *Sigma*: float; definition of *I\u003csup\u003e-\u003c/sup\u003e*\n- *Kappa*: float; definition of *I\u003csup\u003e-\u003c/sup\u003e*\n####\n- *CanonicalTransformation*: string; 'expm_onestep', 'expm_adapt', 'expm_multiply'; method to compute the canonical Lie transforms \n  - 'expm_onestep': compute the exponential of the Liouville operator in one single step\n  - 'expm_adapt': use an adaptative step-size method to compute the exponential of the Liouville operator with *AbsTol* and *RelTol* as tolerance parameters, and *MinStep* as the minimum value of the step to be used\n  - 'expm_multiply': use the algorithm developed in [A.H. Al-Mohy, N.J. Higham, SIAM Journal on Scientific Computing 33, 488 (2011)]( http://eprints.ma.man.ac.uk/1591/) to compute the exponential of the Liouville operator\n- *MinStep*: float; minimum value of the steps in the adaptive procedure to compute exponentials (for 'expm_adapt')\n- *AbsTol*: float; absolute tolerance for the adaptive procedure to compute exponentials (for 'expm_adapt')\n- *RelTol*: float; relative tolerance for the adaptive procedure to compute exponentials (for 'expm_adapt')\n- *MaxLie*: integer; maximum number of Lie transforms to be performed to eliminate the non-resonant part of the perturbation \n####\n- *TolMax*: float; value of the norm of the Hamiltonian for divergence\n- *TolMin*: float; value of the norm of the Hamiltonian for convergence \n####\n- *Precision*: integer; 32, 64 or 128; precision of calculations (default=64)\n- *NormChoice*: string; 'sum', 'max', 'Euclidean', 'Analytic'; choice of Hamiltonian norm \n- *NormAnalytic*: float; parameter of norm 'Analytic'\n####\n- *SaveData*: boolean; if True, the results are saved in a `.mat` file \n- *PlotResults*: boolean; if True, the results are plotted right after the computation\n- *Parallelization*: tuple (boolean, int); True for parallelization, int is the number of cores to be used (all of them: int='all')\n####\n---\n## Error codes\n- `0`: all transformations have been properly computed (no error)\n- `1`: one of the Lie transforms is not accurately computed\n- `2`: the series of canonical transformations to eliminate the non-resonant part of the Hamiltonian is diverging\n- `-2`: the series of canonical transformations to eliminate the non-resonant part of the Hamiltonian does not converge or diverge (*MaxLie* iterations reached)\n- `3`: the iterates of the RG map on the initially generated Hamiltonian *H*\u003csub\u003e1\u003c/sub\u003e diverge (*H*\u003csub\u003e1\u003c/sub\u003e is above the critical surface)\n- `-3`: the iterates of the RG map on the initially generated Hamiltonian *H*\u003csub\u003e2\u003c/sub\u003e converge (*H*\u003csub\u003e2\u003c/sub\u003e is below the critical surface)\n- `4`: the step in the adaptive step-size computation of the Lie transform ('expm_adapt') is below the minimum defined step size (*MinStep*)\n---\n\nReferences: \n- C. Chandre, H.R. Jauslin, *Renormalization-group analysis for the transition to chaos in Hamiltonian systems*, [Physics Reports](https://doi.org/10.1016/S0370-1573(01)00094-1) 365, 1 (2002)\n```bibtex\n@article{chandre2002,\n         title = {Renormalization-group analysis for the transition to chaos in Hamiltonian systems},\n         author = {C. Chandre and H.R. Jauslin},\n         journal = {Physics Reports},\n         volume = {365},\n         number = {1},\n         pages = {1-64},\n         year = {2002},\n         issn = {0370-1573},\n         doi = {https://doi.org/10.1016/S0370-1573(01)00094-1},\n         url = {https://www.sciencedirect.com/science/article/pii/S0370157301000941}, \n}\n```\n- A.P Bustamante, C. Chandre, *Numerical computation of critical surfaces for the breakup of invariant tori in Hamiltonian systems*, [SIAM Journal on Applied Dynamical Systems](https://doi.org/10.1137/21M1448501) 22, 483 (2023)\n```bibtex\n@article{bustamante2023,\n      title = {Numerical computation of critical surfaces for the breakup of invariant tori in Hamiltonian systems}, \n      author = {Adrian P. Bustamante and Cristel Chandre},\n      journal = {SIAM Journal on Applied Dynamical Systems},\n      volume = {22},\n      number = {1},\n      pages = {483-500},\n      year = {2023},\n      issn = {1536-0040},\n      doi = {https://doi.org/10.1137/21M1448501},\n}\n```\nFor more information: \u003ccristel.chandre@cnrs.fr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcchandre%2Frg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcchandre%2Frg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcchandre%2Frg/lists"}