Skip to content
Permalink
Browse files

Add testing for running procedure calls in pyquil

  • Loading branch information...
vtomole committed Apr 26, 2018
1 parent 6a96379 commit 6660ed75d99af2693b4e72af724b74799018e69e
Showing with 82 additions and 0 deletions.
  1. +82 −0 software/pyquil/test_runs.py
@@ -0,0 +1,82 @@
from pyquil.quil import Program
#from pyquil.api import QPUConnection
from pyquil.api import QVMConnection
from pyquil.gates import *


#qpu = QPUConnection(device_name='19Q-Acorn')
qvm = QVMConnection()


test_run = Program(
H(0),
CNOT(0,1)

)

print("test_run")
result = qvm.run(test_run, [0], 1)
print(result)


test_run_async = Program(
H(0),
CNOT(0,1)

)

print("test_run_async")
result = qvm.run(test_run_async, [0], 1)
print(result)


test_run_and_measure = Program(
H(0),
CNOT(0,1)

)

print("test_run_and_measure")
result = qvm.run_and_measure(test_run_and_measure, [0], 1)
print(result)


test_run_and_measure_async = Program(
H(0),
CNOT(0,1)

)

print("test_run_and_measure_async")
result = qvm.run_and_measure(test_run_and_measure_async, [0], 1)
print(result)



test_run_empty = Program()

#print("Test run empty")
#result = qvm.run(test_run_empty, [0], 1)
#print(result)


test_run_async_empty = Program()

#print("Test run async empty")
#result = qvm.run(test_run_async_empty, [0], 1)
#print(result)


test_run_and_measure_empty = Program()

#print("Test run_and_measure_empty")
#result = qvm.run_and_measure(test_run_and_measure_empty, [0], 1)
#print(result)



test_run_and_measure_async_empty = Program()

#print("test_run_and_measure_async")
#result = qvm.run_and_measure(test_run_and_measure_async_empty, [0], 1)
#print(result)

0 comments on commit 6660ed7

Please sign in to comment.
You can’t perform that action at this time.