Cost functions

DZ D. Zhu NL N. M. Linke MB M. Benedetti KL K. A. Landsman NN N. H. Nguyen CA C. H. Alderete AP A. Perdomo-Ortiz NK N. Korda AG A. Garfoot CB C. Brecque LE L. Egan OP O. Perdomo CM C. Monroe

This protocol is extracted from research article:

Training of quantum circuits on a hybrid quantum computer

**
Sci Adv**,
Oct 18, 2019;
DOI:
10.1126/sciadv.aaw9918

Training of quantum circuits on a hybrid quantum computer

Procedure

We used a cost function to quantify the difference between the target BAS distribution and the experimental measurements of the circuit. The cost functions used to implement the training are variants of the original *D*_{KL} (*26*)$${D}_{\mathit{KL}}(p,q)=-{\displaystyle \sum _{i}}p(i)\text{log}\frac{q(i)}{p(i)}$$(3)

Here, *p* and *q* are two distributions. *D _{KL}*(

The *D _{KL}* is a very general measure, but it is not always well defined, e.g., if an element of the domain is supported by

Here, we set *p* as the target distribution. Thus, Eq. 4 is equivalent to Eq. 3 up to a constant offset, so the optimization of these two functions is equivalent. ϵ is a small number (0.0001 here) used to avoid a numerical singularity when *q(i)* is measured to be zero. For BO, we used the clipped symmetrized *D _{KL}* as the cost function$${\tilde{D}}_{\mathit{KL}}(p,q)={D}_{\mathit{KL}}[\text{max}(\mathrm{\u03f5},p),\text{max}(\mathrm{\u03f5},q)]+{D}_{\mathit{KL}}[\text{max}(\mathrm{\u03f5},q),\text{max}(\mathrm{\u03f5},p)]$$(5)

This is found to be the most reliable variant of *D _{KL}* for BO.

Note: The content above has been extracted from a research article, so it may not display correctly.

Q&A

Your question will be posted on the Bio-101 website. We will send your questions to the authors of this protocol and Bio-protocol community members who are experienced with this method. you will be informed using the email address associated with your Bio-protocol account.