If I understand correctly, the pointer (of type Gate *) is uniquely determined by the Context object and the GateType value. In this line, the GateType can only be GateType::input_qubit or GateType::input_param. So the resulting hash values for these Ops only have two possible values.
If we want to compare Graphs in different contexts, they will have different hash values because the Context objects are different. Is this intentional? If not, can we simply replace these pointers with gate types in the hash function?
In
Graph::hash()
, we havehttps://github.com/quantum-compiler/quartz/blob/6c0cfd78ac7a09fa66d2dc58fc5cc52a4e970035/src/quartz/tasograph/tasograph.cpp#L441
If I understand correctly, the pointer (of type
Gate *
) is uniquely determined by theContext
object and theGateType
value. In this line, theGateType
can only beGateType::input_qubit
orGateType::input_param
. So the resulting hash values for theseOp
s only have two possible values.If we want to compare
Graph
s in different contexts, they will have different hash values because theContext
objects are different. Is this intentional? If not, can we simply replace these pointers with gate types in the hash function?