sycan.cas¶
sycan.cas — pluggable CAS backend.
Sycan keeps every symbolic primitive — Symbol, Matrix,
solve(), simplify(), etc. — behind this thin proxy module so
that the underlying CAS library can be swapped without touching the rest
of the codebase. Today only "sympy" is wired up; future backends
can be added by writing another _<name>_backend.py and extending
select_backend().
Typical use:
from sycan import cas as cas
x = cas.Symbol("x")
cas.solve(cas.Eq(x**2, 4), x)
To force a specific backend (otherwise "sympy" is selected on first
attribute access):
from sycan import cas
cas.select_backend("sympy")
The proxy forwards getattr to the active backend module, so any name
the backend exposes is reachable directly — both as attribute access
(cas.Matrix) and as from sycan.cas import Matrix.
Functions
Return the tuple of backend names recognised by |
|
Return the active backend's name (selecting the default if needed). |
|
|
Choose the active CAS backend. |
- sycan.cas.select_backend(name)[source]¶
Choose the active CAS backend.
- Parameters:
name (str) – Backend identifier. Currently supported values are
"sympy"(default, full coverage) and"symengine"(fast C++ core;simplify/solve/factorand friends bridge to sympy under the hood, the rest runs natively in symengine).- Return type:
None
- sycan.cas.backend_name()[source]¶
Return the active backend’s name (selecting the default if needed).
- Return type:
str
- sycan.cas.available_backends()[source]¶
Return the tuple of backend names recognised by
select_backend().- Return type:
tuple[str, …]