From 323ed564cc78cdeef181906d3d78acc739c1e942 Mon Sep 17 00:00:00 2001 From: Michael Schneeberger Date: Mon, 26 Feb 2024 10:03:13 +0100 Subject: update readme --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index efbbe55..97c9ebf 100644 --- a/README.md +++ b/README.md @@ -61,11 +61,17 @@ state, poly_matrix = f3.apply(state) # PolyMatrixImpl(terms={(0, 0): {((0, 1), (1, 1)): 1, ((0, 1),): 2, ((1, 1),): 1}}, shape=(1, 1)) print(poly_matrix) -state, matrix_repr = polymatrix.to_matrix_repr((f3,), x).apply(state) +state, sympy_repr = polymatrix.to_sympy(f3,).apply(state) + +# prints the sympy representation of the polynomial matrix +# [[x1*x2 + 2*x1 + x2]] +print(sympy_repr) + +state, dense_repr = polymatrix.to_dense((f3,), x).apply(state) # prints the numpy matrix representations of the polynomial matrix # array([[2., 1.]]) # array([[0. , 0.5, 0.5, 0. ]]) -print(matrix_repr.data[0][1]) # numpy array -print(matrix_repr.data[0][2].toarray()) # sparse scipy array +print(dense_repr.data[0][1]) # numpy array +print(dense_repr.data[0][2].toarray()) # sparse scipy array ``` -- cgit v1.2.1