Skip to content

Commit

Permalink
Merge pull request #327 from hugohadfield/cherrypick_linear_op_matrix
Browse files Browse the repository at this point in the history
Improve speed of linear_operator_to_matrix
  • Loading branch information
hugohadfield committed Jun 9, 2020
2 parents c07db7d + 49a7a1d commit bf74bad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clifford/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def linear_operator_as_matrix(func, input_blades, output_blades):
ndimout = len(output_blades)
mat = np.zeros((ndimout, ndimin))
for i, b in enumerate(input_blades):
mat[:, i] = np.array([func(b)[j] for j in output_blades])
b_result = func(b)
mat[:, i] = np.array([b_result[j] for j in output_blades])
return mat


Expand Down

0 comments on commit bf74bad

Please sign in to comment.