-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
We pack the bits representing the tableau in UInts and use bit-wise operations on them.
The library is set to support any sized UInt8/16/..., but we usually just use the default one.
There are a few tests that make sure that other sizes are still suported though (e.g. bitpacking and ecc_syndromes).
It would be useful to create the appropriate methods of reinterpret so that such tests are easier to write.
Here are some untested draft implementations (not a particularly good API design either):
using QuantumClifford: Tableau
reinterpret_frame(frame) = PauliFrame(reinterpret_stab(frame.frame), copy(frame.measurements))
reinterpret_stab(s) = Stabilizer(Tableau(copy(phases(s)), nqubits(s), collect(reinterpret(UInt8, collect(s.tab.xzs)))[[1:1+(nqubits(s)-1)÷8;end÷2+1:end÷2+1+(nqubits(s)-1)÷8],:]))
reinterpret_p(p) = PauliOperator(p.phase, nqubits(p), collect(reinterpret(UInt8, p.xz))[[1:1+(nqubits(p)-1)÷8;end÷2+1:end÷2+1+(nqubits(p)-1)÷8]])
This is also of great use when considering GPU code. (there should be "See also" entries to fastcolumn and fastrow and tocpu and togpu).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers