Printing out the wavefunction using the Reference QVM throws a type error as pyQuil attempts to perform various scalar math operations.
For example:
from referenceqvm import api
import pyquil.quil as pq
from pyquil.gates import *
qvm = api.SyncConnection()
p = pq.Program(H(0), CNOT(0,1))
prog = pq.Program().inst(H(0)).measure(0, [0]).measure(0, [1])
result = qvm.run(prog, [0, 1])
for index, amplitude in enumerate(qvm.wavefunction(p)[0]):
print(amplitude)
print(amplitude.real)
print('--')
print(qvm.wavefunction(p)[0])
Printing out the wavefunction using the Reference QVM throws a type error as pyQuil attempts to perform various scalar math operations.
For example:
produces the following output :