From 88710f54f3503c28ac97c0c13de19e72d161edbd Mon Sep 17 00:00:00 2001 From: Liwei Yang Date: Fri, 21 Apr 2023 10:42:20 +0800 Subject: [PATCH 1/2] Minor refactoring for conciseness --- src/qibotn/cutn.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qibotn/cutn.py b/src/qibotn/cutn.py index 6deb078..e6f3e8c 100644 --- a/src/qibotn/cutn.py +++ b/src/qibotn/cutn.py @@ -5,6 +5,4 @@ from cuquantum import contract def eval(qibo_circ, datatype): myconvertor = QiboCircuitToEinsum(qibo_circ, dtype=datatype) - operands_expression = myconvertor.state_vector_operands() - results = contract(*operands_expression) - return results + return contract(*myconvertor.state_vector_operands()) From 00b6540ea621a61835e7d722a34d25ba3c89a2fa Mon Sep 17 00:00:00 2001 From: Liwei Yang Date: Fri, 21 Apr 2023 10:58:19 +0800 Subject: [PATCH 2/2] Minor inlining update --- src/qibotn/QiboCircuitConvertor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qibotn/QiboCircuitConvertor.py b/src/qibotn/QiboCircuitConvertor.py index 347f99f..abd3905 100644 --- a/src/qibotn/QiboCircuitConvertor.py +++ b/src/qibotn/QiboCircuitConvertor.py @@ -21,7 +21,7 @@ class QiboCircuitToEinsum: """This function is to modify the shape of the tensor to the required format by cuQuantum (qubit_states,) * input_output * qubits_involved """ - return (2,) * 2 * nqubits + return (2, 2) * nqubits self.backend = cp self.dtype = getattr(self.backend, dtype)