Skip to content

Commit

Permalink
Merge branch 'dev' into pietro_patch_1
Browse files Browse the repository at this point in the history
  • Loading branch information
PietropaoloFrisoni authored Jan 13, 2025
2 parents f0c0b38 + b5b4de0 commit 8bc28d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion demonstrations/tutorial_liesim_extension.metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}
],
"dateOfPublication": "2024-06-18T00:00:00+00:00",
"dateOfLastModification": "2024-10-07T00:00:00+00:00",
"dateOfLastModification": "2025-01-13T00:00:00+00:00",
"categories": [
"Quantum Computing",
"Quantum Machine Learning"
Expand Down
6 changes: 4 additions & 2 deletions demonstrations/tutorial_liesim_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def TFIM(n):
#
# For that, let us construct a concrete example. First we pick two elements from :math:`\mathfrak{g}` such that their product is not in :math:`\mathfrak{g}.`

p = dla[-5] @ dla[-2]
p = dla[-5] @ dla[-1]
p = next(iter(p)) # strip any scalar coefficients
dla_vspace = qml.pauli.PauliVSpace(dla, dtype=complex)
dla_vspace.is_independent(p.pauli_rep)
Expand Down Expand Up @@ -414,9 +414,11 @@ def Moment_step(ops, dla):
#
# We can now choose arbitrary DLA gates and a maximum of `one` :math:`P` gate to evolve the expectation value vector.

P_index = Moment[comp_moment].index(1.*p) # pick the gate in the Moment space that p corresponds to

e_t = e_in
e_t = expm(0.5 * adjoint_repr[dim_g-1]) @ e_t # the same U gate
e_t = expm(0.5 * adjoint_repr[74]) @ e_t # the same P gate
e_t = expm(0.5 * adjoint_repr[P_index]) @ e_t # the same P gate
e_t = expm(0.5 * adjoint_repr[dim_g-2]) @ e_t # the same V gate

##############################################################################
Expand Down

0 comments on commit 8bc28d6

Please sign in to comment.