toqito.perms.unique_perms ========================= .. py:module:: toqito.perms.unique_perms .. autoapi-nested-parse:: Unique permutations is used to calculate the unique permutations of a list/vector and their count. Module Contents --------------- .. py:class:: UniqueElement Class for unique elements to keep track of occurrences. .. py:attribute:: value :type: int .. py:attribute:: occurrences :type: int .. py:function:: unique_perms(elements) Determine the number of unique permutations of a list. .. rubric:: Examples Consider the following vector \[ \left[1, 1, 2, 2, 1, 2, 1, 3, 3, 3\right]. \] The number of possible permutations possible with the above vector is \(4200\). This can be obtained using the `|toqito⟩` package as follows. ```python exec="1" source="above" from toqito.perms import unique_perms vec_nums = [1, 1, 2, 2, 1, 2, 1, 3, 3, 3] print(len(list(unique_perms(vec_nums)))) ``` :param elements: List of integers. :returns: The number of possible permutations possible. .. py:function:: perm_unique_helper(list_unique, result_list, elem_d) Provide helper function for unique_perms. :param list_unique: list[UniqueElement] :param result_list: list[int] :param elem_d: int