Skip to content

Commit

Permalink
Update tutorial_lcu_blockencoding.py (#1122)
Browse files Browse the repository at this point in the history
In the block encoding example from [this
demo](https://pennylane.ai/qml/demos/tutorial_lcu_blockencoding/), the
resulting matrix does not appear correctly.
This PR solves the problem.
  • Loading branch information
KetpuntoG authored May 31, 2024
1 parent 94563bf commit a9151f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion demonstrations/tutorial_lcu_blockencoding.metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
],
"dateOfPublication": "2023-10-25T00:00:00+00:00",
"dateOfLastModification": "2024-05-13T00:00:00+00:00",
"dateOfLastModification": "2024-05-31T00:00:00+00:00",
"categories": [
"Algorithms",
"Quantum Computing"
Expand Down
2 changes: 1 addition & 1 deletion demonstrations/tutorial_lcu_blockencoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def lcu_circuit(): # block_encode
return qml.state()


output_matrix = qml.matrix(lcu_circuit, wire_order=[0, "ancilla"])()
output_matrix = qml.matrix(lcu_circuit, wire_order=["ancilla", 0])()
print("Block-encoded projector:\n")
print(np.real(np.round(output_matrix,2)))

Expand Down

0 comments on commit a9151f6

Please sign in to comment.