{"id":19489955,"url":"https://github.com/cchandre/guiding-center","last_synced_at":"2026-02-07T17:31:41.856Z","repository":{"id":192535576,"uuid":"383156092","full_name":"cchandre/Guiding-Center","owner":"cchandre","description":"Guiding-center dynamics in plasma physics","archived":false,"fork":false,"pushed_at":"2024-08-17T08:07:09.000Z","size":6490,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-16T00:52:38.855Z","etag":null,"topics":["gyrokinetic","hamiltonian","numpy","plasma-physics","python3","scipy","sympy"],"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-07-05T13:47:11.000Z","updated_at":"2024-09-02T07:02:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"744f22bc-1876-45b9-bc9f-ab2ce38de890","html_url":"https://github.com/cchandre/Guiding-Center","commit_stats":null,"previous_names":["cchandre/guiding-center"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cchandre/Guiding-Center","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cchandre%2FGuiding-Center","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cchandre%2FGuiding-Center/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cchandre%2FGuiding-Center/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cchandre%2FGuiding-Center/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cchandre","download_url":"https://codeload.github.com/cchandre/Guiding-Center/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cchandre%2FGuiding-Center/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29201096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T16:28:23.579Z","status":"ssl_error","status_checked_at":"2026-02-07T16:28:22.566Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["gyrokinetic","hamiltonian","numpy","plasma-physics","python3","scipy","sympy"],"created_at":"2024-11-10T21:10:33.061Z","updated_at":"2026-02-07T17:31:41.839Z","avatar_url":"https://github.com/cchandre.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Guiding-Center (GC) dynamics in plasma physics\n\n- [`nondimensionalization.mlx`](https://github.com/cchandre/Guiding-Center/blob/main/nondimensionalization.mlx): Matlab Live Script for the computation of the dimensionless parameters *A*, *\u0026rho;* and *\u0026eta;* used in the code and in the analysis\n\n- [`gc2d_dict.py`](https://github.com/cchandre/Guiding-Center/blob/main/gc2d_dict.py): to be edited to change the parameters of the GC computation (see below for a dictionary of parameters)\n\n- [`gc2d.py`](https://github.com/cchandre/Guiding-Center/blob/main/gc2d.py): contains the GC classes and main functions defining the GC dynamics\n\n- [`gc2d_modules.py`](https://github.com/cchandre/Guiding-Center/blob/main/gc2d_modules.py): contains the methods to integrate the GC dynamics\n\nOnce [`gc2d_dict.py`](https://github.com/cchandre/Guiding-Center/blob/main/gc2d_dict.py) has been edited with the relevant parameters, run the file as \n```sh\npython3 gc2d.py\n```\nor \n```sh\nnohup python3 -u gc2d.py \u0026\u003egc2d.out \u003c /dev/null \u0026\n```\nThe list of Python packages and their version are specified in [`requirements.txt`](https://github.com/cchandre/Guiding-Center/blob/main/requirements.txt)\n___\n##  Parameter dictionary\n\n- *Potential*: string; 'KMdCN' or 'turbulent' \n- *Method*: string\n  - 'potentials' (only for Potential='turbulent'): plots the electrostatic potential as well as the first and second order guiding-center potentials\n  - 'diffusion_fo': computes the diffusion coefficient for the full orbits\n  - 'diffusion_gc': computes the diffusion coefficient for the guiding centers \n  - 'poincare_fo': plots the full orbits in the plane (*x*, *y*) for every period of the potential (stroboscopic plot)\n  - 'poincare_gc': plots the guiding-center trajectories in the plane (*x*, *y*) for every period of the potential (stroboscopic plot)\n####\n- *FLR*: tuple of 2 strings; 'all', 'pade' or 'none'; if 'all', FLR to all orders is taken into account; if 'pade', a Padé approximant is considered for the FLR effects; if 'none', no FLR effects are taken into account \n####\n- *A*: float or array of floats; amplitude(s) of the electrostatic potential [theory: *A*=\u0026epsilon;\u003csub\u003e\u0026delta;\u003c/sub\u003e/*B*]\n- *rho*: float or array of floats; value(s) of the Larmor radius; for full orbits, this value corresponds to the thermal Larmor radius\n- *eta*: float or array of floats; value(s) of the coefficient in front of the GC order 2 potential; \u0026eta;\u003e0 for positive charge, \u0026eta;\u003c0 for negative charge [theory: \u0026eta;=1/(2\u0026Omega;)] \n####\n- *Ntraj*: integer; number of trajectories to be integrated\n- *Tf*: integer; number of periods for the integration of the trajectories\n- *threshold*: float; value used to discriminate between trapped and untrapped trajectories (recommended: 4)\n- *TwoStepIntegration*: boolean; if True, computes trajectories from 0 to 2\u0026pi;*T*\u003csub\u003emid\u003c/sub\u003e, removes the trapped trajectories, and continues integration from 2\u0026pi;*T*\u003csub\u003emid\u003c/sub\u003e to 2\u0026pi;*T*\u003csub\u003ef\u003c/sub\u003e\n- *Tmid*: integer; number of periods for the integration of trajectories in the first step (if *TwoStepIntegration*=True)\n- *TimeStep*: float; time step used by the integrator (recommended: 5x10\u003csup\u003e-3\u003c/sup\u003e for guiding centers and 5x10\u003csup\u003e-4\u003c/sup\u003e for full orbits)\n- *check_energy*: boolean; if True, the autonomous system is integrated, and the output (`.mat` file) includes the total energy (only if *SaveData*=True)\n- *init*: string; 'random' or 'fixed'; method to generate initial conditions  \n####\n- *SaveData*: boolean; if True, the results are saved in a `.mat` file; Poincaré sections and diffusion plots *r*\u003csup\u003e2\u003c/sup\u003e(*t*) are saved as *fig_extension* files; NB: the diffusion data are saved in a `.txt` file regardless of the value of *SaveData*\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 or int='all' to use all available cores\n####\n- *modulo*: boolean; if True, *x* and *y* are represented modulo 2\u0026pi; (only for Method='poincare' and PlotResults=True)\n- *grid*: boolean; if True, show the grid lines on plots\n- *darkmode*: boolean; if True, plots are done in dark mode\n- *fig_extension*: string; e.g., '.png', '.pdf', '.svg'; format of the figures to be saved\n####\n- *M*: integer; number of modes (default = 5 for 'KMdCN' and 25 for 'turbulent') \n- *N*: integer; number of points on each axis for 'turbulent' (recommended: 2\u003csup\u003e12\u003c/sup\u003e)\n\n---\nReference: \n- M. Stanzani, F. Arlotti, G. Ciraolo, X. Garbet, C. Chandre, *Transition to super-diffusive transport in turbulent plasmas*, Physical Review E **110**, 025204 (2024); [arXiv:2309.02461](https://arxiv.org/abs/2309.02461)\n```bibtex\n@article{PhysRevE.110.025204,\n  title = {Transition to superdiffusive transport in turbulent plasmas},\n  author = {Stanzani, Matteo and Arlotti, Filippo and Ciraolo, Guido and Garbet, Xavier and Chandre, Cristel},\n  journal = {Phys. Rev. E},\n  volume = {110},\n  issue = {2},\n  pages = {025204},\n  numpages = {8},\n  year = {2024},\n  month = {Aug},\n  publisher = {American Physical Society},\n  doi = {10.1103/PhysRevE.110.025204},\n  url = {https://link.aps.org/doi/10.1103/PhysRevE.110.025204}\n}\n```\nFor more information: \u003ccristel.chandre@cnrs.fr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/cchandre/Guiding-Center/blob/main/A060_RHO040.gif\" alt=\"Example\" width=\"600\"/\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcchandre%2Fguiding-center","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcchandre%2Fguiding-center","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcchandre%2Fguiding-center/lists"}