- #1
Spark-X
- 1
- 0
I have been trying write a code in for error correction. I am new to programming and am unable to understand what is not alright. Can anyone please suggest some explanation?
from projectq.ops import All, CNOT, H, Measure, Rz, X, Z
from projectq import MainEngine
from projectq.meta import Dagger, Control
def X_correction():
qu1[2] = eng.allocate_qureg(2)
qu2[2] = eng.allocate_qureg(2)
entangle | qu1
entangle | qu2
entqu1 = CNOT | (qu1[0],qu2[0])
H|entqu1
measure | entqu1
H | entqu1
return entqu1
from projectq.ops import All, CNOT, H, Measure, Rz, X, Z
from projectq import MainEngine
from projectq.meta import Dagger, Control
def X_correction():
qu1[2] = eng.allocate_qureg(2)
qu2[2] = eng.allocate_qureg(2)
entangle | qu1
entangle | qu2
entqu1 = CNOT | (qu1[0],qu2[0])
H|entqu1
measure | entqu1
H | entqu1
return entqu1