MrMustard icon indicating copy to clipboard operation
MrMustard copied to clipboard

Efficient calculation of probabilities

Open JacobHast opened this issue 6 months ago • 2 comments

Before posting a feature request

  • [x] I have searched exisisting GitHub issues to make sure the feature request does not already exist.

Feature details

The calculation of probabilities in lab_dev for states in the Fock representation appears relatively slow - at least it can be sped up by a factor 10 using a simple numpy code as shown in this example.

image

Implementation

No response

How important would you say this feature is?

2: Somewhat important. Needed this quarter.

Additional information

While the calculation of the probability of a single state is quite fast, I sometimes need to do it for >100,000 states, at which point this step becomes the numerical bottleneck, so it would be very useful to get this improved. I have not done the comparison for DM states, only Ket

JacobHast avatar Aug 13 '24 09:08 JacobHast