Skip to content

Commit

Permalink
add index and pop tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jcjaskula-aws committed Nov 21, 2023
1 parent 31a60f8 commit 0b02f14
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/unit_tests/braket/circuits/test_basis_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,13 @@ def test_as_props(basis_state_input, size, as_tuple, as_int, as_string):
)
def test_indexing(basis_state_input, index, substate_input):
assert BasisState(basis_state_input)[index] == BasisState(substate_input)


def test_index():
assert BasisState("1010").index(0) == 1


def test_pop():
basis_state = BasisState("1010", 4)
assert basis_state.pop(1) == 0
assert basis_state == BasisState("110", 3)

0 comments on commit 0b02f14

Please sign in to comment.