feat: Update logical verifier to use Iterable protocol for compatibility with LogicalBlock type - #199
hsemenenko wants to merge 5 commits into
Conversation
CalMacCQ
left a comment
There was a problem hiding this comment.
Looks good, thanks Henry. Just one question that I think is inconsequential really.
| block = state_prep_func() | ||
| state_output("total", block) | ||
| discard_array(block) | ||
| block_arr = array(q for q in block) |
There was a problem hiding this comment.
Is this extra block_arr = array(q for q in block) line just there for explicitness? I notice that the other compute_stabilizers_... type functions are left alone.
There was a problem hiding this comment.
Good catch! This is necessary as state_output does not accept a Guppy struct. The test I've included only checks compute_stabilizers_single_block_state so I did not realise the others that needed changing. I will update the other functions as well and add more tests.
There was a problem hiding this comment.
Okay! Glad I asked then. Yeah in that case we should update the other functions and add corresponding tests
This has highlighted a big issue with using Iterable in the unitary verification which need more thought on how to address.
|
For the unitary tests, the Bell state is prepared as an array. This is incompatible with having an implementation function that expects |
Adds a guppy protocol
_GuppyIterableto avoid naming clashes with PythonIterableand an__iter__method is added toLogicalBlock.