Skip to content

Add non-unitary parity projection example#182

Open
masa10-f wants to merge 1 commit intomasterfrom
add-nonunitary-parity-projection-example
Open

Add non-unitary parity projection example#182
masa10-f wants to merge 1 commit intomasterfrom
add-nonunitary-parity-projection-example

Conversation

@masa10-f
Copy link
Copy Markdown
Collaborator

@masa10-f masa10-f commented Apr 12, 2026

Summary

  • Add examples/nonunitary_parity_projection.py: a 3-node star graph demonstrating the Kraus branch $K_s = (I + (-1)^s Z_0 Z_1)/2$ via ancilla X-measurement
  • Starting from $|{+}{+}\rangle$, the two measurement branches produce Bell states ($|\Phi^+\rangle$ for $s=0$, $|\Psi^+\rangle$ for $s=1$), showing measurement-induced entanglement as a non-unitary MBQC operation
  • Uses GraphState.from_graph() + qompile() + PatternSimulator (StateVector), with graph visualization
  • Update CHANGELOG.md

Test plan

  • python examples/nonunitary_parity_projection.py runs without error and produces correct overlap outputs
  • pytest passes (no regressions)
  • ruff check / ruff format --check pass
  • make html in docs/ builds without warnings

🤖 Generated with Claude Code

Demonstrate measurement-induced entanglement via a 3-node star graph
that implements the Kraus branch K_s = (I + (-1)^s Z0 Z1) / 2.
The ancilla X-measurement produces Bell states from |++> input,
showing genuinely non-unitary MBQC operations with the existing
statevector simulator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.60%. Comparing base (eaa6f69) to head (f23a559).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #182      +/-   ##
==========================================
+ Coverage   84.54%   84.60%   +0.06%     
==========================================
  Files          24       24              
  Lines        3203     3203              
  Branches      550      550              
==========================================
+ Hits         2708     2710       +2     
+ Misses        362      361       -1     
+ Partials      133      132       -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@masa10-f masa10-f self-assigned this Apr 12, 2026
@masa10-f masa10-f added the documentation Improvements or additions to documentation label Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant