openfermion.linalg.generate_parity_permutations
Generates the permutations and sign of a sequence by constructing a tree where the nth level contains all n-permutations of m (n < m) objects.
openfermion.linalg.generate_parity_permutations(
seq
)
At the last level where n == m all permutations are generated. The sign
is kept updated by determining where the next number is inserted into the
current leaf's set of numbers.
Example |
Constructing the permutations of the sequence [A, B, C] constructs the
following tree:
[[(A, +1)], [(AB, +1), (BA, -1)], [(ABC, +1), (ACB, -1), (CAB, +1],
[(BAC, -1), (BCA, +1), (CBA, -1)]]
|
Args |
seq
|
a sequence of a string to provide permutations
|
returns:
a permutation list with the elements of the seq permuted and a sign
associated with the permutation.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[]]