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

Support bit_not for Bool type #2076

Merged
merged 5 commits into from
Mar 25, 2024
Merged

Conversation

hhorii
Copy link
Collaborator

@hhorii hhorii commented Feb 27, 2024

Summary

This PR is to support bit_not for Bool values.

Details and comments

bit_not is defined for Uint values. However, in other language, depending hardware, Bool values can be applied as logical_not (False is 0 and True is 1). This PR supports such implicit operations for only "bit_not".

@hhorii hhorii added this to the Aer 0.14.0 milestone Feb 27, 2024
@jakelishman
Copy link
Member

Ed Chen pointed out to me that bit_xor (and I would guess bit_or) has the same problem - not supported on Terra's pseudo Bool/bit type in Aer. Can we make bit_xor, bit_or and bit_and work on bit/bools as well?

@doichanj doichanj mentioned this pull request Mar 18, 2024
@hhorii
Copy link
Collaborator Author

hhorii commented Mar 22, 2024

@jakelishman Thank you for your comments.
I have added a test case to check bit_xor works Bool ^ Bool -> Bool and Uint ^ Uint -> Uint cases (I believe that Bool ^ Uint is not allowed in Qiskit). I think current implementation covers these operation. Could you tell what cases Ed Chen wants?

https://github.com/Qiskit/qiskit-aer/pull/2076/files#diff-d43cca4f2db1daf52abcc25296f734a5af2a4f30b6423f9665d33bf217efc936R1180-R1238

@doichanj doichanj merged commit 1e01a47 into Qiskit:main Mar 25, 2024
36 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.

3 participants