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 support for nullary bitwise ops #178

Closed
cqc-alec opened this issue May 17, 2024 · 0 comments · Fixed by #180
Closed

Add support for nullary bitwise ops #178

cqc-alec opened this issue May 17, 2024 · 0 comments · Fixed by #180
Assignees
Labels
enhancement New feature or request

Comments

@cqc-alec
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

The nullary (i.e. constant) bitwise ops ZERO and ONE were added in pytket 1.28.0. Currently they are not handled by pytket_to_phir().

Describe the solution you'd like

Add support for these operations (conditioning on ONE means do the operation, conditioning on ZERO means don't).

Additional context

Example code:

from pytket.circuit import Circuit
from pytket.circuit.logic_exp import BitWiseOp, create_bit_logic_exp
from pytket.phir.api import pytket_to_phir

circ = Circuit(1, 1)
exp = create_bit_logic_exp(BitWiseOp.ONE, [])
circ.H(0, condition=exp)
circ.measure_all()
pytket_to_phir(circ)

This currently gives an Assertion Error.

@cqc-alec cqc-alec added the enhancement New feature or request label May 17, 2024
@qartik qartik self-assigned this May 18, 2024
@qartik qartik removed their assignment May 20, 2024
qartik added a commit that referenced this issue May 24, 2024
@qartik qartik self-assigned this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants