passagemath-sirocco

raw JSON →
10.8.4 verified Fri May 01 auth: no python

passagemath-sirocco provides certified root continuation for homotopy continuation methods, wrapping the sirocco C library. Version 10.8.4 requires Python >=3.11 and <3.15. Part of the passagemath ecosystem.

pip install passagemath-sirocco
error ModuleNotFoundError: No module named 'sirocco'
cause Importing 'import sirocco' instead of 'import passagemath.sirocco'.
fix
Run: import passagemath.sirocco
error ImportError: cannot import name 'certified_continuation' from 'passagemath.sirocco'
cause The function may be named differently or not available in older versions.
fix
Check the documentation: use sirocco.certified_continuation or sirocco.continuation.
error TypeError: can't convert expression to float
cause Homotopy returned symbolic expressions instead of numbers.
fix
Ensure H returns Python floats or complex numbers, not sympy or sage objects.
breaking Python version requirement: <3.15,>=3.11. Will not install on Python 3.10 or older, or on Python 3.15+.
fix Use Python 3.11-3.14.
gotcha The sirocco module is not importable directly; always use 'import passagemath.sirocco'.
fix Use 'import passagemath.sirocco' or 'from passagemath import sirocco'.
gotcha Homotopy functions must return a list of expressions convertible to complex numbers; Python floats are fine but exact rationals may cause errors.
fix Ensure homotopy evaluation returns floats or complex numbers.

Certifies root continuation for a homotopy from start solutions to target parameter.

import passagemath.sirocco as sirocco

# Define a homotopy H(x,t) = (1-t)*f(x) + t*g(x)
def H(x, t):
    return [x[0]**2 - 2 + (1-t)*0.0, x[0]*x[1] - 1 + (t-1)*0.0]

start_solutions = [[1.4, 0.7], [-1.4, -0.7]]
target_param = 1.0

result = sirocco.certified_continuation(H, start_solutions, target_param)
print("Certified solutions:", result)