pynamicalsys 1.3.0__tar.gz → 1.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/CHANGELOG.md +49 -2
  2. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/PKG-INFO +37 -8
  3. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/README.md +35 -7
  4. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/pyproject.toml +7 -1
  5. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/__init__.py +2 -0
  6. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/__version__.py +3 -3
  7. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/common/recurrence_quantification_analysis.py +1 -1
  8. pynamicalsys-1.4.0/src/pynamicalsys/common/time_series_metrics.py +85 -0
  9. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/common/utils.py +3 -3
  10. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/continuous_time/chaotic_indicators.py +306 -8
  11. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/continuous_time/models.py +25 -0
  12. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/continuous_time/numerical_integrators.py +7 -7
  13. pynamicalsys-1.4.0/src/pynamicalsys/continuous_time/trajectory_analysis.py +646 -0
  14. pynamicalsys-1.4.0/src/pynamicalsys/core/continuous_dynamical_systems.py +1865 -0
  15. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/core/discrete_dynamical_systems.py +20 -9
  16. pynamicalsys-1.4.0/src/pynamicalsys/core/hamiltonian_systems.py +1193 -0
  17. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/core/time_series_metrics.py +65 -0
  18. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/discrete_time/dynamical_indicators.py +13 -102
  19. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/discrete_time/models.py +2 -2
  20. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/discrete_time/trajectory_analysis.py +10 -10
  21. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/discrete_time/transport.py +1 -1
  22. pynamicalsys-1.4.0/src/pynamicalsys/hamiltonian_systems/__init__.py +16 -0
  23. pynamicalsys-1.4.0/src/pynamicalsys/hamiltonian_systems/chaotic_indicators.py +638 -0
  24. pynamicalsys-1.4.0/src/pynamicalsys/hamiltonian_systems/models.py +68 -0
  25. pynamicalsys-1.4.0/src/pynamicalsys/hamiltonian_systems/numerical_integrators.py +248 -0
  26. pynamicalsys-1.4.0/src/pynamicalsys/hamiltonian_systems/trajectory_analysis.py +293 -0
  27. pynamicalsys-1.4.0/src/pynamicalsys/hamiltonian_systems/validators.py +114 -0
  28. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys.egg-info/PKG-INFO +37 -8
  29. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys.egg-info/SOURCES.txt +19 -1
  30. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys.egg-info/requires.txt +1 -0
  31. pynamicalsys-1.4.0/tests/continuous_time/test_RTE.ipynb +357 -0
  32. pynamicalsys-1.4.0/tests/continuous_time/test_basin_of_attraction.ipynb +316 -0
  33. pynamicalsys-1.4.0/tests/continuous_time/test_hurst_exponent.ipynb +261 -0
  34. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/continuous_time/test_lyapunov.ipynb +37 -37
  35. pynamicalsys-1.4.0/tests/continuous_time/test_poincare_section.ipynb +194 -0
  36. pynamicalsys-1.4.0/tests/discrete-time/test_hurst_exponent.ipynb +132 -0
  37. pynamicalsys-1.4.0/tests/hamiltonian_systems/test_RTE.ipynb +276 -0
  38. pynamicalsys-1.4.0/tests/hamiltonian_systems/test_alignment_indices.ipynb +315 -0
  39. pynamicalsys-1.4.0/tests/hamiltonian_systems/test_hurst_exponent.ipynb +242 -0
  40. pynamicalsys-1.4.0/tests/hamiltonian_systems/test_lyapunov.ipynb +348 -0
  41. pynamicalsys-1.4.0/tests/hamiltonian_systems/test_poincare_section.ipynb +146 -0
  42. pynamicalsys-1.4.0/tests/hamiltonian_systems/test_trajectory.ipynb +314 -0
  43. pynamicalsys-1.3.0/src/pynamicalsys/continuous_time/trajectory_analysis.py +0 -199
  44. pynamicalsys-1.3.0/src/pynamicalsys/core/continuous_dynamical_systems.py +0 -967
  45. pynamicalsys-1.3.0/tests/discrete-time/test_hurst_exponent.ipynb +0 -132
  46. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/.gitignore +0 -0
  47. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/CITATION.cff +0 -0
  48. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/CONTRIBUTING.md +0 -0
  49. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/LICENSE +0 -0
  50. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/MANIFEST.in +0 -0
  51. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/setup.cfg +0 -0
  52. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/common/__init__.py +0 -0
  53. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/common/basin_analysis.py +0 -0
  54. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/continuous_time/__init__.py +0 -0
  55. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/continuous_time/validators.py +0 -0
  56. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/core/__init__.py +0 -0
  57. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/core/basin_metrics.py +0 -0
  58. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/core/plot_styler.py +0 -0
  59. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/discrete_time/__init__.py +0 -0
  60. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys/discrete_time/validators.py +0 -0
  61. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys.egg-info/dependency_links.txt +0 -0
  62. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/src/pynamicalsys.egg-info/top_level.txt +0 -0
  63. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/continuous_time/test_SALI_and_LDI.ipynb +0 -0
  64. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/continuous_time/test_trajectory.ipynb +0 -0
  65. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_FTLE.ipynb +0 -0
  66. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_RTE.ipynb +0 -0
  67. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_SALI.ipynb +0 -0
  68. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_SALI.py +0 -0
  69. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_bif_diagram.ipynb +0 -0
  70. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_chaotic_saddle.ipynb +0 -0
  71. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_dig.ipynb +0 -0
  72. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_ensemble_statistics.ipynb +0 -0
  73. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_escape.ipynb +0 -0
  74. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_fractal_dimension.ipynb +0 -0
  75. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_lyapunov.ipynb +0 -0
  76. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_lyapunov_exponents.ipynb +0 -0
  77. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_manifold.ipynb +0 -0
  78. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_manifolds.ipynb +0 -0
  79. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_period_counter.ipynb +0 -0
  80. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_phase_space.ipynb +0 -0
  81. {pynamicalsys-1.3.0 → pynamicalsys-1.4.0}/tests/discrete-time/test_step.py +0 -0
