Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
king-p3nguin committed Nov 13, 2023
1 parent c09190c commit e13e0ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion qiskit/circuit/library/generalized_gates/diagonal.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

_EPS = 1e-10


class Diagonal(QuantumCircuit):
r"""Diagonal circuit.
Expand Down Expand Up @@ -144,6 +145,7 @@ def _check_input(diag):
if not np.allclose(np.abs(diag), 1, atol=_EPS):
raise CircuitError("A diagonal element does not have absolute value one.")


def _fwht(a: np.ndarray) -> np.ndarray:
"""Fast Walsh-Hadamard Transform of array a."""
step = 1
Expand All @@ -156,6 +158,7 @@ def _fwht(a: np.ndarray) -> np.ndarray:
step *= 2
return a


class DiagonalGate(Gate):
"""Gate implementing a diagonal transformation."""

Expand Down Expand Up @@ -183,4 +186,3 @@ def validate_parameter(self, parameter):
def inverse(self):
"""Return the inverse of the diagonal gate."""
return DiagonalGate([np.conj(entry) for entry in self.params])

0 comments on commit e13e0ef

Please sign in to comment.