Skip to content

Commit b9f7e0c

Browse files
Update v2 with v1 demonstrations (#1419)
## Summary Update `v2` with/ changes to `v1` demonstrations directory using `qml sync-v2` with @rashidnhm 's recent updates to the demo. --------- Co-authored-by: Andrija Paurevic <46359773+andrijapau@users.noreply.github.com>
1 parent f5518c8 commit b9f7e0c

File tree

1 file changed

+2
-2
lines changed
  • demonstrations_v2/tutorial_iqp_circuit_optimization_jax

1 file changed

+2
-2
lines changed

demonstrations_v2/tutorial_iqp_circuit_optimization_jax/demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,8 @@ def loss_fn(params, circuit, ops, n_samples, key):
552552
# machinery. We can then compare our trained and untrained samples with the ground truth through a
553553
# histogram of the bitstring weights and evaluate the distributions.
554554
#
555-
samples_untrained = circuit.sample(params_init, 1000)
556-
samples_trained = circuit.sample(trainer.final_params, 1000)
555+
samples_untrained = circuit.sample(params_init, shots=1000)
556+
samples_trained = circuit.sample(trainer.final_params, shots=1000)
557557

558558
plt.hist(np.sum(samples_untrained, axis=1), bins=20, range=[0,20], alpha=0.5, label = 'untrained circuit')
559559
plt.hist(np.sum(samples_trained, axis=1), bins=20, range=[0,20], alpha=0.5, label = 'trained circuit')

0 commit comments

Comments
 (0)