Skip to content

Commit

Permalink
Update tutorial_adaptive_circuits.py (#935)
Browse files Browse the repository at this point in the history
Fix dimensional issue in `adaptive_cirucits`
Fix issue with complex coeffs in `tapering_demo` (provisional fix)
  • Loading branch information
KetpuntoG authored Sep 21, 2023
1 parent cf0eb1f commit 95a1af8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion demonstrations/tutorial_adaptive_circuits.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def circuit(params):
t1 = time.time()
params, energy = opt.step_and_cost(circuit, params)
t2 = time.time()
print("n = {:}, E = {:.8f} H, t = {:.2f} s".format(n, energy[0], t2 - t1))
print("n = {:}, E = {:.8f} H, t = {:.2f} s".format(n, energy, t2 - t1))

##############################################################################
# Using the sparse method reproduces the ground state energy while the optimization time is
Expand Down
1 change: 1 addition & 0 deletions demonstrations/tutorial_qubit_tapering.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
# eigenvalues.

H_tapered = qml.taper(H, generators, paulixops, paulix_sector)
H_tapered = qml.Hamiltonian(np.real(H_tapered.coeffs), H_tapered.ops)
print(H_tapered)

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

0 comments on commit 95a1af8

Please sign in to comment.