XanaduAI / thewalrus

A library for the calculation of hafnians, Hermite polynomials and Gaussian boson sampling.
https://the-walrus.readthedocs.io
Apache License 2.0
99 stars 54 forks source link

n_body_marginals is not symmetric #336

Open ziofil opened 2 years ago

ziofil commented 2 years ago

Before posting a bug report

Expected behavior

The result of n_body_marginals should be a list of n tensors each symmetric under a permutation of the first half and second half of the indices (same permutation). E.g. for a 3-body marginal it should hold that np.allclose(P3, np.transpose(P3, (0,2,1,3,5,4))

Actual behavior

Tensors aren't symmetric

Reproduces how often

always

System information

The Walrus: a Python library for for the calculation of hafnians, Hermite polynomials, and Gaussian boson sampling.
Copyright 2018-2021 Xanadu Quantum Technologies Inc.

Python version:            3.9.7
Platform info:             macOS-12.0.1-arm64-arm-64bit
Installation path:         /Users/filippo/Documents/GitHub/thewalrus/thewalrus
The Walrus version:        0.18.0-dev
Numpy version:             1.21.4
Scipy version:             1.7.3
SymPy version:             1.9
Numba version:             0.53.1

Source code

No response

Tracebacks

No response

Additional information

No response