Skip to content

Fix Kraus coefficients in pauli_channel - #659

Open
chenyangsu wants to merge 1 commit into
TeamGraphix:masterfrom
chenyangsu:fix/pauli-channel-kraus-coefs
Open

chenyangsu wants to merge 1 commit into
TeamGraphix:masterfrom
chenyangsu:fix/pauli-channel-kraus-coefs

Conversation

@chenyangsu

Copy link
Copy Markdown

Context (if applicable):
pauli_channel(0.1, 0.1, 0.1) raises ValueError: The specified channel is not normalized. because it passes np.sqrt(1 - p_i) for Ops.I and divides each Pauli probability by 3.0. At pauli_channel(0.25, 0.25, 0.25), normalization passes with squared coefficients [0.75, 0.0833, 0.0833, 0.0833] rather than [0.25, 0.25, 0.25, 0.25].

Description of the change:
Could we use np.sqrt(p_i) for Ops.I and np.sqrt(px), np.sqrt(py), np.sqrt(pz) for X, Y, Z, with check_probability on each input? Happy to skip check_probability if you prefer.

Related issue:
None.

Testing: pytest tests/test_kraus.py -> 9 passed (new test_pauli_channel fails on master), plus 130 density matrix tests, ruff, mypy, and pyright.

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