-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Information
- Qiskit Terra version: 0.18.0.dev0+f6b2c43
- Python version: 3.7
What is the current behavior?
The PR #6018 enables classical conditioning of gates on individual bits. However, as mentioned in that PR, this new feature breaks the following functions:
- Condition value validation required. Currently only the non-negativity condition of the condition value is checked. So, passing on any float or Boolean (for creg) also get accepted as a valid condition value which is not quite right. Also, bit length of the condition value is also not checked i.e., passing a
m
bit integer as the condition value for condition on a creg ofn
classical bits (wherem>n
) does not raise error . - All the drawers break when trying to draw a circuit that contains gates with classical conditioning on a single cbit. ( PR in review. Check Text drawer extended for drawing circuits with single classical bit conditioning #6261 , Latex drawer extended for drawing circuits with single classical bit conditioning #6248 and MPL drawer extended for drawing circuits with single classical bit conditioning #6259 )
-
qc.qasm()
breaks when circuitqc
contains gates with classical conditioning on a single cbit. -
qc.depth()
also breaks. Refer to Classical conditioning on individual classical bits now supported #6018 (comment) ( Fixed in Fixed error in qc.depth() when using on circuits with single bit classical conditions #6476 ) -
disassemble(qc_assembled)
breaks whereqc_assembled
is an assembledQobj
. (PR in review. Check Fixed diassembler for circuits containing single bit conditioned gates #6989 .) -
qc.num_connected_components
breaks. ( Fixed in Fixed qc.num_connected_components() for circuits with bit conditioned gates #6564.) -
circuit_to_instruction(qc)
breaks. (PR in review Fixes circuit_to_instruction() method for circuits containing single bit conditions #6537.) -
_check_wires_list()
andsubstitute_node_with_dag()
methods in qiskit/dagcircuit/dagcircuit.py break. -
_is_same_c_conf()
method inForwardMatch
andBackwardMatch
classes in qiskit/transpiler/passes/optimization/template_matching breaks. -
run()
method inConsolidateBlocks
class in qiskit/transpiler/passes/optimization breaks. - qpy serialization support (PR in review Handle single bit conditions in QPY #6775)
Suggested solutions
The fixes should be simple. Need to look for parts that have ClassicalRegister
in condition in these functions and extend them also to cases when Clbit
is in condition.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working