CoChat

Learning the quantum algorithm for state overlap

Open access
Cincio, Lukasz, Subaşı, Yiğit, Sornborger, Andrew T, Coles, Patrick J · 2018 · New Journal of Physics

The DOI matches its Crossref record; 29 of the 30 references it cites were found in a registry or an index.

Abstract

Short-depth algorithms are crucial for reducing computational error on near-term quantum computers, for which decoherence and gate infidelity remain important issues. Here we present a machine-learning approach for discovering such algorithms. We apply our method to a ubiquitous primitive: computing the overlap between two quantum states ρ and σ . The standard algorithm for this task, known as the Swap Test, is used in many applications such as quantum support vector machines, and, when specialized to ρ = σ , quantifies the Renyi entanglement. Here, we find algorithms that have shorter depths than the Swap Test, including one that has a constant depth (independent of problem size). Furthermore, we apply our approach to the hardware-specific connectivity and gate sets used by Rigetti's and IBM's quantum computers and demonstrate that the shorter algorithms that we derive significantly reduce the error—compared to the Swap Test—on these computers.

Overview

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

Crossref · 10.1088/1367-2630/aae94a

Cites

29 of 30 references verified0 citation errors · 1 not checkable

Statistics

Figures

Figure 1 Machine-learning approach to discovering and optimizing quantum algorithms. We optimize an algorithm for a given set of resources, which includes input resources ( ancilla and data qubits ) andmeasurementresources ( i.e. which qubits can be measured ) . Thealgorithm is then determined by the quantum gate sequence and the classical post-processing of the measurement results. To fi nd the algorithm that computes the function x → f ( x ) , we minimize a cost function that quanti fi es the discrepancy between the desired output f ( x ( i ) ) andtheactual output y ( i ) for a set of training data inputs { x ( i ) } . If the training data are suf fi ciently general, the algorithm that minimizes the cost should be a general algorithm that computes f ( x ) for any input x .
Figure 1 Machine-learning approach to discovering and optimizing quantum algorithms. We optimize an algorithm for a given set of resources, which includes input resources ( ancilla and data qubits ) andmeasurementresources ( i.e. which qubits can be measured ) . Thealgorithm is then determined by the quantum gate sequence and the classical post-processing of the measurement results. To fi nd the algorithm that computes the function x → f ( x ) , we minimize a cost function that quanti fi es the discrepancy between the desired output f ( x ( i ) ) andtheactual output y ( i ) for a set of training data inputs { x ( i ) } . If the training data are suf fi ciently general, the algorithm that minimizes the cost should be a general algorithm that computes f ( x ) for any input x .CC-BY · From the PDF
Figure 2 SwapTestcircuits. ( A ) Thecanonical Swap Test circuit. H indicates the Hadamard gate. ( B ) TheSwapTestcircuit adapted for IBM ' s fi ve-qubit quantum computer, constructed by decomposing controlled-swap into the Toffoli gate, via [ 34, 35 ] , and then manually eliminating gates that had no effect on the output. T is the π / 8 phase gate. ( C ) Thestructure of a Swap Test circuit, showing the locations of the one-qubit gates and controlledZ gates, constructed automatically by Rigetti ' s compiler for their 19-qubit quantumcomputer. Appendix Agives the full speci fi cation of that circuit.
Figure 2 SwapTestcircuits. ( A ) Thecanonical Swap Test circuit. H indicates the Hadamard gate. ( B ) TheSwapTestcircuit adapted for IBM ' s fi ve-qubit quantum computer, constructed by decomposing controlled-swap into the Toffoli gate, via [ 34, 35 ] , and then manually eliminating gates that had no effect on the output. T is the π / 8 phase gate. ( C ) Thestructure of a Swap Test circuit, showing the locations of the one-qubit gates and controlledZ gates, constructed automatically by Rigetti ' s compiler for their 19-qubit quantumcomputer. Appendix Agives the full speci fi cation of that circuit.CC-BY · From the PDF
Figure 3 Final cost that we obtained after minimizing our cost function versus the circuit gate count d . ( A ) Theresources allowed ( shownintheinset ) are the same as those allowed in the Swap Test, i.e. one ancilla qubit, two data qubits, and one measurement on the ancilla. This results in a minimum gate count of = d 8 min . ( B ) Thenumberofqubitsin ρ and σ is increased, resulting in = d 14 min for n = 2 qubits. This procedure leads to the discovery of a general algorithm presented in fi gure 5. ( C ) Allowing for additional resources ( shownintheinset ) of measurements on all of the qubits results in a minimum gate count of = d 2 min . ( D ) Again we increase the numberofqubits in ρ and σ , giving = d 4 min for n = 2 qubits, when measurements on all qubits are allowed. As a result, a general algorithm is obtained, as shown in fi gure 6.
Figure 3 Final cost that we obtained after minimizing our cost function versus the circuit gate count d . ( A ) Theresources allowed ( shownintheinset ) are the same as those allowed in the Swap Test, i.e. one ancilla qubit, two data qubits, and one measurement on the ancilla. This results in a minimum gate count of = d 8 min . ( B ) Thenumberofqubitsin ρ and σ is increased, resulting in = d 14 min for n = 2 qubits. This procedure leads to the discovery of a general algorithm presented in fi gure 5. ( C ) Allowing for additional resources ( shownintheinset ) of measurements on all of the qubits results in a minimum gate count of = d 2 min . ( D ) Again we increase the numberofqubits in ρ and σ , giving = d 4 min for n = 2 qubits, when measurements on all qubits are allowed. As a result, a general algorithm is obtained, as shown in fi gure 6.CC-BY · From the PDF
Figure 4 Schematic view of one iteration of the cost optimization procedure. ( A ) Iteration begins with a random update to the gate sequence vector  k that describes the algorithm ' s structure and a random update to the post-processing vector  c . ( B ) Continuous parameters q  of every one-qubit gate are reoptimized using the steepest descent method. ( C ) Theoptimization in the previous step gives a cost that is compared with the current best one. Based on the outcome of that comparison, new vectors  k and  c are either accepted or rejected. See text for details.
Figure 4 Schematic view of one iteration of the cost optimization procedure. ( A ) Iteration begins with a random update to the gate sequence vector  k that describes the algorithm ' s structure and a random update to the post-processing vector  c . ( B ) Continuous parameters q  of every one-qubit gate are reoptimized using the steepest descent method. ( C ) Theoptimization in the previous step gives a cost that is compared with the current best one. Based on the outcome of that comparison, new vectors  k and  c are either accepted or rejected. See text for details.CC-BY · From the PDF
Figure 5 OurABA,obtainedbyminimizing the cost for the resources shown in fi gures 3 ( A ) and ( B ) . ( A ) When ρ and σ are one-qubit states, we obtain a circuit with 4 CNOT gates and 4 one-qubit gates for a total of 8 gates. Here, = † U T H . ( B ) Six of these gates are combined to create a ' building block ' ( see inset ) that is used to generalize the algorithm for input states ρ and σ of arbitrary size. The post-processing vector is = - ( ) c 1, 1 , independent of problem size.
Figure 5 OurABA,obtainedbyminimizing the cost for the resources shown in fi gures 3 ( A ) and ( B ) . ( A ) When ρ and σ are one-qubit states, we obtain a circuit with 4 CNOT gates and 4 one-qubit gates for a total of 8 gates. Here, = † U T H . ( B ) Six of these gates are combined to create a ' building block ' ( see inset ) that is used to generalize the algorithm for input states ρ and σ of arbitrary size. The post-processing vector is = - ( ) c 1, 1 , independent of problem size.CC-BY · From the PDF
Image 6
CC-BY · From the PDF
Figure 7 Equivalence between our ABA and BBA. The two-qubit measurement and classical post-processing in the BBA can be converted to a Toffoli gate with an ancilla as the target followed by a measurement on the ancilla. This takes us from circuit ( A ) to circuit ( B ) . Inserting into circuit ( B ) the optimal decomposition of the Toffoli gate from [ 35 ] gives circuit ( C ) . Finally one does three simpli fi cations of this circuit to obtain the ABA, indicated by the dashed boxes in ( C ) . Namely, the fi rst boxed CNOT in ( C ) has trivial action and hence can be removed. The second boxed CNOT in ( C ) can be fl ipped such that the ancilla is the control qubit, which introduces some Hadamards. One of these Hadamards cancels with the fi rst Hadamard in ( C ) , and two others combine with T and † T to make the † U and U shownin fi gure 5 ( A ) . Finally the fi ve gates enclosed in the last dashed box in ( C ) have no effect on the measurement and hence can be removed.
Figure 7 Equivalence between our ABA and BBA. The two-qubit measurement and classical post-processing in the BBA can be converted to a Toffoli gate with an ancilla as the target followed by a measurement on the ancilla. This takes us from circuit ( A ) to circuit ( B ) . Inserting into circuit ( B ) the optimal decomposition of the Toffoli gate from [ 35 ] gives circuit ( C ) . Finally one does three simpli fi cations of this circuit to obtain the ABA, indicated by the dashed boxes in ( C ) . Namely, the fi rst boxed CNOT in ( C ) has trivial action and hence can be removed. The second boxed CNOT in ( C ) can be fl ipped such that the ancilla is the control qubit, which introduces some Hadamards. One of these Hadamards cancels with the fi rst Hadamard in ( C ) , and two others combine with T and † T to make the † U and U shownin fi gure 5 ( A ) . Finally the fi ve gates enclosed in the last dashed box in ( C ) have no effect on the measurement and hence can be removed.CC-BY · From the PDF
Figure 8 Ancilla-based algorithm adapted ( via our machine-learning approach ) to commercial hardware. ( A ) ABAadaptedtoIBM ' s fi ve-qubit computer, U = T † H . ( B ) ABAadaptedtoRigetti ' s 19-qubit computer. One-qubit unitaries have the following form: U 1 = U 8 = H , = = = = † † U U U U XH 2 3 6 7 , U 4 = RX ( - π / 4 ) T , = † U T HT 5 , U 9 = RX ( π / 4 ) , U 10 = RX ( - 3 π / 4 ) , where q = -q ( ) R e X X i 2 .
Figure 8 Ancilla-based algorithm adapted ( via our machine-learning approach ) to commercial hardware. ( A ) ABAadaptedtoIBM ' s fi ve-qubit computer, U = T † H . ( B ) ABAadaptedtoRigetti ' s 19-qubit computer. One-qubit unitaries have the following form: U 1 = U 8 = H , = = = = † † U U U U XH 2 3 6 7 , U 4 = RX ( - π / 4 ) T , = † U T HT 5 , U 9 = RX ( π / 4 ) , U 10 = RX ( - 3 π / 4 ) , where q = -q ( ) R e X X i 2 .CC-BY · From the PDF
Figure 9 Experimentally observed overlaps on commercial hardware for the states Yñ = ñ + ñ ∣ (∣ ∣ ) 0 1 2 and Fñ = ñ + ∣ (∣ 0 ñ a ∣ ) e 1 2 i . ( A ) Results from IBM ' s fi ve-qubit computer called ' ibmqx4 ' , with 49,152 quantum computer runs per data point. The black curve is the analytical overlap áF Yñ ∣ ∣ ∣ 2 . The red, blue, and green curves are respectively the results for the BBA from fi gure 6 ( A ) , the ABA from fi gure 8 ( A ) , and the Swap Test from fi gure 2 ( B ) . ( B ) Results from Rigetti ' s 19-qubit computer, with 200,000 quantum computer runs per data point. The curves are analogous to those from panel ( A ) . Namely, the red, blue, and green curves are respectively for the BBA from fi gure 6 ( A ) , the ABA from fi gure 8 ( B ) , and the Swap Test from fi gure 2 ( A ) which Rigetti compiled to fi gure 2 ( C ) . The experimentally estimated overlap takes negative values for some α because the algorithm estimates the expectation value of controlledZ operator, which has a negative eigenvalue. Another reason for this effect may be noise and other imperfections of the device.
Figure 9 Experimentally observed overlaps on commercial hardware for the states Yñ = ñ + ñ ∣ (∣ ∣ ) 0 1 2 and Fñ = ñ + ∣ (∣ 0 ñ a ∣ ) e 1 2 i . ( A ) Results from IBM ' s fi ve-qubit computer called ' ibmqx4 ' , with 49,152 quantum computer runs per data point. The black curve is the analytical overlap áF Yñ ∣ ∣ ∣ 2 . The red, blue, and green curves are respectively the results for the BBA from fi gure 6 ( A ) , the ABA from fi gure 8 ( A ) , and the Swap Test from fi gure 2 ( B ) . ( B ) Results from Rigetti ' s 19-qubit computer, with 200,000 quantum computer runs per data point. The curves are analogous to those from panel ( A ) . Namely, the red, blue, and green curves are respectively for the BBA from fi gure 6 ( A ) , the ABA from fi gure 8 ( B ) , and the Swap Test from fi gure 2 ( A ) which Rigetti compiled to fi gure 2 ( C ) . The experimentally estimated overlap takes negative values for some α because the algorithm estimates the expectation value of controlledZ operator, which has a negative eigenvalue. Another reason for this effect may be noise and other imperfections of the device.CC-BY · From the PDF
Figure A1. SwapTestcircuit obtained from Rigetti ' s compiler for their 19-qubit quantum computer. The speci fi c form of all onequbit gates is given by equation ( A1 ) .
Figure A1. SwapTestcircuit obtained from Rigetti ' s compiler for their 19-qubit quantum computer. The speci fi c form of all onequbit gates is given by equation ( A1 ) .CC-BY · From the PDF
Image 11
CC-BY · From the PDF

