From c9b856ff987aa4b438c1edf8a66944f726f1d52c Mon Sep 17 00:00:00 2001 From: Hirmay Sandesara <56473003+Hirmay@users.noreply.github.com> Date: Wed, 10 Apr 2024 16:05:33 +0530 Subject: [PATCH] function for returning M --- .../circuit/library/data_preparation/state_preparation.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qiskit/circuit/library/data_preparation/state_preparation.py b/qiskit/circuit/library/data_preparation/state_preparation.py index ebb200dae92..4c5a10320e4 100644 --- a/qiskit/circuit/library/data_preparation/state_preparation.py +++ b/qiskit/circuit/library/data_preparation/state_preparation.py @@ -534,13 +534,17 @@ def _define(self): return qc + def M(self): + """Returns the M value used by the gate" + return self._M + def num_qubits(self): """Returns the number of qubits used by the gate.""" return self._num_qubits def __repr__(self): """Returns a string representation of the gate.""" - return f"Generalized_Uniform_Superposition_Gate(M={self.M}, num_qubits={self._num_qubits})" + return f"Generalized_Uniform_Superposition_Gate(M={self._M}, num_qubits={self._num_qubits})" def broadcast_arguments(self, qargs, cargs): """Validates and handles the arguments."""