Skip to content

Commit 8bc28d6

Browse files
Merge branch 'dev' into pietro_patch_1
2 parents f0c0b38 + b5b4de0 commit 8bc28d6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

demonstrations/tutorial_liesim_extension.metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
}
77
],
88
"dateOfPublication": "2024-06-18T00:00:00+00:00",
9-
"dateOfLastModification": "2024-10-07T00:00:00+00:00",
9+
"dateOfLastModification": "2025-01-13T00:00:00+00:00",
1010
"categories": [
1111
"Quantum Computing",
1212
"Quantum Machine Learning"

demonstrations/tutorial_liesim_extension.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def TFIM(n):
133133
#
134134
# 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}.`
135135

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

417+
P_index = Moment[comp_moment].index(1.*p) # pick the gate in the Moment space that p corresponds to
418+
417419
e_t = e_in
418420
e_t = expm(0.5 * adjoint_repr[dim_g-1]) @ e_t # the same U gate
419-
e_t = expm(0.5 * adjoint_repr[74]) @ e_t # the same P gate
421+
e_t = expm(0.5 * adjoint_repr[P_index]) @ e_t # the same P gate
420422
e_t = expm(0.5 * adjoint_repr[dim_g-2]) @ e_t # the same V gate
421423

422424
##############################################################################

0 commit comments

Comments
 (0)