Describe the bug
When executing the first code snippet in https://github.com/TeamGraphix/graphix/blob/master/docs/source/lc-mbqc.rst, a ValueError occurs. The ValueError occurs due to exchanged parameters for evolve_single(op, i) method. This issue prevents users from obtaining the expected results and might lead to confusion.
To Reproduce
Copy the code snippet into a Python environment or integrated development environment (IDE):
from graphix import GraphState
import networkx as nx
import numpy as np
from graphix.sim.statevec import meas_op
graphstate and statevector instance
g = nx.complete_graph(4, create_using=GraphState)
state = g.to_statevector()
measure qubit 0 in X basis, assume meas result s=0
2. Execute the code snippet with the necessary dependencies.
3. Observe the ValueError being raised:
`ValueError: shape-mismatch for sum`
**Expected behavior**
The code snippet should run without errors.
**Environment:**
- OS: Ubuntu 20.04.3 LTS focal
- Python version: 3.10.11
- graphix version: 0.2.2
**Solution:**
When parameters `op` (2x2 matrix; Type: np.array) and `i` (Qubit index; Type: int) are swapped, as indicated in the Module reference, the code executes without error.
Describe the bug When executing the first code snippet in https://github.com/TeamGraphix/graphix/blob/master/docs/source/lc-mbqc.rst, a ValueError occurs. The ValueError occurs due to exchanged parameters for
evolve_single(op, i)
method. This issue prevents users from obtaining the expected results and might lead to confusion.To Reproduce
graphstate and statevector instance
g = nx.complete_graph(4, create_using=GraphState) state = g.to_statevector()
measure qubit 0 in X basis, assume meas result s=0
g.measure_x(0, choice=0) state_from_graphsim = g.to_statevector()
do the same with statevector sim
state.evolve_single(0, meas_op(0, choice=0)) state.normalize() state.ptrace([0])