Skip to content

Commit 58b2b9c

Browse files
Zeros for initial weights
1 parent a59cc53 commit 58b2b9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/tfim_vqe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def circuit(weights):
308308
# Step 5: Setup Qrack simulator and calculate energy expectation value
309309
dev = qml.device("qrack.simulator", wires=n_qubits)
310310
circuit, weights_shape = hybrid_tfim_vqe(qubit_hamiltonian, n_qubits)
311-
weights = np.random.randn(*weights_shape["weights"])
311+
weights = np.zeros(weights_shape["weights"])
312312

313313
opt = qml.AdamOptimizer(stepsize=0.1)
314314
for i in range(100):

0 commit comments

Comments
 (0)