hypersynchronization.identify_k_clusters#
- hypersynchronization.identify_k_clusters(thetas, k, atol=0.01)[source]#
Check if k-cluster state.
A k-cluster state has k evenly spaced clusters on the circle.
- Parameters:
- thetasarray-like, shape (n_phases,)
Phases of the oscillators.
- kint
Number of clusters.
- atolfloat, optional
The absolute tolerance used for comparison with synchronization parameters. Default is 1e-2.
- Returns:
- is_k_clustersbool
True if the state is a k-cluster. False otherwise.
- sizeslist of float
The relative sizes of each cluster.
See also
identify_stateIdentify the overall synchronization state.
generate_k_clustersGenerate a k-cluster initial condition.
Examples
>>> import numpy as np >>> import hypersynchronization as hs >>> theta = np.array([0.0] * 5 + [np.pi] * 5) >>> is_2clust, sizes = hs.identify_k_clusters(theta, k=2) >>> is_2clust, sizes (True, [0.5, 0.5])