Skip to content

Commit

Permalink
Merge branch 'stable/0.3' into mergify/bp/stable/0.3/pr-173
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed May 6, 2024
2 parents 3ed54f8 + 040e9af commit 4d8eeec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions qiskit_algorithms/gradients/reverse/derive_circuit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of a Qiskit project.
#
# (C) Copyright IBM 2022, 2023.
# (C) Copyright IBM 2022, 2024.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand Down Expand Up @@ -148,7 +148,7 @@ def derive_circuit(
gradient = []
for product_rule_term in itertools.product(*summands):
summand_circuit = QuantumCircuit(*circuit.qregs)
c = 1
c = complex(1)
for i, term in enumerate(product_rule_term):
c *= term[0]
summand_circuit.data.append([term[1], *op_context[i]])
Expand Down
6 changes: 4 additions & 2 deletions test/test_amplitude_estimators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of a Qiskit project.
#
# (C) Copyright IBM 2018, 2023.
# (C) Copyright IBM 2018, 2024.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand Down Expand Up @@ -47,7 +47,9 @@ def __init__(self, probability):
self.angle = 2 * np.arcsin(np.sqrt(probability))
self.ry(2 * self.angle, 0)

def power(self, power, matrix_power=False):
# Disable for pylint needed for Qiskit < 1.1.0 where annotated does not exist
# pylint: disable=unused-argument
def power(self, power, matrix_power=False, annotated: bool = False):
if matrix_power:
return super().power(power, True)

Expand Down

0 comments on commit 4d8eeec

Please sign in to comment.