|
1 | 1 | """Finite simplicial topology domain.""" |
2 | 2 |
|
3 | | -from jacobian.catalog.models import MathTools |
4 | | -from jacobian.math.topology._operations import TOPOLOGY_OPERATIONS |
| 3 | +from jacobian.catalog._examples import example |
| 4 | +from jacobian.catalog.models import MathTool, MathTools |
| 5 | +from jacobian.math.topology._models import FVectorRequest, FVectorResult |
| 6 | +from jacobian.math.topology._operations import TOPOLOGY_OPERATIONS, compute_f_vector |
5 | 7 |
|
6 | 8 | __all__ = ["TOOLS"] |
7 | 9 |
|
8 | | -TOOLS: MathTools = TOPOLOGY_OPERATIONS |
| 10 | +_f_vector_tool = MathTool( |
| 11 | + operation_id="topology.simplicial_complex.f_vector.compute", |
| 12 | + version="1", |
| 13 | + title="Compute the f-vector and h-vector of a simplicial complex", |
| 14 | + description=( |
| 15 | + "Compute the f-vector (face counts by dimension) and h-vector " |
| 16 | + "of a finite simplicial complex, with Euler characteristic." |
| 17 | + ), |
| 18 | + request_type=FVectorRequest, |
| 19 | + result_type=FVectorResult, |
| 20 | + run=compute_f_vector, |
| 21 | + tags=("topology", "simplicial", "exact"), |
| 22 | + examples=( |
| 23 | + example( |
| 24 | + "triangle_f_vector", |
| 25 | + "Compute f-vector of a triangle (3 vertices, 3 edges, 1 face); " |
| 26 | + "facets must be a list of simplices.", |
| 27 | + { |
| 28 | + "complex": { |
| 29 | + "vertices": ["v0", "v1", "v2"], |
| 30 | + "facets": [["v0", "v1", "v2"]], |
| 31 | + } |
| 32 | + }, |
| 33 | + ), |
| 34 | + ), |
| 35 | +) |
| 36 | + |
| 37 | +TOOLS: MathTools = (*TOPOLOGY_OPERATIONS, _f_vector_tool) |
0 commit comments