Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix process-based non-determinism in SparsePauliOp.to_matrix (backport #13439) #13440

Merged
merged 1 commit into from
Nov 14, 2024

Commits on Nov 14, 2024

  1. Fix process-based non-determinism in SparsePauliOp.to_matrix (#13439)

    * Fix process-based non-determinism in `SparsePauliOp.to_matrix`
    
    The simplification step of the summed Pauli terms in
    `SparsePauliOp.to_matrix` had introduced a non-determinism via hash-map
    iteration.  In practice, the base hash seed was set per initialisation
    of the extension module, then stayed the same.  This is hard to detect
    from within tests, but caused unexpected numerical behaviour on
    different invocations of the same script.
    
    * Use ahash::RandomState
    
    ---------
    
    Co-authored-by: Kevin Hartman <kevin@hart.mn>
    (cherry picked from commit 74b32c9)
    jakelishman authored and mergify[bot] committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    d76bba4 View commit details
    Browse the repository at this point in the history