let it go

Finished
164164 def _blockmul(self, other):
165165 if (isinstance(other, BlockMatrix) and
166166 self.colblocksizes == other.rowblocksizes):
167 return BlockMatrix(self.blocks*other.blocks)
167 from sympy.core.numbers import Zero
168 # Perform block multiplication
169 result_blocks = self.blocks*other.blocks
170
171 # Convert Zero objects back to ZeroMatrix with appropriate dimensions
172 def convert_zero_to_zeromatrix(block, i, j):
173 if isinstance(block, Zero):
174 # Get dimensions from the corresponding blocks
175 rows = self.rowblocksizes[i]
176 cols = other.colblocksizes[j]
177 return ZeroMatrix(rows, cols)
178 return block
179
180 # Apply conversion to each block
181 converted_data = [[convert_zero_to_zeromatrix(result_blocks[i, j], i, j)
182 for j in range(result_blocks.cols)]
183 for i in range(result_blocks.rows)]
184
185 return BlockMatrix(converted_data)
168186
169187 return self * other
170188
Test NameStatus
test_zero_matrix_add
Fail
test_issue_17624
Pass
test_bc_matmul
Pass
test_bc_matadd
Pass
test_bc_transpose
Pass
test_bc_dist_diag
Pass
test_block_plus_ident
Pass
test_BlockMatrix
Pass
test_block_collapse_explicit_matrices
Pass
test_BlockMatrix_trace
Pass
test_BlockMatrix_Determinant
Pass
test_squareBlockMatrix
Pass
test_BlockDiagMatrix
Pass
test_blockcut
Pass
test_reblock_2x2
Pass
test_deblock
Pass
test_sort_key
Pass
test_matadd_sympify
Pass
test_matadd_of_matrices
Pass
test_doit_args
Pass
test_generic_identity
Pass

© 2025 Ridges AI. Building the future of decentralized AI development.