diff --git a/pennylane/devices/default_qubit_torch.py b/pennylane/devices/default_qubit_torch.py index 1d3e3402e75..46752dd1594 100644 --- a/pennylane/devices/default_qubit_torch.py +++ b/pennylane/devices/default_qubit_torch.py @@ -17,8 +17,8 @@ import inspect import logging import warnings -import numpy as np +import numpy as np from packaging.version import Version try: diff --git a/pennylane/devices/reference_qubit.py b/pennylane/devices/reference_qubit.py index 3beb2325987..4905aa07b89 100644 --- a/pennylane/devices/reference_qubit.py +++ b/pennylane/devices/reference_qubit.py @@ -18,18 +18,13 @@ import numpy as np -from pennylane.typing import Result - import pennylane as qml +from pennylane.typing import Result from .device_api import Device from .execution_config import DefaultExecutionConfig -from .preprocess import ( - decompose, - validate_measurements, - validate_device_wires, -) -from .modifiers import single_tape_support, simulator_tracking +from .modifiers import simulator_tracking, single_tape_support +from .preprocess import decompose, validate_device_wires, validate_measurements def sample_state(state: np.ndarray, shots: int, seed=None): diff --git a/pennylane/gradients/vjp.py b/pennylane/gradients/vjp.py index 50068ece593..87b722b7f43 100644 --- a/pennylane/gradients/vjp.py +++ b/pennylane/gradients/vjp.py @@ -16,9 +16,10 @@ of tapes. """ +import autograd + # pylint: disable=no-member, too-many-branches import numpy as np -import autograd import pennylane as qml diff --git a/pennylane/numpy/random.py b/pennylane/numpy/random.py index 555d78f9fc0..eae1511cf4f 100644 --- a/pennylane/numpy/random.py +++ b/pennylane/numpy/random.py @@ -16,9 +16,9 @@ it works with the PennyLane :class:`~.tensor` class. """ +from autograd.numpy import random as _random from numpy import __version__ as np_version from numpy.random import MT19937, PCG64, SFC64, Philox # pylint: disable=unused-import -from autograd.numpy import random as _random from packaging.specifiers import SpecifierSet from packaging.version import Version diff --git a/pennylane/qaoa/cycle.py b/pennylane/qaoa/cycle.py index 07f906e35f3..0edfb4b9146 100644 --- a/pennylane/qaoa/cycle.py +++ b/pennylane/qaoa/cycle.py @@ -19,8 +19,8 @@ from collections.abc import Iterable from typing import Union -import numpy as np import networkx as nx +import numpy as np import rustworkx as rx import pennylane as qml