Verification

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Citations

Cites

Show all 30 references

Research works printed but not linked: 6

  1. Ball P 2018 The era of quantum computing is here. Outlook: cloudy Quanta Mag. [available at: http://quantamagazine.org/the-era- of-quantum-computing-is-here-outlook-cloudy-20180124/]
  2. Khatri S et al 2018 Quantum-assisted quantum compiling arXiv:1807.00800 · arXiv
  3. Hachtel G D and Somenzi F 1996 Logic Synthesis and Verification Algorithms (Boston, MA: Kluwer)
  4. Linke N M et al 2017 Measuring the Renyi entropy of a two-site Fermi-Hubbard model on a trapped ion quantum computer arXiv:1712.08581 · arXiv
  5. Smith R S, Curtis M J and Zeng W J 2016 A practical quantum instruction set architecture arXiv:1608.03355 · arXiv
  6. Wiebe N, Kapoor A and Svore K 2014 Quantum algorithms for nearest-neighbor methods for supervised and unsupervised learning Quantum Inf. Comput. 15 0318-58

Cited by

See all 288

Metadata

Authors
Cincio, L., Subaşı, Y., Sornborger, A. T., & Coles, P. J.
Affiliations
Los Alamos National Laboratory (US)
Corresponding author
Cincio, Lukasz
Venue
New Journal of Physics
Published
2018-11-15
Volume
20
Issue
11
Pages
113022
ISSN
1367-2630 (ISSN-L)
OpenAlex
W2790264742
Cited by
282
References
24
Citations by year
2026: 20 · 2025: 26 · 2024: 38 · 2023: 60 · 2022: 40 · 2021: 47 · 2020: 22 · 2019: 25 · 2018: 4
FWCI
13.81
Type
journal article
Language
en
Open access
Licence
Locations
  • New Journal of Physics (publishedVersion, cc-by)
  • arXiv (Cornell University) (submittedVersion)
  • DOAJ (DOAJ: Directory of Open Access Journals) (submittedVersion)
  • OSTI OAI (U.S. Department of Energy Office of Scientific and Technical Information) (submittedVersion)
  • arXiv (Cornell University)
Funders
  • U.S. Department of Energy (J. Robert Oppenheimer fellowship)
  • Los Alamos National Laboratory (Beyond Moore’s Law project, LDRD program)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Quantum Computing Algorithms and Architecture
  • Physical Sciences › Physics and Astronomy › Atomic and Molecular Physics, and Optics › Quantum Information and Cryptography
  • Physical Sciences › Physics and Astronomy › Atomic and Molecular Physics, and Optics › Quantum many-body systems
Keywords
swap test, quantum support vector machine, near-term quantum devices, gate infidelity, decoherence

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

How to cite

Cite CoChat for the checks on this page, and the paper for its own findings.

This page
CoChat. (2026). Citation check: Learning the quantum algorithm for state overlap. https://app.cochat.ai/papers/10.1088/1367-2630/aae94a
The paper
Cincio, L., Subaşı, Y., Sornborger, A. T., & Coles, P. J. (2018). Learning the quantum algorithm for state overlap. New Journal of Physics. https://doi.org/10.1088/1367-2630/aae94a

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.