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

DecomposeClassicalExp() fails for constant conditions #1581

Open
cqc-alec opened this issue Sep 16, 2024 · 0 comments
Open

DecomposeClassicalExp() fails for constant conditions #1581

cqc-alec opened this issue Sep 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working classical-logic issues related to classical logical expressions

Comments

@cqc-alec
Copy link
Collaborator

from pytket import Circuit
from pytket.circuit.logic_exp import BitZero, BitOne
from pytket.passes import DecomposeClassicalExp

circuit = Circuit(1)
circuit.X(0, condition=BitZero())
DecomposeClassicalExp().apply(circuit)

Output:

Traceback (most recent call last):
  File "/home/alec/r/tket/pytket/pytket/circuit/decompose_classical.py", line 334, in _decompose_expressions
    comp_bit = bit_recursive_walk(pred_exp, kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alec/r/tket/pytket/pytket/circuit/decompose_classical.py", line 230, in recursive_walk
    arg1, arg2 = exp.args
    ^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 0)
@cqc-alec cqc-alec added the bug Something isn't working label Sep 16, 2024
@CalMacCQ CalMacCQ added the classical-logic issues related to classical logical expressions label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working classical-logic issues related to classical logical expressions
Projects
None yet
Development

No branches or pull requests

2 participants