def assertCommutationSet(self, result, expected):
result_to_compare = {}<EOL>for qbit_str, sets in result.items():<EOL><INDENT>if not isinstance(qbit_str, str):<EOL><INDENT>continue<EOL><DEDENT>result_to_compare[qbit_str] = []<EOL>for commutation_set in sets:<EOL><INDENT>result_to_compare[qbit_str].append(<EOL>sorted([node._node_id for node in commutation_set]))<EOL><DEDENT><DEDENT>for qbit_str, sets in expected.items():<EOL><INDENT>for commutation_set in sets:<EOL><INDENT>commutation_set.sort()<EOL><DEDENT><DEDENT>self.assertDictEqual(result_to_compare, expected)<EOL>
Compares the result of propertyset["commutation_set"] with a dictionary of the form
        {'q[0]': [ [node_id, ...], [node_id, ...] ]}