Skip to content

Commit

Permalink
adding copy argument to __array__ (#12979)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderivrii authored Aug 19, 2024
1 parent 76eb568 commit 06392c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion qiskit/circuit/library/basis_change/qft.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,10 @@ def __init__(
"""
super().__init__(name="qft", num_qubits=num_qubits, params=[])

def __array__(self, dtype=complex):
def __array__(self, dtype=complex, copy=None):
"""Return a numpy array for the QFTGate."""
if copy is False:
raise ValueError("unable to avoid copy while creating an array as requested")
n = self.num_qubits
nums = np.arange(2**n)
outer = np.outer(nums, nums)
Expand Down

0 comments on commit 06392c5

Please sign in to comment.