From c0067a7359e9748609ff6c3e73a9b717f4b936aa Mon Sep 17 00:00:00 2001 From: Pablo Brubeck Date: Tue, 31 Oct 2023 10:45:28 +0000 Subject: [PATCH] restor form_matrix_product --- FIAT/polynomial_set.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/FIAT/polynomial_set.py b/FIAT/polynomial_set.py index 502675cda..cfde1a84d 100644 --- a/FIAT/polynomial_set.py +++ b/FIAT/polynomial_set.py @@ -161,6 +161,16 @@ def project(f, U, Q): return coeffs +def form_matrix_product(mats, alpha): + """Forms product over mats[i]**alpha[i]""" + m = mats[0].shape[0] + result = numpy.eye(m) + for i in range(len(alpha)): + for j in range(alpha[i]): + result = numpy.dot(mats[i], result) + return result + + def polynomial_set_union_normalized(A, B): """Given polynomial sets A and B, constructs a new polynomial set whose span is the same as that of span(A) union span(B). It may