From 69b2f4c8e00d978428e1de1297e3166a1f333f56 Mon Sep 17 00:00:00 2001 From: Adrian Mak <3521998+damarkian@users.noreply.github.com> Date: Wed, 17 Apr 2024 17:50:30 +0800 Subject: [PATCH 1/2] replace cnot,cry,cnot with single givens gate --- src/qibochem/ansatz/basis_rotation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qibochem/ansatz/basis_rotation.py b/src/qibochem/ansatz/basis_rotation.py index e79205d..a8b918e 100644 --- a/src/qibochem/ansatz/basis_rotation.py +++ b/src/qibochem/ansatz/basis_rotation.py @@ -273,10 +273,10 @@ def basis_rotation_gates(A, z_array, parameters): for j in range(N): for i in range(N): if A[i][j] == 0: - # print("CRY", i, i + 1, A[i+1][j]-1, z_array[A[i + 1][j] - 1]) - gate_list.append(gates.CNOT(i + 1, i)) - gate_list.append(gates.CRY(i, i + 1, z_array[A[i + 1][j] - 1])) + #gate_list.append(gates.CNOT(i + 1, i)) + #gate_list.append(gates.CRY(i, i + 1, z_array[A[i + 1][j] - 1])) + gate_list.append(gates.GIVENS(i+1, i, z_array[A[i+1][j] - 1])) ordered_angles.append(z_array[A[i + 1][j] - 1]) - gate_list.append(gates.CNOT(i + 1, i)) + #gate_list.append(gates.CNOT(i + 1, i)) return gate_list, ordered_angles From bcc858686408275d9702804edafa4540aa3d99a2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:54:38 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/qibochem/ansatz/basis_rotation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qibochem/ansatz/basis_rotation.py b/src/qibochem/ansatz/basis_rotation.py index a8b918e..a8e0d63 100644 --- a/src/qibochem/ansatz/basis_rotation.py +++ b/src/qibochem/ansatz/basis_rotation.py @@ -273,10 +273,10 @@ def basis_rotation_gates(A, z_array, parameters): for j in range(N): for i in range(N): if A[i][j] == 0: - #gate_list.append(gates.CNOT(i + 1, i)) - #gate_list.append(gates.CRY(i, i + 1, z_array[A[i + 1][j] - 1])) - gate_list.append(gates.GIVENS(i+1, i, z_array[A[i+1][j] - 1])) + # gate_list.append(gates.CNOT(i + 1, i)) + # gate_list.append(gates.CRY(i, i + 1, z_array[A[i + 1][j] - 1])) + gate_list.append(gates.GIVENS(i + 1, i, z_array[A[i + 1][j] - 1])) ordered_angles.append(z_array[A[i + 1][j] - 1]) - #gate_list.append(gates.CNOT(i + 1, i)) + # gate_list.append(gates.CNOT(i + 1, i)) return gate_list, ordered_angles