From e24a56f253e62d2fe9731b0bdf6e34ff98687a4f Mon Sep 17 00:00:00 2001 From: Hirmay Sandesara <56473003+Hirmay@users.noreply.github.com> Date: Thu, 11 Apr 2024 15:06:11 +0530 Subject: [PATCH] reblacked state_prep --- .../data_preparation/state_preparation.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/qiskit/circuit/library/data_preparation/state_preparation.py b/qiskit/circuit/library/data_preparation/state_preparation.py index 88c8c1f66710..a182535f8ae7 100644 --- a/qiskit/circuit/library/data_preparation/state_preparation.py +++ b/qiskit/circuit/library/data_preparation/state_preparation.py @@ -443,7 +443,7 @@ def _multiplex(self, target_gate, list_of_angles, last_cnot=True): class Generalized_Uniform_Superposition_Gate(Gate): """ - Class that implements a generalized uniform superposition state, using n qubits, + Class that implements a generalized uniform superposition state, using n qubits, following the Shukla-Vedula algorithm [SV24]. """ @@ -457,34 +457,34 @@ def __init__( Args: M (int): - A positive integer M (> 1) representing the number of computational - basis states with an amplitude of 1/sqrt(M) in the uniform superposition - state ($\frac{1}{\sqrt{M}} \sum_{j=0}^{M-1} \ket{j} $, where - $1< M <= 2^n$). Note that the remaining (2^n - M) computational basis + A positive integer M (> 1) representing the number of computational + basis states with an amplitude of 1/sqrt(M) in the uniform superposition + state ($\frac{1}{\sqrt{M}} \sum_{j=0}^{M-1} \ket{j} $, where + $1< M <= 2^n$). Note that the remaining (2^n - M) computational basis states have zero amplitudes. Here M need not be an integer power of 2. num_qubits (int): A positive integer representing the number of qubits used. Returns: - A quantum circuit that creates the uniform superposition state: + A quantum circuit that creates the uniform superposition state: $\frac{1}{\sqrt{M}} \sum_{j=0}^{M-1} \ket{j} $. **References:** [SV24] - A. Shukla and P. Vedula, "An efficient quantum algorithm for preparation - of uniform quantum superposition states," Quantum Information Processing, + A. Shukla and P. Vedula, "An efficient quantum algorithm for preparation + of uniform quantum superposition states," Quantum Information Processing, 23(38): pp. 1-32 (2024). Raises: QiskitError: ``num_qubits`` parameter used when ``params`` is not an integer Note: - The Shukla-Vedula algorithm [SV24] provides an efficient approach for - creation of a generalized uniform superposition state of the form, - $\frac{1}{\sqrt{M}} \sum_{j=0}^{M-1} \ket{j} $. It needs only - $O(\log_2 (M))$ qubits and $O(\log_2 (M))$ gates, hence providing an - exponential improvement, in terms of reduced resources and complexity, + The Shukla-Vedula algorithm [SV24] provides an efficient approach for + creation of a generalized uniform superposition state of the form, + $\frac{1}{\sqrt{M}} \sum_{j=0}^{M-1} \ket{j} $. It needs only + $O(\log_2 (M))$ qubits and $O(\log_2 (M))$ gates, hence providing an + exponential improvement, in terms of reduced resources and complexity, compared to alternative methods in existing literature. """ if not (isinstance(M, int) and (M > 1)):