Skip to content

Circuit.free_symbols() should not return a set #2160

Description

@xenoicwyce

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions