Install
git clone https://github.com/stdogpkg/cukuramoto/ && cd cukuramoto && python setup.py install
Running
import igraph as ig
import numpy as np
from stdog.utils.misc import ig2sparse
block_size=1024 # gpu parameter
num_couplings = 40
N = 10000
G = ig.Graph.Erdos_Renyi(N, 3/N)
adj = ig2sparse(G)
adj = adj.tocsr()
ptr, indices = adj.indptr, adj.indices
couplings = np.linspace(0, 4, num_couplings).astype("float32")
omegas = np.tan(( np.arange(1,N+1)*np.pi)/N - ((N+1.)*np.pi)/(2.0*N) ).astype("float32")
phases = np.random.uniform(-np.pi, np.pi, int(num_couplings*N)).astype("float32")
import cukuramoto
dt = 0.1
num_temps = 100
simulation = cukuramoto.Heuns(
N, block_size, omegas, phases, couplings,
indices, ptr)
simulation.heuns(num_temps, dt)
order_parameter_list = simulation.get_order_parameter(num_temps, dt)
order_parameter_list = order_parameter_list.reshape(num_couplings, num_temps)
r = np.mean(order_parameter_list, axis=1)
stdr = np.std(order_parameter_list, axis=1)
import matplotlib.pyplot as plt
plt.ion()
fig, ax1 = plt.subplots()
ax1.plot(couplings,r,'.-')
ax2 = ax1.twinx()
ax2.plot(couplings,stdr,'r.-')
plt.show()
Metadata
Release files for cukuramoto 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cukuramoto-1.0.0.tar.gz | 24.5 kB | Without provenance | Details for cukuramoto-1.0.0.tar.gz |
Release files / cukuramoto-1.0.0.tar.gz
| Download URL | cukuramoto-1.0.0.tar.gz |
|---|---|
| Size | 24.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7181dd820fc53c2018608579af299e483c227872463380f641cc143db6b23eb1
|
|
BLAKE2b-256 checksum How to use checksums |
55d95426b105d8ada0a34f953329efa08fd8a9d739c949c8eca82378f8bc5d38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.8
|
Security for cukuramoto 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.