Summary
The README's main getting-started example crashes as written.
At README.rst:78-79, the example defines:
def rho0w(w):
return np.sqrt(1-w.clip(-1,1)**2) * 2/np.pi
During the documented flow, basis.v.overlap(rho0w) calls rho0w with a scalar float, so w.clip(...) raises an exception before the solver loop starts.
Reproduction
On commit 75b9f8fbb7991f09867e64d19424868a1c598f63:
uv sync
uv run python - <<'PY'
import sparse_ir, numpy as np
basis = sparse_ir.FiniteTempBasis('F', beta=10, wmax=8, eps=1e-6)
def rho0w(w):
return np.sqrt(1-w.clip(-1,1)**2) * 2/np.pi
basis.v.overlap(rho0w)
PY
Actual
AttributeError: 'float' object has no attribute 'clip'
Expected
The README example should run verbatim.
Notes
Using np.clip(w, -1, 1) instead of w.clip(-1, 1) makes the full README GF(2) path run successfully in my test run.
Summary
The README's main getting-started example crashes as written.
At
README.rst:78-79, the example defines:During the documented flow,
basis.v.overlap(rho0w)callsrho0wwith a scalar float, sow.clip(...)raises an exception before the solver loop starts.Reproduction
On commit
75b9f8fbb7991f09867e64d19424868a1c598f63:Actual
Expected
The README example should run verbatim.
Notes
Using
np.clip(w, -1, 1)instead ofw.clip(-1, 1)makes the full README GF(2) path run successfully in my test run.