Skip to content

Commit

Permalink
fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
drelu committed Aug 20, 2024
1 parent e87ee25 commit 46f835b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/pq_ray_qml_slurm_perlmutter.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ def fit_circuit_to_target():

wires = 11
layers = 2
# dev = qml.device('default.qubit', wires=wires)
dev = qml.device('default.qubit', wires=wires)

# @qml.qnode(dev)
# def circuit(parameters):
# parameters = parameters.reshape((layers, wires, 3))
# qml.StronglyEntanglingLayers(weights=parameters, wires=range(wires))
# return qml.state()
@qml.qnode(dev)
def circuit(parameters):
parameters = parameters.reshape((layers, wires, 3))
qml.StronglyEntanglingLayers(weights=parameters, wires=range(wires))
return qml.state()

def loss_fn(params, target):
return 1 - np.sum(np.abs(target.conj() * circuit(params)))
Expand Down

0 comments on commit 46f835b

Please sign in to comment.