Skip to content

Commit

Permalink
reactivated ML based sparse matrix mult algorithm decision
Browse files Browse the repository at this point in the history
  • Loading branch information
positr0nium committed Jun 17, 2024
1 parent fa92b2a commit a5d18b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/qrisp/simulator/bi_array_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ def sparse_matrix_mult(A, B):
log_sparsity_a = -np.log2(B.nnz/(B.shape[0]*B.shape[1]))
log_sparsity_b = -np.log2(A.nnz/(A.shape[0]*A.shape[1]))

if get_prediction(log_shape_0_a, log_shape_1_b, log_sparsity_a, log_sparsity_b) and False:
if get_prediction(log_shape_0_a, log_shape_1_b, log_sparsity_a, log_sparsity_b):
return (A @ B).tocoo()
else:
return coo_sparse_matrix_mult(A, B)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_unitary_calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def test_unitary_calculation():
x = QuantumFloat(n, 0, qs, signed=True)
y = QuantumFloat(n, 0, qs, signed=False)

s = x * y
s = x + y
# qs = s.qs
qc = qs.compile(1)
qc = qs.compile()

start = time.time()
test_unitary_1 = qc.get_unitary()
Expand Down

0 comments on commit a5d18b7

Please sign in to comment.