XanaduAI / MrMustard

A differentiable bridge between phase space and Fock space
https://mrmustard.readthedocs.io/
Apache License 2.0
78 stars 27 forks source link

Incorrect marginal resolution in visualize_2d #415

Open JacobHast opened 5 months ago

JacobHast commented 5 months ago

Before posting a bug report

Expected behavior

When setting xbounds, pbounds and resolution of visualize_2d I expect the marginal distributions to use these values.

Actual behavior

The marginal distributions ignore the values in xbounds, pbounds and resolution

Reproduces how often

100 %

System information

Mr Mustard: a differentiable bridge between phase space and Fock space.
Copyright 2021 Xanadu Quantum Technologies Inc.

Python version:            3.9.19
Platform info:             Windows-10-10.0.19045-SP0
Installation path:         
c:\Users\jacob\miniconda3\envs\mrmustard_dev\lib\site-packages\mrmustard
Mr Mustard version:        0.7.3
Numpy version:             1.26.4
Numba version:             0.59.1
Scipy version:             1.13.1
The Walrus version:        0.19.0
TensorFlow version:        2.16.1

Source code

No response

Tracebacks

No response

Additional information

No response

timmysilv commented 5 months ago

can you provide a source code snippet to reproduce this? they seem to work fine for me: image

JacobHast commented 5 months ago

Here, I only have 6 points on the quadratures even though I set the resolution to 500: image

JacobHast commented 5 months ago

So it's just the resolution that's not respected, the bounds are. Though looking at the source, it seems like the quadratures are calculated completely independently of the bounds and resolution, and then cut off to match