-
Notifications
You must be signed in to change notification settings - Fork 68
apply_right #561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apply_right #561
Conversation
Krastanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feel free to merge after these are addressed if there are no new issues and all tests pass
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #561 +/- ##
==========================================
+ Coverage 84.33% 84.66% +0.33%
==========================================
Files 108 109 +1
Lines 6581 6809 +228
==========================================
+ Hits 5550 5765 +215
- Misses 1031 1044 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Krastanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's have the the other PR merged and potentially have this rebased (or fix the merge conflict in another way)
Left some potential suggestions for fixing the allocation issue (forcing the compiler to move the runtime choice on phases into the type domain), but that is a bit embarrassing (the compiler should be smarter than this)
Feel free to merge after these are addressed (and add changelog) if all tests pass
src/apply_right.jl
Outdated
| new_lrow.phase[] -= 0x1 | ||
| end | ||
| if x | ||
| mul_left!(new_lrow, l_tab_copy, qubit, phases=Val(phases)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| mul_left!(new_lrow, l_tab_copy, qubit, phases=Val(phases)) | |
| mul_left!(new_lrow, l_tab_copy, qubit, phases=B) |
src/apply_right.jl
Outdated
| mul_left!(new_lrow, l_tab_copy, qubit, phases=Val(phases)) | ||
| end | ||
| if z | ||
| mul_left!(new_lrow, l_tab_copy, qubit+n, phases=Val(phases)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| mul_left!(new_lrow, l_tab_copy, qubit+n, phases=Val(phases)) | |
| mul_left!(new_lrow, l_tab_copy, qubit+n, phases=B) |
src/apply_right.jl
Outdated
| end | ||
|
|
||
| """helper for computing the right multiplication of a row of a Clifford operator with another Clifford operator.""" | ||
| @inline function apply_right_row_kernel!(new_lrow, l_tab, row, l_tab_copy, r_tab; phases=true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @inline function apply_right_row_kernel!(new_lrow, l_tab, row, l_tab_copy, r_tab; phases=true) | |
| @inline function apply_right_row_kernel!(new_lrow, l_tab, row, l_tab_copy, r_tab; phases::B=Val{true}()) where {B} |
src/apply_right.jl
Outdated
| threadlocal = l.buffer | ||
| @inbounds for row_r in eachindex(r_tab) | ||
| zero!(threadlocal) | ||
| apply_right_row_kernel!(threadlocal, l_tab, row_r, l_tab_copy, r_tab; phases) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| apply_right_row_kernel!(threadlocal, l_tab, row_r, l_tab_copy, r_tab; phases) | |
| apply_right_row_kernel!(threadlocal, l_tab, row_r, l_tab_copy, r_tab; phases=Val{phases}()) |
4e6af0b to
c7d6f04
Compare
Adds the
apply_right!function into QuantumClifford to apply a Clifford Operator (dense or symbolic) to the right of another clifford operator, modifying it inplace.Changelog:
apply_right!that applies a clifford operator to the right of anotherNotes:
rowswap!(r1, r2),mul_right_ignore_anticommute!(r1, r2)andphase_flip!(r1). There could be macros built that definte the operations from these basic ones.Closes #555
Is a dependency to PR #551
Adaptation of Stim's
prepend_