Copied from qBraid/qBraid #789
After calling unregister_program_type("qasm2"), the program type "qasm2" is removed from QPROGRAM_REGISTRY, but it is still included in the ConversionGraph. This leads to inconsistent behavior where "qasm2" is no longer recognized in the registry but still exists as a node in a new instance of ConversionGraph.
To reproduce:
from qbraid import QPROGRAM_REGISTRY, ConversionGraph, unregister_program_type
print("qasm2" in QPROGRAM_REGISTRY) # True
graph = ConversionGraph()
print(graph.has_node("qasm2")) # True
unregister_program_type("qasm2")
print("qasm2" in QPROGRAM_REGISTRY) # False
new_graph = ConversionGraph()
print(new_graph.has_node("qasm2")) # True, but should be False
After unregistering "qasm2", it should not be present in new instances of ConversionGraph. It should be a requirement that all "nodes" in the ConversionGraph are "registered" program types.
Note: The "qasm2" alias was just used as an example. This issue is applicable to all program types. The solution you propose should generalize to all program types.
Copied from qBraid/qBraid #789
After calling
unregister_program_type("qasm2"), the program type"qasm2"is removed fromQPROGRAM_REGISTRY, but it is still included in theConversionGraph. This leads to inconsistent behavior where"qasm2"is no longer recognized in the registry but still exists as a node in a new instance ofConversionGraph.To reproduce:
After unregistering
"qasm2", it should not be present in new instances ofConversionGraph. It should be a requirement that all "nodes" in theConversionGraphare "registered" program types.Note: The "qasm2" alias was just used as an example. This issue is applicable to all program types. The solution you propose should generalize to all program types.