Skip to content

AUTOSHAPE for fock states #490

@JacobHast

Description

@JacobHast

Before posting a bug report

  • I have searched exisisting GitHub issues to make sure the issue does not already exist.

Expected behavior

I expect the application of Gaussian operations on state in the Fock representation to apply suitable cutoffs based on the AUTOSHAPE settings

Actual behavior

If I apply any Gaussian operation on a Fock state, the cutoff is expanded to the value given by AUTOSHAPE_MAX, regardless of the value of AUTOSHAPE_PROBABILITY

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.10.14
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.23.5
Numba version:             0.59.1
Scipy version:             1.14.1
The Walrus version:        0.21.0
TensorFlow version:        2.17.0

Source code

from mrmustard import settings
import mrmustard.lab_dev as mm

settings.AUTOSHAPE_PROBABILITY = 0.9
settings.AUTOSHAPE_MAX = 10

state = mm.Ket.from_fock([0], [0, 1])

state >> mm.Dgate([0])

Tracebacks

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions