Skip to content

Commit

Permalink
simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
t-imamichi committed Nov 11, 2024
1 parent bd3c2b8 commit ff75fe4
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions test/unit/test_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,21 +302,16 @@ def test_rzz_validates_only_for_fixed_angles(self):
"""Verify that the rzz validation occurs only when the angle is a number, and not a
parameter"""
backend = FakeFractionalBackend()
param = Parameter("p")

with self.subTest("parameter"):
param = Parameter("p")

circ = QuantumCircuit(2)
circ.rzz(param, 0, 1)

# Should run without an error
SamplerV2(backend).run(pubs=[(circ, [1])])

with self.subTest("parameter expression"):
param = Parameter("p")

circ = QuantumCircuit(2)
circ.rzz(2 * param, 0, 1)

# Should run without an error
SamplerV2(backend).run(pubs=[(circ, [1])])
SamplerV2(backend).run(pubs=[(circ, [0.5])])

0 comments on commit ff75fe4

Please sign in to comment.