Skip to content

Commit

Permalink
Merge branch 'sym' of github.com:qiboteam/qiboml into sym
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoRobbiati committed May 17, 2024
2 parents a582cd3 + 26f6d8e commit b97edae
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/qiboml/operations/differentiation.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,17 @@ def parameter_shift(
with respect to circuit's variational parameters.
"""
nparams = len(circuit.get_parameters())
gradient = []

for i in range(nparams):
gradient.append(
_one_parameter_shift(
return [
_one_parameter_shift(
hamiltonian=hamiltonian,
circuit=circuit,
parameter_index=i,
initial_state=initial_state,
nshots=nshots,
exec_backend=exec_backend,
)
)

return gradient
for i in range(len(circuit.get_parameters()))
]


def symbolical(
Expand Down

0 comments on commit b97edae

Please sign in to comment.