Skip to content
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

better bit-wrangling abstraction using less boilerplate #367

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Fe-r-oz
Copy link
Contributor

@Fe-r-oz Fe-r-oz commented Sep 23, 2024

I have also checked that this does not introduce any JET errors. Hopefully, this is closes #113!

  • The code is properly formatted and commented.
  • Substantial new functionality is documented within the docs.
  • All new functionality is tested.
  • All of the automated tests on github pass.

Copy link
Member

@Krastanov Krastanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wonderful!

There are quite a few more places where this is used though:

  • apply_noise.jl
  • pauli_operator.jl
  • project_trace_reset.jl
  • QuantumClifford.jl
  • symbolic_clifford.jl

Not all of them necessarily need to change, maybe what is done here is appropriate to only some for them.

While this is a big step towards fixing #113, I do not think it is sufficient to call it a fix. It is way less boilerplate, but it still has some amount of boilerplate. But we should merge it before worrying about improving it further -- this will already be pretty useful.

src/pauli_frames.jl Outdated Show resolved Hide resolved
src/pauli_frames.jl Show resolved Hide resolved
src/pauli_frames.jl Show resolved Hide resolved
@Fe-r-oz Fe-r-oz marked this pull request as draft September 26, 2024 21:24
@Fe-r-oz Fe-r-oz changed the title fix #113 - better bit-wrangling abstraction better bit-wrangling abstraction using less boilerplate Sep 28, 2024
@Fe-r-oz
Copy link
Contributor Author

Fe-r-oz commented Sep 28, 2024

Thank you for highlighting all the files. I have carefully made the changes at appropriate places. Please do cross check them again as these bit masks are used in the critical places. Since .xz is an unsighed vector for paulis and .xzs is unsighed matrix for stabs, using AbstractArray{<:Unsighed} helps cover these two cases. Although, UInt64 is used, but I have kept to Unsighed as in some places when Unsighed was used for type of Tₘ.

I think the PR is ready for review. Thank you.

Copy link

codecov bot commented Oct 28, 2024

Codecov Report

Attention: Patch coverage is 82.85714% with 6 lines in your changes missing coverage. Please review.

Project coverage is 82.65%. Comparing base (f3eb7cd) to head (6c4c659).

Files with missing lines Patch % Lines
ext/QuantumCliffordGPUExt/apply_noise.jl 0.00% 2 Missing ⚠️
ext/QuantumCliffordGPUExt/pauli_frames.jl 0.00% 2 Missing ⚠️
src/pauli_frames.jl 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #367      +/-   ##
==========================================
+ Coverage   82.42%   82.65%   +0.22%     
==========================================
  Files          70       70              
  Lines        4580     4554      -26     
==========================================
- Hits         3775     3764      -11     
+ Misses        805      790      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Fe-r-oz
Copy link
Contributor Author

Fe-r-oz commented Oct 31, 2024

P.S. This will be beneficial for #411, as it streamlines several areas by reducing boilerplate code, including in pauli_frames.jl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

better bit-wrangling abstraction
2 participants