Skip to content

Commit 2fc47ef

Browse files
author
Release Manager
committed
sagemathgh-40126: Simplify QuiverRep_generic.linear_combination_of_basis method Shorten the code. This might become faster after sagemath#39726 (or might not, I haven't benchmarked) ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#40126 Reported by: user202729 Reviewer(s): Travis Scrimshaw
2 parents 12d0eda + fbb630b commit 2fc47ef

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/sage/quivers/representation.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,11 +2013,7 @@ def linear_combination_of_basis(self, coordinates):
20132013
gens = self.gens()
20142014
if len(gens) != len(coordinates):
20152015
raise ValueError("the coordinates do not match the dimension of the module")
2016-
2017-
result = self() # this must not be self.zero(), which is cached
2018-
for ci, gi in zip(coordinates, gens):
2019-
result += ci * gi
2020-
return result
2016+
return self.sum(ci * gi for ci, gi in zip(coordinates, gens))
20212017

20222018
###########################################################################
20232019
# #

0 commit comments

Comments
 (0)