Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daxfohl committed Mar 2, 2025
1 parent c2c94d0 commit 6a9b7d1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cirq-core/cirq/devices/grid_qubit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,10 @@ def test_numpy_index():
assert q.col == 6
assert q.dimension == 3
assert isinstance(q.dimension, int)


def test_non_integer_index():
q = cirq.GridQubit(5.5, 6.5)
hash(q) # doesn't throw
assert q.row == 5.5
assert q.col == 6.5
5 changes: 5 additions & 0 deletions cirq-core/cirq/devices/line_qubit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,3 +300,8 @@ def test_numpy_index():
assert q.x == 5
assert q.dimension == 3
assert isinstance(q.dimension, int)


def test_non_integer_index():
q = cirq.LineQubit(5.5)
assert q.x == 5.5

0 comments on commit 6a9b7d1

Please sign in to comment.