The method pytket.Circuit.free_symbols() should either return a list or a tuple (ordered iterables) instead of a set. When iterating a set, the order is different for every new instance of Python, causing inconsistent assignment of parameter values to the symbols. When assigning parameters using Circuit.symbol_substitution(), the users usually zip the free_symbols() and an array of parameter values to be assigned. But since the order of the symbols are not fixed, it will assign to different parameters given the same array.
The method
pytket.Circuit.free_symbols()should either return a list or a tuple (ordered iterables) instead of a set. When iterating a set, the order is different for every new instance of Python, causing inconsistent assignment of parameter values to the symbols. When assigning parameters usingCircuit.symbol_substitution(), the users usually zip thefree_symbols()and an array of parameter values to be assigned. But since the order of the symbols are not fixed, it will assign to different parameters given the same array.