A. Python Code for Quantum Neural Reinforcement Learning Problem.

self.qnnet.cx(q[k],q[dim+k])

DOI: http://dx.doi.org/10.5772/intechopen.84149

self.qnnet.cx(q[l],q[2\*dim+l]) self.qnnet.cx(q[dim+l],q[2\*dim+l])

self.qnnet.measure(q[2\*dim+m], c[dim-1-m]) # Execute the algorithm on the backend

Quantum Neural Machine Learning: Theory and Experiments

plot\_histogram(job\_exp.result().get\_counts(self.qnnet))

job\_exp = execute(self.qnnet, backend = backend\_used, shots = num\_shots)

University of Lisbon, Institute of Social and Political Sciences, Lisbon, Portugal

© 2019 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium,

\*Address all correspondence to: cgoncalves@iscsp.ulisboa.pt
