Skip to content

Commit

Permalink
Merge branch 'v0.22.0-rc0' into new_feat_doc_updates
Browse files Browse the repository at this point in the history
  • Loading branch information
antalszava authored Mar 14, 2022
2 parents 5ac9b9d + 5a01d59 commit 1314073
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 54 deletions.
6 changes: 3 additions & 3 deletions pennylane/operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,23 +137,23 @@ def expand_matrix(base_matrix, wires, wire_order):
... [5, 6, 7, 8],
... [9, 10, 11, 12],
... [13, 14, 15, 16]])
>>> expand_matrix(base_matrix, wires=[0, 2], wire_order=[0, 2])
>>> print(expand_matrix(base_matrix, wires=[0, 2], wire_order=[0, 2]))
[[ 1 2 3 4]
[ 5 6 7 8]
[ 9 10 11 12]
[13 14 15 16]]
If the wire order is a permutation of ``wires``, the entries of the base matrix get permuted:
>>> expand_matrix(base_matrix, wires=[0, 2], wire_order=[2, 0])
>>> print(expand_matrix(base_matrix, wires=[0, 2], wire_order=[2, 0]))
[[ 1 3 2 4]
[ 9 11 10 12]
[ 5 7 6 8]
[13 15 14 16]]
If the wire order contains wire labels not found in ``wires``, the matrix gets expanded:
>>> expand_matrix(base_matrix, wires=[0, 2], wire_order=[0, 1, 2])
>>> print(expand_matrix(base_matrix, wires=[0, 2], wire_order=[0, 1, 2]))
[[ 1 2 0 0 3 4 0 0]
[ 5 6 0 0 7 8 0 0]
[ 0 0 1 2 0 0 3 4]
Expand Down
4 changes: 2 additions & 2 deletions pennylane/ops/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def compute_eigvals(): # pylint: disable=arguments-differ
**Example**
>>> qml.Identity.compute_eigvals()
>>> print(qml.Identity.compute_eigvals())
[ 1 1]
"""
return np.array([1, 1])
Expand All @@ -83,7 +83,7 @@ def compute_matrix(): # pylint: disable=arguments-differ
**Example**
>>> qml.Identity.compute_matrix()
>>> print(qml.Identity.compute_matrix())
[[1. 0.]
[0. 1.]]
"""
Expand Down
4 changes: 2 additions & 2 deletions pennylane/ops/qubit/arithmetic_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def compute_matrix(): # pylint: disable=arguments-differ
**Example**
>>> qml.QubitCarry.compute_matrix()
>>> print(qml.QubitCarry.compute_matrix())
[[1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0]
Expand Down Expand Up @@ -254,7 +254,7 @@ def compute_matrix(): # pylint: disable=arguments-differ
**Example**
>>> qml.QubitSum.compute_matrix()
>>> print(qml.QubitSum.compute_matrix())
[[1 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0]
[0 0 0 1 0 0 0 0]
Expand Down
Loading

0 comments on commit 1314073

Please sign in to comment.