From 1bac836d65aba55d1a498607ae693cab5ef10bdb Mon Sep 17 00:00:00 2001 From: Hirmay Sandesara <56473003+Hirmay@users.noreply.github.com> Date: Tue, 2 Jul 2024 15:05:33 +0530 Subject: [PATCH] Update qiskit/circuit/library/data_preparation/state_preparation.py Co-authored-by: Julien Gacon --- qiskit/circuit/library/data_preparation/state_preparation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit/circuit/library/data_preparation/state_preparation.py b/qiskit/circuit/library/data_preparation/state_preparation.py index d813c7bf3df..24c92104712 100644 --- a/qiskit/circuit/library/data_preparation/state_preparation.py +++ b/qiskit/circuit/library/data_preparation/state_preparation.py @@ -317,7 +317,7 @@ def _define(self): l_value = [index for (index, item) in enumerate(n_value) if item == 1] # Locations of '1's qc.x(l_value[1:k]) - m_current_value = 2 ** (l_value[0]) + m_current_value = 2 ** l_value[0] theta = -2 * np.arccos(np.sqrt(m_current_value / num_superpos_states)) if l_value[0] > 0: # if num_superpos_states is even