Skip to content

Fix incorrect coefficient in mixed-state entanglement swapping - #42

Open
ExistenceOne wants to merge 1 commit into
QNLab-USTC:mainfrom
ExistenceOne:fix/mixed-swapping
Open

ExistenceOne wants to merge 1 commit into
QNLab-USTC:mainfrom
ExistenceOne:fix/mixed-swapping

Conversation

@ExistenceOne

Copy link
Copy Markdown

The calculation of ne.d in MixedStateEntanglement.swapping() incorrectly uses self.c * epr.d instead of self.c * epr.b.

For Bell-diagonal states ordered as $(\Phi^+, \Psi^+, \Psi^-, \Phi^-)$, the correct coefficient is:

$$ d_{\mathrm{out}} = a_1d_2 + b_1c_2 + c_1b_2 + d_1a_2. $$

This typo produces incorrect output probabilities. The subsequent normalization can mask the error by rescaling the coefficients.

It can also cause a ZeroDivisionError. For example, swapping inputs with c=1 and b=1 should produce d=1, but the current implementation produces four zero coefficients and fails during normalization.

This change replaces the incorrect term:

- ne.d = self.a*epr.d + self.b*epr.c + self.c*epr.d + self.d*epr.a
+ ne.d = self.a*epr.d + self.b*epr.c + self.c*epr.b + self.d*epr.a

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant