From 2f849ffd6dc64d873e2e38c81ef4be29f3d4eb57 Mon Sep 17 00:00:00 2001 From: Astral Cai Date: Fri, 30 Aug 2024 11:24:05 -0400 Subject: [PATCH] fix isort --- pennylane/devices/default_qubit_torch.py | 2 +- pennylane/devices/reference_qubit.py | 11 +++-------- pennylane/gradients/vjp.py | 3 ++- pennylane/numpy/random.py | 2 +- pennylane/qaoa/cycle.py | 2 +- 5 files changed, 8 insertions(+), 12 deletions(-) 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