Code Example
# Kuramoto-to-quantum pipeline in 10 lines
from scpn_quantum_control.bridge import KnmCompiler
from scpn_quantum_control.phase import TrotterEvolution
from scpn_quantum_control.analysis import order_parameter
# Define coupling matrix (4 oscillators)
K = [[0, 1.2, 0.5, 0], [1.2, 0, 0.8, 0.3],
[0.5, 0.8, 0, 1.0], [0, 0.3, 1.0, 0]]
omega = [1.0, 1.5, 0.8, 1.2] # natural frequencies
# Compile to quantum circuit
compiler = KnmCompiler(K, omega)
H = compiler.hamiltonian() # XY Hamiltonian
circuit = TrotterEvolution(H, dt=0.1, steps=20).circuit()
# Measure synchronisation
R = order_parameter(circuit, shots=8192)
print(f"Order parameter R = {R:.4f}")