Skip to content

Commit

Permalink
reverted differentiator tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zaqqwerty committed May 3, 2020
1 parent 74537b2 commit 05bf100
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ def test_analytic_functional(self, diff):
def test_sampled_functional(self, diff):
"""Test that the differentiate_sampled function WORKS."""
differentiable_op = diff.generate_differentiable_op(
sampled_op=circuit_execution_ops.get_sampled_expectation_op(
backend=cirq.Simulator()))
sampled_op=circuit_execution_ops.get_sampled_expectation_op()
circuit, names, values, ops, n_samples, true_f, true_g = \
_simple_op_inputs()
with tf.GradientTape() as g:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ def test_parameter_shift_sampled(self):
_simple_op_inputs()
ps = parameter_shift.ParameterShift()
op = ps.generate_differentiable_op(
sampled_op=circuit_execution_ops.get_sampled_expectation_op(
backend=cirq.Simulator()))
sampled_op=circuit_execution_ops.get_sampled_expectation_op())

with tf.GradientTape() as g:
g.watch(values)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ def test_stochastic_differentiator_call_sampled(self, coordinate, generator,
diff = stochastic_differentiator.SGDifferentiator(
coordinate, generator, cost, uniform)
op = diff.generate_differentiable_op(
sampled_op=circuit_execution_ops.get_sampled_expectation_op(
backend=cirq.Simulator()))
sampled_op=circuit_execution_ops.get_sampled_expectation_op())

with tf.GradientTape() as g:
g.watch(values)
Expand Down

0 comments on commit 05bf100

Please sign in to comment.