@@ -5,7 +5,54 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [v1.3.0] 2025-08-23
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ - `HamiltonianSystem` class for simulating and analyzing continuous-time Hamiltonian systems.
13
+ - Support for symplectic integration:
14
+ - 2nd-order velocity–Verlet
15
+ - 4th-order Yoshida
16
+ - Trajectory computation and ensemble trajectories.
17
+ - Poincaré section generation (single and ensemble).
18
+ - Chaos indicators:
19
+ - Lyapunov spectrum and maximum Lyapunov exponent.
20
+ - Smaller Alignment Index (SALI).
21
+ - Generalized Alignment Index (GALI).
22
+ - Linear Dependence Index (LDI).
23
+ - Recurrence time entropy (RTE).
24
+ - Hurst exponent.
25
+
26
+ - `ContinuousDynamicalSystem` class:
27
+ - `poincare_section` method: return the Poincaré section of a given initial condition or of an ensemble of initial conditions.
28
+ - `stroboscopic_map` method: return the stroboscopic map of a given initial condition or of an ensemble of initial conditions.
29
+ - `maxima_map` method: return the maxima map of a given initial condition or of an ensemble of inital conditions.
30
+ - `basin_of_attraction` method: given an ensemble of initial conditions, detect and label the attractors in the system.
31
+ - `recurrence_time_entropy` method: calculates the recurrence time entropy for a given initial condition using the Poincaré section, stroboscopic map, or maxima map to construct the recurrence matrix.
32
+ - `hurst_exponent` method: calculates the Hurst exponent for a given initial condition using the Poincaré section, stroboscopic map, or maxima map.
33
+
34
+ - `TimeSeriesMetrics`:
35
+ - `hurst_exponent` method.
36
+
37
+ ### Modified
38
+
39
+ - `DiscreteDynamicalSystem` class:
40
+ - Unified the Hurst exponent calculation into a single function.
41
+
42
+ - `ContinuousDynamicalSystem` class:
43
+ - `lyapunov` method now uses a specific function to compute only the maximum Lyapunov exponent when `num_exponents=1`.
44
+
45
+ [Unreleased]: https://github.com/mrolims/pynamicalsys/compare/v1.3.1...HEAD
46
+
47
+ ## [v1.3.1] - 2025-08-24
48
+
49
+ ### Modified
50
+
51
+ - Removed `cache=True` from the low level methods that was leading to cache compilation errors.
52
+
53
+ [v1.3.1]: https://github.com/mrolims/pynamicalsys/compare/v1.3.0...v1.3.1
54
+
55
+ ## [v1.3.0] - 2025-08-23
9
56
 
10
57
  ### Added
11
58
 
@@ -37,7 +84,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
37
84
  - Integration using the adaptive 4th/5th order Runge-Kutta method with adaptive time step.
38
85
  - Trajectory computation.
