We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
SetBits
from pytket.circuit import Bit, Circuit from pytket.qasm import circuit_to_qasm_str c = Circuit(0, 3) c.add_c_setbits(values=[True, True], args=[Bit(1), Bit(2)], condition=Bit(0)) print(c.get_commands()) print("======") print(circuit_to_qasm_str(c, header="hqslib1"))
Output:
[IF ([c[0]] == 1) THEN SetBits(11) c[1], c[2];] ====== OPENQASM 2.0; include "hqslib1.inc"; creg c[3]; if(c[0]==1) c[1] = 1; c[2] = 1;
The text was updated successfully, but these errors were encountered:
This issue seems to be affecting other classical gates, for example
c = Circuit(0, 5) c.add_c_copybits(args_in=[Bit(1), Bit(2)], args_out=[Bit(3), Bit(4)], condition=Bit(0)) qasm = circuit_to_qasm_str(c, header="hqslib1")
and a different error I get from
set_bits = SetBitsOp([True, True, False]) multi_bit = MultiBitOp(set_bits, 2) c = Circuit(0, 7) c.add_gate(multi_bit, [0, 1, 2, 3, 4, 5], condition=Bit(6)) qasm = circuit_to_qasm_str(c, header="hqslib1")
Sorry, something went wrong.
A more concerning example
range_predicate = RangePredicateOp(6, 27, 27) c = Circuit(0, 8) c.add_gate(range_predicate, [0, 1, 2, 3, 4, 5, 6], condition=Bit(7)) qasm = circuit_to_qasm_str(c, header="hqslib1")
OPENQASM 2.0; include "hqslib1.inc"; creg c[8]; if(c[7]==1) if(c==27) c[6] = 1; if(c!=27) c[6] = 0;
RangePredicate
yao-cqc
Successfully merging a pull request may close this issue.
Output:
The text was updated successfully, but these errors were encountered: