Avoid flatten() so as to keep the shape information of contraction results

This commit is contained in:
Liwei Yang
2023-04-19 16:23:59 +08:00
parent 4d36afb9ef
commit e517b4fe7c
2 changed files with 3 additions and 2 deletions

View File

@@ -40,7 +40,8 @@ def test_eval(nqubits: int, dtype="complex128"):
lambda: qibo_qft(nqubits, swaps=True))
# Test Cuquantum
cutn_time, result_tn = time(lambda: qibotn.cutn.eval(qibo_circ, dtype))
cutn_time, result_tn = time(
lambda: qibotn.cutn.eval(qibo_circ, dtype).flatten())
assert 1e-2 * qibo_time < cutn_time < 1e2 * qibo_time
assert np.allclose(