39
86
  - Lyapunov exponents calculation.
40
- - The smallest aligment index (SALI) and linear dependence index (LDI) for chaos detection.
87
+ - The smaller aligment index (SALI) and linear dependence index (LDI) for chaos detection.
41
88
 
42
89
  [v1.2.2]: https://github.com/mrolims/pynamicalsys/compare/v1.0.0...v1.2.2
43
90
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pynamicalsys
3
- Version: 1.3.0
3
+ Version: 1.4.0
4
4
  Summary: A Python toolkit for the analysis of dynamical systems
5
5
  Author-email: Matheus Rolim Sales <rolim.sales.m@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -690,6 +690,7 @@ Requires-Dist: numpy>=1.21
690
690
  Requires-Dist: matplotlib>=3.4
691
691
  Requires-Dist: numba>=0.55
692
692
  Requires-Dist: scipy>=0.6
693
+ Requires-Dist: scikit-learn>=0.14
693
694
 
694
695
  # pynamicalsys: A Python toolkit for the analysis of dynamical systems
695
696
 
@@ -701,6 +702,8 @@ Requires-Dist: scipy>=0.6
701
702
 
702
703
  **pynamicalsys** is designed to provide a fast, flexible, and user-friendly environment for analyzing **nonlinear dynamical systems**. It is intended for students, researchers, educators, and enthusiasts who want to explore the world of chaos and dynamical systems. Beyond standard tools like trajectory generation and Lyapunov exponents calculation, **pynamicalsys** includes advanced features such as
703
704
 
705
+ - **Bifurcation diagrams**, **Poincaré sections**, and **stroboscopic maps** for analyzing system trajectories.
706
+ - **Symplectic integrators** for analyzing Hamiltonian systems.
704
707
  - **Linear dependence index** for chaos detection.
705
708
  - **Recurrence plots** and recurrence time statistics.
706
709
  - Chaos indicators based on **weighted Birkhoff averages**.
@@ -723,7 +726,7 @@ Requires-Dist: scipy>=0.6
723
726
  To install the latest stable release, run in your command line:
724
727
 
725
728
  ```bash
726
- $ pip install pynamicalsys
729
+ pip install pynamicalsys
727
730
  ```
728
731
 
