Skip to content

Commit

Permalink
Fix QNSPSA demo (#965)
Browse files Browse the repository at this point in the history
Replace `op.adjoint()` with `qml.adjoint(op)`.
Got error about braket job name being taken, so changed name of job.
  • Loading branch information
mudit2812 authored Oct 27, 2023
1 parent 908b29e commit 65df2a6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions demonstrations/qnspsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ def get_state_overlap(tape):


def get_raw_tensor_metric(params_curr):

dir1 = get_perturbation_direction(params_curr)
dir2 = get_perturbation_direction(params_curr)
perturb1 = dir1 * finite_diff_step
Expand Down Expand Up @@ -874,7 +873,7 @@ def __get_overlap_tape(self, cost, params1, params2):
for op in op_forward:
qml.apply(op)
for op in reversed(op_inv):
op.adjoint()
qml.adjoint(copy(op))
qml.probs(wires=cost.tape.wires.labels)
return tape

Expand Down Expand Up @@ -980,7 +979,7 @@ def __apply_blocking(self, cost, params_curr, params_next):
"spsa_repeats": 25,
}

job_name = f"ref-paper-benchmark-qubit-{n_qubits}"
job_name = f"ref-paper-benchmark-qubit-{n_qubits}-job"
instance_config = InstanceConfig(instanceType="ml.m5.large", volumeSizeInGb=30, instanceCount=1)

job = AwsQuantumJob.create(
Expand Down

0 comments on commit 65df2a6

Please sign in to comment.