Closed rasa97 closed 7 years ago
Your quil instructions aren't formatted correctly. It should be:
'I 1\nH 1\nI 2\nCNOT 1 2'
which went printed looks like this:
I 1
H 1
I 2
CNOT 1 2
One instruction per line, no parenthesis around the gates. Better is to pass it in as an array:
Program(['I 1', 'H 1', 'I 2'])
Even better still is to use the actual gate objects defined in pyquil:
from pyquil.gates import *
p = Program()
p.inst(I(0))
p.inst(H(1))
or Program([I(0), H(1)])
I created a program like this:
ins = pq.Program().inst(bell_state('00'))
The Bell state function is defined as:First I tried without quotes. It raised:
TypeError: op must be a string
Then after providing the quotes:
Anyway around this?