diff --git a/pennylane_ionq/device.py b/pennylane_ionq/device.py index f2903fe..8105749 100644 --- a/pennylane_ionq/device.py +++ b/pennylane_ionq/device.py @@ -115,9 +115,7 @@ def __init__( sharpen=False, ): if shots is None: - raise ValueError( - "The ionq device does not support analytic expectation values." - ) + raise ValueError("The ionq device does not support analytic expectation values.") super().__init__(wires=wires, shots=shots) self.target = target @@ -167,9 +165,7 @@ def apply(self, operations, **kwargs): rotations = kwargs.pop("rotations", []) if len(operations) == 0 and len(rotations) == 0: - warnings.warn( - "Circuit is empty. Empty circuits return failures. Submitting anyway." - ) + warnings.warn("Circuit is empty. Empty circuits return failures. Submitting anyway.") for i, operation in enumerate(operations): if i > 0 and operation.name in { @@ -253,8 +249,7 @@ def prob(self): # Here, we rearrange the states to match the big-endian ordering # expected by PennyLane. basis_states = ( - int(bin(int(k))[2:].rjust(self.num_wires, "0")[::-1], 2) - for k in self.histogram + int(bin(int(k))[2:].rjust(self.num_wires, "0")[::-1], 2) for k in self.histogram ) idx = np.fromiter(basis_states, dtype=int) @@ -274,9 +269,7 @@ def probability(self, wires=None, shot_range=None, bin_size=None): if shot_range is None and bin_size is None: return self.marginal_prob(self.prob, wires) - return self.estimate_probability( - wires=wires, shot_range=shot_range, bin_size=bin_size - ) + return self.estimate_probability(wires=wires, shot_range=shot_range, bin_size=bin_size) class SimulatorDevice(IonQDevice):