Skip to content

Add BitwiseNot #1161

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

Merged
merged 3 commits into from
Jul 19, 2024
Merged

Add BitwiseNot #1161

merged 3 commits into from
Jul 19, 2024

Conversation

anurudhp
Copy link
Contributor

No description provided.

@anurudhp anurudhp enabled auto-merge (squash) July 19, 2024 17:15
@anurudhp anurudhp merged commit 85c1dab into quantumlib:main Jul 19, 2024
7 checks passed
@anurudhp anurudhp deleted the 2024/07/18-bitwise-not branch July 19, 2024 17:50
@NoureldinYosri
Copy link
Contributor

why do we need this when we have XorK?

@anurudhp
Copy link
Contributor Author

why do we need this when we have XorK?

Just a convenient bloq to use instead of the less readable XorK(dtype, -1) or XorK(dtype, 2**bitsize-1). And also avoids the detour of computing bits(k) etc.

@NoureldinYosri
Copy link
Contributor

Just a convenient bloq to use instead of the less readable

class XorK:
    ...

    @staticmethod
    def bitwise_not(dtype):
        return ...

@tanujkhattar
Copy link
Collaborator

I support having an additional Bloq instead of delagating to XorK. It would also be more readable in diagrams. Classical programming languages also have both Xor and - operators defined, even though one could always write a ^ 2**size - 1 instead of ~a.

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

Successfully merging this pull request may close these issues.

4 participants