Repository navigation
feat: Add primitives for the toy_k2 architecture - #315
Conversation
hsemenenko
left a comment
There was a problem hiding this comment.
Thanks Pablo, this looks great. Most comments are about naming.
toy_k2 architecture primitives and their teststoy_k2 architecture
8259757 to
a73cd37
Compare
33807bc to
4d9e07e
Compare
d60566a to
006a3ec
Compare
b195f19 to
342b3e4
Compare
hsemenenko
left a comment
There was a problem hiding this comment.
I think one bug needs addressing. I'll look at the rest of the stack which should give me a better idea of whether replacing the array with tuple is worthwhile.
a893a66 to
d407c49
Compare
| @guppy | ||
| @no_type_check | ||
| def impl_func(arr: array[qubit, 4]) -> None: | ||
| block = LogicalBlock(array(arr.take(i) for i in range(4))) |
There was a problem hiding this comment.
The verifier has been updated to support LogicalBlock directly, so these helpers are no longer necessary.
See: #199
| if idx != 0 and idx != 1: | ||
| exit("Invalid logical qubit index. Must be 0 or 1.") |
There was a problem hiding this comment.
These statements could be extracted into a function call.
|
|
||
| @guppy | ||
| @no_type_check | ||
| def x(blk: LogicalBlock[4], idx: int) -> None: |
There was a problem hiding this comment.
This is kind of why I do not like use of LogicalBlock in its current form. The generic parameter 4 suggests to me that there are 4 logical qubits stored in the block, which afaik is not the case here. Instead, it is 4 physical qubits.
I think it should either be renamed or removed. But currently its just confusing. Not something to do in this PR though.
There was a problem hiding this comment.
This is a fair criticism. We could include all code parameters in the struct i.e. LogicalBlock[n,k,d]. This is quite verbose but would at least be explicit.
Alternatively, I wonder if using type-level arithmetic would allow us to just have LogicalBlock[k] and then compute n and d.
1f02a09 to
6263961
Compare
Co-authored-by: Pablo Andres-Martinez <104848389+PabloAndresCQ@users.noreply.github.com>
2228003 to
7b80459
Compare
toy_k2 architecturetoy_k2 architecture
Closes #241
Closes #242