Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix-docs #2942

Merged
merged 3 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions pennylane/devices/default_mixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
from string import ascii_letters as ABC

import pennylane as qml
from pennylane import numpy as np
import pennylane.math as qnp
from pennylane import QubitDevice, QubitStateVector, BasisState, DeviceError, QubitDensityMatrix
from pennylane import Snapshot
from pennylane import (
BasisState,
DeviceError,
QubitDensityMatrix,
QubitDevice,
QubitStateVector,
Snapshot,
)
from pennylane import numpy as np
from pennylane.measurements import Counts, MutualInfo, Sample, State, VnEntropy
from pennylane.operation import Channel
from pennylane.ops.qubit.attributes import diagonal_in_z_basis
from pennylane.wires import Wires
from pennylane.measurements import (
Sample,
Counts,
State,
VnEntropy,
MutualInfo,
)

from pennylane.ops.qubit.attributes import diagonal_in_z_basis
from .._version import __version__

ABC_ARRAY = np.array(list(ABC))
Expand Down Expand Up @@ -555,7 +555,7 @@ def execute(self, circuit, **kwargs):

* :meth:`~.probability`

Additional keyword arguments may be passed to the this method
Additional keyword arguments may be passed to this method
that can be utilised by :meth:`apply`. An example would be passing
the ``QNode`` hash that can be used later for parametric compilation.

Expand Down
9 changes: 5 additions & 4 deletions pennylane/grouping/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import numpy as np

import pennylane as qml
from pennylane import PauliX, PauliY, PauliZ, Identity
from pennylane import Identity, PauliX, PauliY, PauliZ
from pennylane.operation import Observable, Tensor
from pennylane.wires import Wires

Expand Down Expand Up @@ -659,10 +659,11 @@ def is_qwc(pauli_vec_1, pauli_vec_2):


def are_pauli_words_qwc(lst_pauli_words):
"""Given a list of observables assumed to be valid Pauli words, determine if they
are pairwise qubit-wise commuting.
"""Given a list of observables assumed to be valid Pauli words, determine if they are pairwise
qubit-wise commuting.

This implementation has time complexity ~ O(m * n) for m Pauli words and n wires, where n is the number of distinct wire labels used to represent the Pauli words.
This implementation has time complexity ~ O(m * n) for m Pauli words and n wires, where n is the
number of distinct wire labels used to represent the Pauli words.

Args:
lst_pauli_words (list[Observable]): List of observables (assumed to be valid Pauli words).
Expand Down