Metadata-Version: 2.4
Name: hypersynchronization
Version: 0.2
Summary: hypersynchronization is a Python library for the simulation, analysis, and visualization of synchronization in oscillators with higher-order interactions.
Author-email: Maxime Lucas <maxime.lucas.work@gmail.com>
License: BSD 3-Clause License
        
        Copyright (c) 2023, Maxime Lucas
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: Homepage, https://github.com/maximelucas/hypersynchronization
Project-URL: Repository, https://github.com/maximelucas/hypersynchronization
Project-URL: Issues, https://github.com/maximelucas/hypersynchronization/issues
Keywords: synchronization,kuramoto,higher-order interactions,hypergraph,complex systems
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.20
Requires-Dist: scipy>=1.8
Requires-Dist: matplotlib>=3.4
Requires-Dist: xgi>=0.7.2
Requires-Dist: seaborn>=0.12
Requires-Dist: numba>=0.59
Provides-Extra: test
Requires-Dist: pytest>=7.2; extra == "test"
Requires-Dist: pytest-cov>=4.0; extra == "test"
Provides-Extra: dev
Requires-Dist: black[jupyter]>=24.0; extra == "dev"
Requires-Dist: isort>=5.10; extra == "dev"
Requires-Dist: pre-commit>=2.12; extra == "dev"
Requires-Dist: pylint>=2.10; extra == "dev"
Provides-Extra: doc
Requires-Dist: sphinx~=6.0; extra == "doc"
Requires-Dist: sphinx-copybutton; extra == "doc"
Requires-Dist: sphinx-rtd-theme>=1.2; extra == "doc"
Requires-Dist: sphinx-design; extra == "doc"
Requires-Dist: numpydoc>=1.1; extra == "doc"
Requires-Dist: pillow>=8.2; extra == "doc"
Requires-Dist: matplotlib>=3.3; extra == "doc"
Dynamic: license-file

# hypersynchronization

hypersynchronization is a Python library for the simulation, analysis, and visualization of oscillators with group (higher-order) interactions.


## Getting started

Here is a simple example to get started:

```python
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sb
import xgi

import hypersynchronization as hs

sb.set_theme(style="ticks", context="notebook")

# structural parameters 
N = 20 # number of nodes
H = xgi.random_simplicial_complex(N, ps=[0.01, 0.015], seed=1) # hypergraph
links = H.edges.filterby("order", 1).members()
triangles = H.edges.filterby("order", 2).members()

# dynamical parameters
k1 = 5  # pairwise coupling strength
k2 = 0.1  # triplet coupling strength

# integration parameters
t_end = 300
dt = 0.01
integrator = "RK45"

# generate initial contitions
theta_0 = hs.generate_state(N, kind="random")

# simulate system
thetas, times = hs.simulate_kuramoto(
    H,
    omega=np.random.normal(size=N),
    theta_0=theta_0,
    t_end=t_end,
    dt=dt,
    rhs=hs.rhs_23_sym, 
    integrator=integrator,
    args=(k1, k2, links, triangles), # arguments of the RHS function,
)


hs.plot_summary(thetas, times, H)

plt.show()
```
<img src="https://github.com/user-attachments/assets/a6c40630-b960-416d-bfd8-dd4e02c10e80" width="65%">

## Credits

hypersynchronization makes use of [XGI](https://xgi.readthedocs.io/en/stable/) for higher-order interactions and Scipy's [solve_ivp()](https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html) for ODE integration.

Released under the 3-Clause BSD license.

Maxime Lucas: maxime.lucas.work [at] gmail.com
