Skip to content

Commit

Permalink
Fix test by adding a cast.
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Schweitz <[email protected]>
  • Loading branch information
schweitzpgi committed Nov 6, 2024
1 parent a7fbae6 commit 06c57c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/cudaq/Optimizer/Dialect/CC/CCTypes.td
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ def cc_StructType : CCType<"Struct", "struct",
let extraClassDeclaration = [{
// O(1)
bool isEmpty() const { return getMembers().empty(); }

// O(n)
std::size_t getNumMembers() const { return getMembers().size(); }

Type getMember(unsigned position) { return getMembers()[position]; }
}];
}
Expand Down
6 changes: 3 additions & 3 deletions python/tests/kernel/test_observe_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,7 @@ def test_pack_args_pauli_list():
def generateRandomPauliStrings(numQubits, numPaulis):
s = ['X', 'Y', 'Z', 'I']
return [
''.join([random.choice(s)
for i in range(numQubits)])
''.join([random.choice(s) for i in range(numQubits)])
for i in range(numPaulis)
]

Expand Down Expand Up @@ -336,7 +335,8 @@ def gqeCirc2(N: int, thetas: list[float], paulis: list[cudaq.pauli_word]):
ts = np.random.rand(len(pauliStings))

exp_val1 = cudaq.observe_async(gqeCirc1, obs, numQubits, list(ts),
pauliStings[0]).get().expectation()
cudaq.pauli_word(
pauliStings[0])).get().expectation()
print('observe_async exp_val1', exp_val1)
exp_val2 = cudaq.observe_async(gqeCirc2, obs, numQubits, list(ts),
pauliStings).get().expectation()
Expand Down

0 comments on commit 06c57c7

Please sign in to comment.