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

Add GF2Square bloq for squaring over GF($2^m$) #1441

Merged
merged 7 commits into from
Oct 8, 2024

Conversation

tanujkhattar
Copy link
Collaborator

Part of a larger effort to support galois field arithmetic in qualtran. xref #1419

Currently on top of #1438

@tanujkhattar tanujkhattar changed the title Add GF2Add bloq for squaring over GF($2^m$) Add GF2Square bloq for squaring over GF($2^m$) Oct 6, 2024
Copy link
Collaborator

@mpharrigan mpharrigan left a comment

Choose a reason for hiding this comment

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

lgtm

return QGF(characteristic=2, degree=self.bitsize)

@cached_property
def squaring_matrix(self) -> np.ndarray:
Copy link
Collaborator

Choose a reason for hiding this comment

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

docstring

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

bloq = GF2Square(m)
GFM = GF(2**m)
assert_consistent_classical_action(bloq, x=GFM.elements)

Copy link
Collaborator

Choose a reason for hiding this comment

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

optional test idea: assert cost is only cliffords

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@tanujkhattar tanujkhattar enabled auto-merge (squash) October 7, 2024 23:59
@tanujkhattar tanujkhattar merged commit 4691623 into quantumlib:main Oct 8, 2024
8 checks passed
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.

2 participants