{"id":19489957,"url":"https://github.com/cchandre/ocdm","last_synced_at":"2026-05-04T18:38:07.917Z","repository":{"id":151252867,"uuid":"458777769","full_name":"cchandre/OCDM","owner":"cchandre","description":"Optical Centrifuge for Diatomic Molecules","archived":false,"fork":false,"pushed_at":"2023-06-09T18:12:34.000Z","size":927,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-08T08:42:44.640Z","etag":null,"topics":["amo","hamiltonian","matplotlib","molecular-mechanics","numpy","python3","scipy","symplectic-integrators","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":"2022-02-13T10:35:43.000Z","updated_at":"2023-03-24T16:10:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"2474b8fa-2624-4110-85af-f55016243a12","html_url":"https://github.com/cchandre/OCDM","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%2FOCDM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cchandre%2FOCDM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cchandre%2FOCDM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cchandre%2FOCDM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cchandre","download_url":"https://codeload.github.com/cchandre/OCDM/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240732047,"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":["amo","hamiltonian","matplotlib","molecular-mechanics","numpy","python3","scipy","symplectic-integrators","sympy"],"created_at":"2024-11-10T21:10:34.024Z","updated_at":"2026-05-04T18:38:02.897Z","avatar_url":"https://github.com/cchandre.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OCDM\nOptical Centrifuge for Diatomic Molecules (OCDM) - codes for the chlorine molecule Cl\u003csub\u003e2\u003c/sub\u003e\n\n- [`ocdm_dict.py`](https://github.com/cchandre/OCDM/blob/main/ocdm_dict.py): to be edited to change the parameters of the OCDM computation (see below for a dictionary of parameters)\n\n- [`ocdm.py`](https://github.com/cchandre/OCDM/blob/main/ocdm.py): contains the DiaMol class and main functions defining the OCDM dynamics (for Cl\u003csub\u003e2\u003c/sub\u003e)\n\n- [`ocdm_modules.py`](https://github.com/cchandre/OCDM/blob/main/ocdm_modules.py): contains the methods to integrate the OCDM dynamics\n\n- [`read_DiaMol_dissocation.m`](https://github.com/cchandre/OCDM/blob/main/read_DiaMol_dissociation.m): MATLAB script to produce the dissociation probability figure from the output files `DiaMol_dissociation.txt` \n\n- [`read_DiaMol_trajectories.m`](https://github.com/cchandre/OCDM/blob/main/read_DiaMol_trajectories.m): MATLAB script to plot the trajectories from the output files `DiaMol.mat`\n\n- [`read_DiaMol_pphi.m`](https://github.com/cchandre/OCDM/blob/main/read_DiaMol_pphi.m): MATLAB script to plot the distributions of *p*\u003csub\u003e*\u0026phi;*\u003c/sub\u003e values from the output files `DiaMol.mat`\n\nOnce [`ocdm_dict.py`](https://github.com/cchandre/OCDM/blob/main/ocdm_dict.py) has been edited with the relevant parameters, run the file as \n```sh\npython3 ocdm.py\n```\nor \n```sh\nnohup python3 -u ocdm.py \u0026\u003eocdm.out \u003c /dev/null \u0026\n```\nThe list of Python packages and their version are specified in [`requirements.txt`](https://github.com/cchandre/OCDM/blob/main/requirements.txt). The code is using NumPy, SciPy, SymPy and Matplotlib. \n___\n##  Parameter dictionary\n\n- *Method*: string\n   - 'plot_potentials': plot the potential \u0026epsilon;(*r*) and polarizabilities \u0026alpha;(*r*)\n   - 'plot_ZVS': plot zero velocity functions\n   - 'dissociation': computes the dissociation probability as a function of the amplitude *F*\u003csub\u003e0\u003c/sub\u003e of the electric field\n   - 'trajectories': computes and displays the trajectories according to *type_traj*\n   - 'poincaré'; Poincaré section is *\u0026phi;*=0 (mod 2 \u0026pi;) with *\u0026phi;'*\u003c0 in the plane (*r*,*p*\u003csub\u003e*r*\u003c/sub\u003e) if *EventPS*='phi', and *p\u003csub\u003e*r*\u003c/sub\u003e =0 with *p\u003csub\u003e*r*\u003c/sub\u003e'\u003c0 in the plane (*\u0026phi;*,*p*\u003csub\u003e*\u0026phi;*\u003c/sub\u003e) if *EventPS*='phi'\n- *dimension*: 2 or 3; dimension of the computation\n- *F0*: float or array of floats; amplitude(s) *F*\u003csub\u003e0\u003c/sub\u003e of the electric field, *E*(*t*) = *F*\u003csub\u003e0 \u003c/sub\u003e*f*(*t*) [\u003cb\u003ee\u003csub\u003e*x*\u003c/sub\u003e\u003c/b\u003e cos\u0026Phi;(*t*) + \u003cb\u003ee\u003csub\u003e*y*\u003c/sub\u003e\u003c/b\u003e sin\u0026Phi;(*t*)] cos\u0026omega;*t*, considered in the computation (atomic units)\n- *Omega*: lambda function; values of the frequency of rotation of the polarisation axis, \u0026Omega;=\u0026Phi;'(*t*), as a function of time (atomic units)\n- *envelope*: string ('const', 'sinus', 'trapez'); envelope function *f*(*t*) of the laser field\n- *te*: array of 3 or 4 floats; duration of ramp-up, plateau, ramp-down and (optional) after pulse (in picoseconds)\n- *Ntraj*: integer; number of trajectories to be integrated\n- *r*: array of two floats; minimum and maximum values of *r* for the display of potentials, and range of *r* (atomic units) for the selection of initial conditions\n- *initial_conditions*: string or array of floats; \n   - ['microcanonical', *E*\u003csub\u003e0\u003c/sub\u003e] for a microcanonical distribution with energy *E*\u003csub\u003e0\u003c/sub\u003e\n   - ['microcanonical_J', *n*, *J*] for a microcanonical distribution with initial energy *E*\u003csub\u003e0\u003c/sub\u003e = \u0026omega;\u003csub\u003ee\u003c/sub\u003e (*n*+1/2) + *B*\u003csub\u003ee\u003c/sub\u003e *J*(*J*+1)-*D*\u003csub\u003ee\u003c/sub\u003e\n   - array of shape (*Ntraj*, 2*dimension*) containing the initial conditions to be integrated\n- *spread3D*: float; between 0 and 1; spread in angle theta for the initial conditions (only in the 3D case)\n- *TimePS*: float; time (in picoseconds) at which the Poincaré section is computed (adiabatic approximation)\n- *EnergyPS*: float; initial value of the energy (in atomic units) used in *Method*='poincaré'\n- *EventPS*: string; 'phi' or 'pr'; choice of Poincaré section; Poincaré section is *\u0026phi;*=0 (mod 2 \u0026pi;) with *\u0026phi;'*\u003c0 in the plane (*r*,*p*\u003csub\u003e*r*\u003c/sub\u003e) if *EventPS*='phi', and *p\u003csub\u003e*r*\u003c/sub\u003e =0 with *p\u003csub\u003e*r*\u003c/sub\u003e'\u003c0 in the plane (*\u0026phi;*,*p*\u003csub\u003e*\u0026phi;*\u003c/sub\u003e) if *EventPS*='phi'\n- *ode_solver*: string; 'RK45', 'RK23', 'DOP853', 'Radau', 'BDF', 'LSODA', 'Verlet', 'BM4'; method for the integration of trajectories\n    - 'RK45', 'RK23', 'DOP853', 'Radau', 'BDF', 'LSODA': (non-symplectic, variable time step); see [ivp_solve](https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html) for more details\n    - 'Verlet': Strang splitting or symplectic leap-frog integrator (symplectic, fixed time step, order 2); see [Wikipedia](https://en.wikipedia.org/wiki/Strang_splitting) for more details\n    - 'BM4' or 'BM6': BM\u003csub\u003e6\u003c/sub\u003e4 or BM\u003csub\u003e10\u003c/sub\u003e6 (symplectic, fixed time step, order 4 or 6) from [Blanes, Moan, J. Comput. Appl. Math. 142, 313 (2002)](https://doi.org/10.1016/S0377-0427(01)00492-7)\n    - NB: For Poincaré sections, ode_solver = 'RK45' by default\n- *ode_tol*: array of two floats; absolute and relative tolerances [atol, rtol] for variable time-step integrators; see [ivp_solve](https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html) for more details\n- *ode_step*: float; time step (in picoseconds) for the symplectic integrators 'Verlet' and 'BM4'\n- *r_thresh*: float; threshold for the integration of trajectories; the integration is stopped whenever the distance *r* is larger than *r_thresh*\n- *frame*: string; 'fixed' or 'rotating'; specifies in which frame the numerical integration is performed\n- *type_traj*: array of 3 strings; ['all' or 'dissociated' or 'bounded', 'cartesian' or 'spherical', 'fixed' or 'rotating'] for the type of trajectories to be plotted and/or saved\n- *dpi*: integer; dpi value for the figures \n####\n- *SaveData*: boolean; if True, the results are saved in a `.mat` file (with the type specified in 'type_traj'); if Method='dissociation', the trajectories are saved at *t*=0, *t*=*t*\u003csub\u003eu\u003c/sub\u003e, *t*=*t*\u003csub\u003eu\u003c/sub\u003e+*t*\u003csub\u003ep\u003c/sub\u003e and *t*=*t*\u003csub\u003eu\u003c/sub\u003e+*t*\u003csub\u003ep\u003c/sub\u003e+*t*\u003csub\u003ed\u003c/sub\u003e; if Method='trajectories', the trajectories are saved with 'dpi' equispaced times from *t*=0 to *t*=*t*\u003csub\u003eu\u003c/sub\u003e+*t*\u003csub\u003ep\u003c/sub\u003e+*t*\u003csub\u003ed\u003c/sub\u003e; NB: the dissociation probabilities are saved in a `.txt` file regardless of the value of SaveData\n- *PlotResults*: boolean; if True, the results (for 'plot_potentials', 'plot_ZVS' and 'trajectories') are plotted right after the computation (with the type specified in 'type_traj' for 'trajectories')\n- *Parallelization*: int or string; int is the number of cores to be used, 'all' for all of the cores\n- *darkmode*: boolean; if True, plots are done in dark mode\n\n---\nReference: \n- C. Chandre, J. Pablo Salas, *Nonlinear dynamics of molecular super-rotors*, [Physical Review A](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.107.063105) 107, 063105 (2023); [arXiv:2303.05090](https://arxiv.org/abs/2303.05090)\n```bibtex\n@article{PhysRevA.107.063105,\n  title = {Nonlinear dynamics of molecular superrotors},\n  author = {Chandre, C. and Salas, J. Pablo},\n  journal = {Phys. Rev. A},\n  volume = {107},\n  issue = {6},\n  pages = {063105},\n  numpages = {12},\n  year = {2023},\n  month = {Jun},\n  publisher = {American Physical Society},\n  doi = {10.1103/PhysRevA.107.063105},\n  url = {https://link.aps.org/doi/10.1103/PhysRevA.107.063105}\n}\n```\nFor more information: \u003ccristel.chandre@cnrs.fr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/cchandre/OCDM/blob/main/Figure_2.png\" alt=\"Example\" width=\"400\"/\u003e\n  \u003cimg src=\"https://github.com/cchandre/OCDM/blob/main/Figure_1.png\" alt=\"Example\" width=\"400\"/\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcchandre%2Focdm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcchandre%2Focdm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcchandre%2Focdm/lists"}