729
732
  > **Note:** On **Windows**, it is **strongly recommended** to use [Anaconda](https://www.anaconda.com). It simplifies dependency management and avoids potential issues with scientific libraries during installation. Be sure to run the command from the **Anaconda Prompt**, not from Command Prompt or PowerShell, to ensure the correct environment is activated.
@@ -733,7 +736,7 @@ $ pip install pynamicalsys
733
736
  To upgrade your current version of **pynamicalsys** to the latest stable release, run in your command line:
734
737
 
735
738
  ```bash
736
- $ pip install pynamicalsys --upgrade
739
+ pip install pynamicalsys --upgrade
737
740
  ```
738
741
 
739
742
  ### Install from source
@@ -741,9 +744,9 @@ $ pip install pynamicalsys --upgrade
741
744
  If you want to install the development version from the source repository, clone the repo and install with:
742
745
 
743
746
  ```bash
744
- $ git clone https://github.com/mrolims/pynamicalsys.git
745
- $ cd pynamicalsys
746
- $ pip install .
747
+ git clone https://github.com/mrolims/pynamicalsys.git
748
+ cd pynamicalsys
749
+ pip install .
747
750
  ```
748
751
 
749
752
  ### Verifying the installation
@@ -760,12 +763,26 @@ After installation, you can verify it by running Python and importing the packag
760
763
  If you encounter any issues, make sure you have the latest version of pip:
761
764
 
762
765
  ```bash
763
- $ pip install --upgrade pip build
766
+ pip install --upgrade pip build
764
767
  ```
765
768
 
769
+ ## Documentation
770
+
771
+ For detailed instructions, examples, and API references, please visit the full documentation page:
772
+
773
+ [pynamicalsys.readthedocs.io](https://pynamicalsys.readthedocs.io/)
774
+
775
+ The documentation includes:
776
+
777
+ - **Getting Started** — installation and quick-start examples.
778
+ - **Tutorial** — step-by-step explanations of key concepts and pratical demonstrations.
779
+ - **API Reference** — detailed descriptions of all functions, parameters, and return values.
780
+
766
781
  ## Citation
767
782
 
768
- Currently, our research paper is under review, but in the mean time, if you use **pynamicalsys** in your work, you can cite the [arXiv](https://arxiv.org/abs/2506.14044) version:
783
+ Our research paper is currently under review. In the meantime, if you use **pynamicalsys** in your work, please cite the [arXiv version](https://arxiv.org/abs/2506.14044). Below are recommended citation formats for different use cases.
784
+
785
+ ### BibTeX
769
786
 
770
787
  ```bibtex
771
788
  @misc{pynamicalsys,
@@ -779,6 +796,18 @@ Currently, our research paper is under review, but in the mean time, if you use
779
796
  }
780
797
  ```
781
798
 
799
+ ### APA style
800
+
801
+ ```
802
+ Rolim Sales, M., Costa de Souza, L., Borin, D., Mugnaine, M., Szezech Jr., J. D., Viana, R. L., Caldas, I. L., Leonel, E. D., & Antonopoulos, C. G. (2025). pynamicalsys: A Python toolkit for the analysis of dynamical systems. arXiv:2506.14044. https://arxiv.org/abs/2506.14044
803
+ ```
804
+
805
+ ### Short citation style
806
+
807
+ ```
808
+ Matheus Rolim Sales et al., "pynamicalsys: A Python toolkit for the analysis of dynamical systems," arXiv:2506.14044, 2025. https://arxiv.org/abs/2506.14044
809
+ ```
810
+
782
811
  ## Contributing
783
812
 
784
813
  We welcome contributions from the community! To get started, please see our [Contributing Guidelines](https://pynamicalsys.readthedocs.io/en/latest/contributing.html).
@@ -8,6 +8,8 @@
8
8
 
9
9
  **pynamicalsys** is designed to provide a fast, flexible, and user-friendly environment for analyzing **nonlinear dynamical systems**. It is intended for students, researchers, educators, and enthusiasts who want to explore the world of chaos and dynamical systems. Beyond standard tools like trajectory generation and Lyapunov exponents calculation, **pynamicalsys** includes advanced features such as
10
10
 
11
+ - **Bifurcation diagrams**, **Poincaré sections**, and **stroboscopic maps** for analyzing system trajectories.
12
+ - **Symplectic integrators** for analyzing Hamiltonian systems.
11
13
  - **Linear dependence index** for chaos detection.
12
14
  - **Recurrence plots** and recurrence time statistics.
13
15
  - Chaos indicators based on **weighted Birkhoff averages**.
@@ -30,7 +32,7 @@
30
32
  To install the latest stable release, run in your command line:
31
33
 
32
34
  ```bash
33
- $ pip install pynamicalsys
35
+ pip install pynamicalsys
34
36
  ```
35
37
 
36
38
  > **Note:** On **Windows**, it is **strongly recommended** to use [Anaconda](https://www.anaconda.com). It simplifies dependency management and avoids potential issues with scientific libraries during installation. Be sure to run the command from the **Anaconda Prompt**, not from Command Prompt or PowerShell, to ensure the correct environment is activated.
@@ -40,7 +42,7 @@ $ pip install pynamicalsys
40
42
  To upgrade your current version of **pynamicalsys** to the latest stable release, run in your command line:
41
43
 
42
44
  ```bash
43
- $ pip install pynamicalsys --upgrade
45
+ pip install pynamicalsys --upgrade
44
46
  ```
45
47
 
46
48
  ### Install from source
@@ -48,9 +50,9 @@ $ pip install pynamicalsys --upgrade
48
50
  If you want to install the development version from the source repository, clone the repo and install with:
49
51
 
50
52
  ```bash
51
- $ git clone https://github.com/mrolims/pynamicalsys.git
52
- $ cd pynamicalsys
53
- $ pip install .
53
+ git clone https://github.com/mrolims/pynamicalsys.git
54
+ cd pynamicalsys
55
+ pip install .
54
56
  ```
55
57
 
56
58
  ### Verifying the installation
@@ -67,12 +69,26 @@ After installation, you can verify it by running Python and importing the packag
67
69
  If you encounter any issues, make sure you have the latest version of pip:
68
70
 
69
71
  ```bash
70
- $ pip install --upgrade pip build
72
+ pip install --upgrade pip build
71
73
  ```
72
74
 
75
+ ## Documentation
76
+
77
+ For detailed instructions, examples, and API references, please visit the full documentation page:
78
+
79
+ [pynamicalsys.readthedocs.io](https://pynamicalsys.readthedocs.io/)
80
+
81
+ The documentation includes:
82
+
83
+ - **Getting Started** — installation and quick-start examples.
84
+ - **Tutorial** — step-by-step explanations of key concepts and pratical demonstrations.
85
+ - **API Reference** — detailed descriptions of all functions, parameters, and return values.
86
+
73
87
  ## Citation
74
88
 
75
- Currently, our research paper is under review, but in the mean time, if you use **pynamicalsys** in your work, you can cite the [arXiv](https://arxiv.org/abs/2506.14044) version:
89
+ Our research paper is currently under review. In the meantime, if you use **pynamicalsys** in your work, please cite the [arXiv version](https://arxiv.org/abs/2506.14044). Below are recommended citation formats for different use cases.
90
+
91
+ ### BibTeX
76
92
 
77
93
  ```bibtex
78
94
  @misc{pynamicalsys,
@@ -86,6 +102,18 @@ Currently, our research paper is under review, but in the mean time, if you use
86
102
  }
87
103
  ```
88
104
 
105
+ ### APA style
106
+
107
+ ```
108
+ Rolim Sales, M., Costa de Souza, L., Borin, D., Mugnaine, M., Szezech Jr., J. D., Viana, R. L., Caldas, I. L., Leonel, E. D., & Antonopoulos, C. G. (2025). pynamicalsys: A Python toolkit for the analysis of dynamical systems. arXiv:2506.14044. https://arxiv.org/abs/2506.14044
109
+ ```
110
+
111
+ ### Short citation style
112
+
113
+ ```
114
+ Matheus Rolim Sales et al., "pynamicalsys: A Python toolkit for the analysis of dynamical systems," arXiv:2506.14044, 2025. https://arxiv.org/abs/2506.14044
115
+ ```
116
+
89
117
  ## Contributing
90
118
 
91
119
  We welcome contributions from the community! To get started, please see our [Contributing Guidelines](https://pynamicalsys.readthedocs.io/en/latest/contributing.html).
@@ -15,7 +15,13 @@ classifiers = [
15
15
  "Topic :: Software Development :: Libraries :: Python Modules",
16
16
  ]
17
17
 
18
- dependencies = ["numpy >=1.21", "matplotlib >=3.4", "numba >=0.55", "scipy >=0.6"]
18
+ dependencies = [
19
+ "numpy >=1.21",
20
+ "matplotlib >=3.4",
21
+ "numba >=0.55",
22
+ "scipy >=0.6",
23
+ "scikit-learn >=0.14",
24
+ ]
19
25
  requires-python = ">=3.8"
20
26
 
21
27
  [build-system]
@@ -17,6 +17,7 @@
17
17
 
18
18
  from pynamicalsys.core.discrete_dynamical_systems import DiscreteDynamicalSystem
19
19
  from pynamicalsys.core.continuous_dynamical_systems import ContinuousDynamicalSystem
20
+ from pynamicalsys.core.hamiltonian_systems import HamiltonianSystem
20
21
  from pynamicalsys.core.basin_metrics import BasinMetrics
21
22
  from pynamicalsys.core.plot_styler import PlotStyler
22
23
  from pynamicalsys.core.time_series_metrics import TimeSeriesMetrics
@@ -25,6 +26,7 @@ from .__version__ import __version__
25
26
  __all__ = [
26
27
  "DiscreteDynamicalSystem",
27
28
  "ContinuousDynamicalSystem",
29
+ "HamiltonianSystem",
28
30
  "PlotStyler",
29
31
  "TimeSeriesMetrics",
30
32
  "BasinMetrics",
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '1.3.0'
32
- __version_tuple__ = version_tuple = (1, 3, 0)
31
+ __version__ = version = '1.4.0'
32
+ __version_tuple__ = version_tuple = (1, 4, 0)
33
33
 
34
- __commit_id__ = commit_id = 'g138b5d22a'
34
+ __commit_id__ = commit_id = 'g99b46b31b'
@@ -91,7 +91,7 @@ class RTEConfig:
91
91
  raise ValueError("metric must be 'supremum', 'euclidean' or 'manhattan'")
92
92
 
93
93
 
94
- @njit(cache=True)
94
+ @njit
95
95
  def _recurrence_matrix(
96
96
  arr: NDArray[np.float64], threshold: float, metric_id: int
97
97
  ) -> NDArray[np.uint8]:
@@ -0,0 +1,85 @@
1
+ from typing import Optional, Tuple, Union, Callable
2
+ from numpy.typing import NDArray
3
+ import numpy as np
4
+ from numba import njit, prange
5
+
6
+ from pynamicalsys.common.utils import fit_poly
7
+
8
+
9
+ @njit(parallel=True)
10
+ def hurst_exponent(
11
+ time_series: NDArray[np.float64],
12
+ wmin: int = 2,
13
+ ) -> NDArray[np.float64]:
14
+
15
+ time_series = time_series.copy()
16
+
17
+ sample_size, neq = time_series.shape
18
+
19
+ H = np.zeros(neq)
20
+
21
+ ells = np.arange(wmin, sample_size // 2)
22
+ log_ells = np.log(ells)
23
+ RS = np.empty((ells.shape[0], neq))
24
+
25
+ for j in prange(neq):
26
+ series = time_series[:, j]
27
+
28
+ # Precompute cumulative sums and cumulative sums of squares
29
+ cum_sum = np.zeros(sample_size)
30
+ cum_sum_sq = np.zeros(sample_size)
31
+ cum_sum[0] = series[0]
32
+ cum_sum_sq[0] = series[0] ** 2
33
+ for t in range(1, sample_size):
34
+ cum_sum[t] = cum_sum[t - 1] + series[t]
35
+ cum_sum_sq[t] = cum_sum_sq[t - 1] + series[t] ** 2
36
+
37
+ for i, ell in enumerate(ells):
38
+ num_blocks = sample_size // ell
39
+ R_over_S = np.zeros(num_blocks)
40
+
41
+ for block in range(num_blocks):
42
+ start = block * ell
43
+ end = start + ell
44
+
45
+ # Mean using cumulative sums
46
+ block_sum = cum_sum[end - 1] - (cum_sum[start - 1] if start > 0 else 0)
47
+ block_mean = block_sum / ell
48
+
49
+ # Variance using cumulative sums of squares
50
+ block_sum_sq = cum_sum_sq[end - 1] - (
51
+ cum_sum_sq[start - 1] if start > 0 else 0
52
+ )
53
+ var = block_sum_sq / ell - block_mean**2
54
+ S = np.sqrt(var) if var > 0 else 0
55
+
56
+ # Cumulative sum of mean-adjusted series for range
57
+ max_Z = 0.0
58
+ min_Z = 0.0
59
+ cumsum = 0.0
60
+ for k in range(start, end):
61
+ cumsum += series[k] - block_mean
62
+ if cumsum > max_Z:
63
+ max_Z = cumsum
64
+ if cumsum < min_Z:
65
+ min_Z = cumsum
66
+ R = max_Z - min_Z
67
+
68
+ R_over_S[block] = R / S if S > 0 else 0.0
69
+
70
+ positive_mask = R_over_S > 0
71
+ RS[i, j] = (
72
+ np.mean(R_over_S[positive_mask]) if np.any(positive_mask) else 0.0
73
+ )
74
+
75
+ # Linear regression in log-log space
76
+ positive_inds = np.where(RS[:, j] > 0)[0]
77
+ if positive_inds.size == 0:
78
+ H[j] = 0.0
79
+ else:
80
+ x_fit = log_ells[positive_inds]
81
+ y_fit = np.log(RS[positive_inds, j])
82
+ fitting = fit_poly(x_fit, y_fit, 1)
83
+ H[j] = fitting[0]
84
+
85
+ return H
@@ -21,7 +21,7 @@ from numpy.typing import NDArray
21
21
  from numba import njit
22
22
 
23
23
 
24
- @njit(cache=True)
24
+ @njit
25
25
  def qr(M: NDArray[np.float64]) -> Tuple[NDArray[np.float64], NDArray[np.float64]]:
26
26
  """
27
27
  Perform numerically stable QR decomposition using modified Gram-Schmidt with reorthogonalization.
@@ -92,7 +92,7 @@ def qr(M: NDArray[np.float64]) -> Tuple[NDArray[np.float64], NDArray[np.float64]
92
92
  return Q, R
93
93
 
94
94
 
95
- @njit(cache=True)
95
+ @njit
96
96
  def householder_qr(
97
97
  M: NDArray[np.float64],
98
98
  ) -> Tuple[NDArray[np.float64], NDArray[np.float64]]:
@@ -184,7 +184,7 @@ def householder_qr(
184
184
  return Q, R
185
185
 
186
186
 
187
- @njit(cache=True)
187
+ @njit
188
188
  def finite_difference_jacobian(
189
189
  u: NDArray[np.float64],
190
190
  parameters: NDArray[np.float64],