fix the tests after Terra
@@ -658,7 +658,7 @@ class TestGradients(QiskitAquaTestCase):
return grad
qc = RealAmplitudes(2, reps=1)
- grad_op = ListOp([StateFn(qc)], combo_fn=combo_fn, grad_combo_fn=grad_combo_fn)
+ grad_op = ListOp([StateFn(qc.decompose())], combo_fn=combo_fn, grad_combo_fn=grad_combo_fn)
grad = Gradient(grad_method=method).convert(grad_op, qc.ordered_parameters)
value_dict = dict(zip(qc.ordered_parameters, np.random.rand(len(qc.ordered_parameters))))
correct_values = [[(-0.16666259133549044+0j)], [(-7.244949702732864+0j)],
@@ -687,7 +687,7 @@ class TestGradients(QiskitAquaTestCase):
return grad
qc = RealAmplitudes(2, reps=1)
- grad_op = ListOp([StateFn(qc)], combo_fn=combo_fn, grad_combo_fn=grad_combo_fn)
+ grad_op = ListOp([StateFn(qc.decompose())], combo_fn=combo_fn, grad_combo_fn=grad_combo_fn)
grad = NaturalGradient(grad_method='lin_comb', regularization='ridge'
).convert(grad_op, qc.ordered_parameters)
value_dict = dict(
