XanaduAI/MrMustard

AUTOSHAPE for conditional output states

Closed this issue · 1 comments

Before posting a feature request

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

Feature details

With current AUTOSHAPE settings, conditional output states can have misleading cutoffs. E.g., in the example below with the default AUTOSHAPE_PROBABILITY = 0.999, one might expect the output state to be calculated with fidelity 0.999 (after normalization), but instead one gets fidelity 0. This issue seems like something that can occur every time a conditional output state is produced, so I would think one should always set AUTOSHAPE_PROBABILITY = 1 to ensure correct behavior in the current implementation, which seems counter-productive.
image

Implementation

I'm not sure how exactly these things are calculated under the hood, but it would be nice to have AUTOSHAPE_PROBABILITY (or maybe some new setting?) behave to correspond to the relative probability of any output states after measurements AFTER normalization, and not before normalization. In a hand-wavy sense I imagine that it should be possible to account for this, e.g., in the TMSV example above, when n > 3 there's only ~<0.1 probability left in the total 2-mode state, but the conditional output state at that point has an even smaller probability of 0, and so the relative probability at that point is 0 / 0.1 = 0 which is smaller than AUTOSHAPE_PROBABILITY, and hence the calculations should not terminate yet.

How important would you say this feature is?

2: Somewhat important. Needed this quarter.

Additional information

No response

This now seems to work