4. Conclusions

terminal, due to the cloud access to IBM's quantum resources, constituting an example of Quantum Object Oriented Programming (QOOP) using Qiskit.

network; in this case, the attribute will be assigned a quantum circuit with the

to any of the devices. The method returns the backend to be used.

IBM's quantum computers, the corresponding quantum algorithm.

algorithm on the respective device for a number of shots (num\_shots).

library NumPy's dot product applied to the distributions and rewards lists.

There are two methods that any instance of the class Agent must be able to implement: the first method manages the cloud access to IBM's resources, the second method implements the action selection and the quantum algorithm.

The inputs for the first method are the accounts to be loaded, for the classical computer to be able to access quantum computer via the cloud service, and the backend code, which, by default, is set to the QASM simulator but can be changed

The second method, for the action selection, has a structure that is specific to the problem in question; that is, the agent is offered a set of rewards and probabilities associated with each alternative action, and must choose the action that maximizes

Thus, the probabilities are known to the agent and form part of the gamble that is offered to it; therefore, we are dealing with a decision problem under risk, and wish to address how the agent's QUANN can exhibit an adaptive computation with

While, in the above equations, the adaptive nature of the quantum neural circuit was introduced in the unitary operator's parameters themselves, the Python code for the method must use the gamble's inputs to make the quantum circuit adaptive; that is, the method must be such that the agent designs its own cognitive architecture (updating its qnnet attribute) and quantum circuit using the inputs to the method, and, then, the agent must implement the cloud-based access to run, in

The inputs for the method are, then, given by a list of probability distributions, where each line corresponds to a different probability gamble profile associated with each action, for instance, in the case of Table 1, the distributions are given by ([0.6, 0.4],[0.4, 0.6]). In the case of Tables 1 and 2 and Figure 5, the rewards list is

The other two inputs for the method are the backend used which allows the agent that is instantiated in a classical computer to access via cloud the quantum computer, using the backend code (backend\_used) and repeatedly running the

The choose\_action method's step zero is the extraction of the expected values and of the corresponding parameters for the adaptive gates, namely, the expected values array associated with each action is extracted by the agent using the Python

The number of actions and dimension d that determines the network size are extracted from the length of the expected values array; then, the parameters for the adaptive gates are extracted by applying NumPy's argmax function on the expected values array and then converting the resulting index in binary format (using NumPy's binary\_repr). Since the indexes match the lexicographic order of binary strings, the agent, thus, effectively extracts the parameters for the adaptive unitary

Now, the next step is to set up the QUANN, including the three modules, the

The last step implements the QNRL algorithm, following the inter-module links

classical registers for the measurement of the final actions to be chosen and updating the agent's qnnet attribute, assigning it the corresponding Qiskit's quan-

as per the main equations introduced in this section, and defines the quantum

required quantum and classical registers.

Artificial Intelligence - Applications in Medicine and Biology

the conditional expected reward.

respect to this problem.

[1, 1].

gates.

114

tum circuit object.

The code defines the class "Agent" with an attribute that is the quantum neural

Cloud-based access to quantum computers opens up a major point: the empirical testing of algorithms and the implementation of computer programs in a quantum computational substrate has become feasible.

The IBM Q Experience constitutes an example of how a programmer can use Python programming language and IBM's Python Qiskit package for building programs that use quantum computation, limited only by the specific device resources, namely the number of quantum registers available.

For quantum AI and machine learning, this provides a way to effectively bring the algorithms from the theoretical level to the test level, allowing one to test drive different quantum AI frameworks on actual quantum computers. The work developed in the previous sections allowed us to provide several examples of such an implementation, with a few main points standing out:


The three main points above help strengthen two core arguments: the first is that quantum machine learning can now be tested on actual quantum computers, making it feasible to empirically test the algorithms; the second is that, in the near future, with further advancements in quantum computation and quantum hardware, quantum adaptive computation may be implemented on actual robots with a quantum cognitive architecture that is based on cloud access to a quantum computer.

The present work addresses both core arguments by exemplifying how a form of QNRL can be employed to implement quantum adaptive computation on a physical QUANN with cloud-based access, employing QOOP and addressing, experimentally, a decision under risk problem.
