Skip to content
This repository was archived by the owner on Dec 7, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions test/aqua/operators/test_aer_pauli_expectation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
# (C) Copyright IBM 2018, 2021.
#
# 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 @@ -165,7 +165,10 @@ def generate_parameters(num):
def validate_sampler(ideal, sut, param_bindings):
expect_sampled = ideal.convert(expect_op, params=param_bindings).eval()
actual_sampled = sut.convert(expect_op, params=param_bindings).eval()
self.assertAlmostEqual(actual_sampled, expect_sampled, delta=.1)
self.assertTrue(
np.allclose(actual_sampled, expect_sampled),
"%s != %s" % (actual_sampled, expect_sampled),
)

def get_circuit_templates(sampler):
return sampler._transpiled_circ_templates
Expand Down
8 changes: 2 additions & 6 deletions test/aqua/operators/test_gradients.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019, 2020.
# (C) Copyright IBM 2019, 2021.
#
# 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 All @@ -19,7 +19,6 @@

import numpy as np
from ddt import ddt, data, idata, unpack
from sympy import Symbol, cos

try:
import jax.numpy as jnp
Expand Down Expand Up @@ -279,10 +278,7 @@ def test_state_gradient3(self, method):
a = Parameter('a')
# b = Parameter('b')
params = a
x = Symbol('x')
expr = cos(x) + 1
c = ParameterExpression({a: x}, expr)

c = np.cos(a) + 1
q = QuantumRegister(1)
qc = QuantumCircuit(q)
qc.h(q)
Expand Down