Qaptiva Access User Guide
Once properly configured, using Qaptiva Access can be as seemless as in this first example:
import numpy as np
from qat.lang import qfunc, RX
from qat.core import Observable
# remote import
from qlmaas.qpus import LinAlg
@qfunc
def my_function(theta):
RX(theta)(0)
return Observable.sigma_z(0)
# evaluation of my_function, with a remote call to LinAlg
result = my_function(1)
See qfunc()
for a similar example without the remote import.
But Qaptiva Access can also be used in a more explicit manner:
from qat.core import Job
from qlmaas.qpus import LinAlg
from qlmaas.plugins import ScipyMinimizePlugin
job = Job.load("myjob")
stack = ScipyMinimizePlugin() | LinAlg()
# get a future to an asynchronous result
future_result = stack.submit(job)
print(result.get_status())
# wait and fetch the result
result = future_result.join()
The following sections detail how to install, setup and use Qaptiva Access.