During the last two years a race of industrial and research organizations has been opened to develop a ready-to-implement engineering solution for quantum computing (QC). It resulted in the QC market closely resembling the ascent ages of classical computing industry. Namely, there were many underdeveloped computing architectures which being incompatible with each other required significant efforts in porting software and algorithmic solutions between them. Given a broadly supported opinion that in the near term we are unlikely to become witnesses to flexible large-scale quantum architectures, there is a critical need to develop portable, architecture-agnostic hybrid quantum-classical frameworks that will allow solving large-scale computational problems on small-scale quantum architectures.
There are multiple emerging quantum computation paradigms. The performance comparison of these paradigms is an important research topic. In this paper, we present for the first time a performance comparison of two leading quantum computation paradigms - D-Wave quantum annealing and gate-based universal quantum computation. Both approaches have great potential for achieving quantum speedup for a number of important problems [13, 27, 1, 7].
The first approach, quantum annealing (QA), is based on adiabatic quantum computation (AQC) . QA solves computational problems by using a guided quantum evolution . The evolution starts with an initial Hamiltonian with an easy-to-prepare ground state and ends up in the ground state of the problem Hamiltonian. QA is based on the adiabatic theorem that guarantees that if the Hamiltonian is evolved slowly then transitions to excited states are suppressed during the adiabatic evolution 
. The D-Wave quantum annealer uses superconducting flux qubits[2, 6] and has been shown to solve optimization problems on graphs 22], traffic flow optimization , and simulation problems . Quantum and hybrid quantum-classical approaches have been employed.
The second approach is often referred to as the gate-based or universal QC. This mode of QC was theoretically demonstrated to have a great potential for exponential speedups over best known classical algorithms . In the near term, the capability of the quantum devices is limited by the number of qubits, low fidelity of gates, and lack of error correction. These limitations constrain us to using low-depth quantum circuits (i.e., quantum circuits with few gates) on a small number of qubits. Within the constraints of near-term intermediate-scale quantum (NISQ) technology , a number of hybrid quantum-classical algorithms were developed and experimentally demonstrated to solve small problems. One of the most promising of such algorithms is Quantum Approximate Optimization Algorithm (QAOA) [8, 9]. QAOA is inspired by adiabatic quantum computation. Similarly to AQC and QA, the evolution path starts with an easy-to-prepare Hamiltonian in the ground state and evolves to the final Hamiltonian that encodes the solution of the problem remaining in the ground state. However, unlike QA in QAOA the evolution is performed by applying a series of parametrized gates called ansatz  which is parametrized by a set of variational parameters. This is accomplished by a hybrid approach that combines quantum evolution and classical variational optimization for optimal QAOA parameters  with the goal of finding the evolution path that prepares the ground state of the problem Hamiltonian.
This work addresses three main challenges. First, we show how to use quantum computing to solve the community detection problem, a well known NP-hard problem. Second, we present an approach to solving realistic large problems using the NISQ hardware with a limited number of noisy qubits. Third, we demonstrate a method that is portable across two leading quantum computation paradigms and can be easily extended to future hardware.
The community detection problem (or modularity graph clustering) has a variety of applications ranging from biology to social network analysis [25, 30, 3, 20]. Its complexity  and practical importance justify an attempt to solve it using QC. The goal of the community detection is to split nodes of a graph into communities by maximizing its modularity :
where are variables indicating node th community assignment, is a degree , and is the adjacency matrix of . In this paper, we will focus on clustering the graph into two communities. There are several approaches to generalize the problem for cases when the number of communities is greater than 2.
The clustering of large networks is currently impossible with existing quantum computers because of the small number of available qubits. This limitation applies both to quantum annealing  and universal quantum computing 
. To tackle large problems using available quantum hardware, we use a hybrid quantum-classical local-search approach. Our approach is inspired by existing numerous local-search heuristics (see for a review). Our algorithm finds a solution to the global community detection problem by selecting subproblems small enough to fit on the target quantum computer, solving them using a quantum algorithm and iterating until the solution to the global problem is found. The outline is presented in Algorithm 1.
In particular, we start with a random community assignment. At each step we select a subproblem (subset of vertices ) by taking the vertices with highest potential gain if moving them from one community to another. The gain for each vertex can be computed efficiently . Then we fix the community assignment of all , encode them into the problem as boundary conditions (denoted by , a typical technique in many heuristics [15, 11]) and maximize
The subproblems are solved using QC. To satisfy the constraints of available hardware, we fix the subproblem size to some small number (in our experiments, it was 25).
3 Implementation details and Results
We implement our local search algorithm in Python using the graph methods provided by NetworkX . The novelty of our approach is that it allows to use D-Wave QA, QAOA and classical Gurobi  solvers interchangeably simply by passing different flags, enabling rapid prototyping and direct comparison of different methods as the hardware and its capabilities evolve. Additionally, Gurobi was used as a global optimization solver for the sake of quality comparison. To our knowledge this is the first attempt to directly compare universal quantum computing and quantum annealing. Our framework is also easily extendable, making it possible for researchers to add new backends as they become available. We plan to release the framework as an open-source project.
Our results are presented in Figure 1. In these experiments, we used the Intel-QS  simulator for QAOA (at the time our group did not have access to a universal quantum computer of sufficient size). We use six real-world networks from the KONECT dataset  with up to 400 nodes as our benchmark. For each network, we ran 30 experiments with different random seeds. The same set of seeds is used between three backend solvers, making the results directly comparable. The subproblem size is fixed at 25 (i.e., 25 qubits are used). Our results demonstrate that the quantum local search approach with both quantum methods is capable of achieving results comparable to state-of-the-art, with a potential to outperform as hardware evolves.
In the near term, quantum hardware will be in a constant state of change. Many different NISQ-era hardware solutions will appear and some will be abandoned. In the midst of such evolutionary times, we want to be able to continue research in quantum algorithms and head towards solving real-world problems. To accomplish this, we need portable, architecture-agnostic hybrid quantum-classical frameworks that will allow solving large-scale computational problems on small-scale quantum architectures. Moreover, these frameworks need to be robust and future-proof. In this work, we have presented a prototype of such a framework for solving the problem of community detection in networks on two distinctively different architectures: D-Wave quantum annealer and universal quantum computer. We suggest extending this approach for solving other types of problems in science.
The constant change of hardware and overall immaturity of the existing technology leads to many risks in QC. In spite of major effort, it has not been experimentally demonstrated yet an ability to achieve speedups over state-of-the-art classical supercomputers and there are valid concerns about scalability of existing implementations . Advances in material design and engineering will allow the community to overcome those hurdles. We expect QC to eventually become a part of the HPC ecosystem with an initial role as an accelerator providing a new layer of parallelism. Our approach will provide for co-design exploration towards the best QC accelerator choice for an application mix.
This research used the resources of the Argonne Leadership Computing Facility, which is a U.S. Department of Energy (DOE) Office of Science User Facility supported under Contract DE-AC02-06CH11357. We gratefully acknowledge the computing resources provided and operated by the Joint Laboratory for System Evaluation (JLSE) at Argonne National Laboratory. The authors would also like to acknowledge the NNSA’s Advanced Simulation and Computing (ASC) program at Los Alamos National Laboratory (LANL) for use of their Ising D-Wave 2X quantum computing resource and D-Wave Systems Inc. for use of their 2000Q resource. The LANL research contribution has been funded by LANL Laboratory Directed Research and Development (LDRD). LANL is operated by Los Alamos National Security, LLC, for the National Nuclear Security Administration of the U.S. DOE under Contract DE-AC52-06NA25396. Clemson University is acknowledged for generous allotment of compute time on Palmetto cluster.
-  A. Ambainis, K. Balodis et al., “Quantum speedups for exponential-time dynamic programming algorithms,” arXiv preprint arXiv:1807.05209, 2018.
-  M. H. S. Amin and A. Y. Smirnov, “Quasiparticle decoherence in D-Wave superconducting qubits,” Phys. Rev. Lett., vol. 92, p. 017001, 2004.
-  G. Bardella, A. Bifone et al., “Hierarchical organization of functional connectivity in the mouse brain: a complex network approach,” Scientific reports, vol. 6, p. 32060, 2016.
-  U. Brandes, D. Delling et al., “Maximizing modularity is hard,” arXiv preprint physics/0608255, 2006.
-  J. Brugger, C. Seidel et al., “Quantum annealing with disorder,” arXiv preprint arXiv:1808.06817, 2018.
-  D-Wave Systems Inc., “Introduction to the D-Wave quantum hardware,” 2018. [Online]. Available: www.dwavesys.com/tutorials/background-reading-series/introduction-d-wave-quantum-hardware
-  V. Dunjko, Y. Ge, and J. I. Cirac, “Computational speedups using small quantum devices,” arXiv preprint arXiv:1807.08970, 2018.
-  E. Farhi, J. Goldstone, and S. Gutmann, “A quantum approximate optimization algorithm,” arXiv preprint arXiv:1411.4028, 2014.
-  E. Farhi and A. W. Harrow, “Quantum supremacy through the quantum approximate optimization algorithm,” arXiv preprint arXiv:1602.07674, 2016.
-  A. A. Hagberg, D. A. Schult, and P. J. Swart, “Exploring network structure, dynamics, and function using networkx,” in Proceedings of the 7th Python in Science Conference (SciPy 2008), G. Varoquaux, T. Vaught, and J. Millman, Eds., Pasadena, CA USA, 2008, pp. 11–15.
-  W. W. Hager, J. T. Hungerford, and I. Safro, “A multilevel bilinear programming algorithm for the vertex separator problem,” Computational Optimization and Applications, vol. 69, no. 1, pp. 189–223, 2018.
R. Harris, Y. Sato et al.
, “Phase transitions in a programmable quantum spin glass simulator,”Science, vol. 361, pp. 162–165, 2017.
-  A. D. King, J. Carrasquilla et al., “Observation of topological phenomena in a programmable lattice of 1,800 qubits,” arXiv preprint arXiv:1803.02047, 2018.
-  J. Kunegis, “Konect: the koblenz network collection,” in Proceedings of the 22nd International Conference on World Wide Web. ACM, 2013, pp. 1343–1350.
-  S. Leyffer and I. Safro, “Fast response to infection spread and cyber attacks on large-scale networks,” Journal of Complex Networks, vol. 1, no. 2, pp. 183–199, 2013.
-  J. R. McClean, J. Romero et al., “The theory of variational hybrid quantum-classical algorithms,” New Journal of Physics, vol. 18, no. 2, p. 023023, 2016.
-  C. C. McGeoch, “Adiabatic quantum computation and quantum annealing: Theory and practice,” Synthesis Lectures on Quantum Computing, vol. 5, no. 2, pp. 1–93, 2014.
-  F. Neukart, G. Compostella et al., “Traffic flow optimization using a quantum annealer,” Frontiers in ICT, vol. 4, pp. 1–6, 2017.
-  M. E. J. Newman, “From the Cover: Modularity and community structure in networks,” Proceedings of the National Academy of Science, vol. 103, pp. 8577–8582, Jun. 2006.
-  C. Nicolini, C. Bordier, and A. Bifone, “Community detection in weighted brain connectivity networks beyond the resolution limit,” Neuroimage, vol. 146, pp. 28–39, 2017.
-  M. A. Nielsen and I. Chuang, “Quantum computation and quantum information,” 2002.
-  D. O’Malley, V. V. Vesselinov et al., “Nonnegative/binary matrix factorization with a D-Wave quantum annealer,” arXiv preprint arXiv:1704.01605, 2017.
-  G. Optimization, “Inc.,“gurobi optimizer reference manual,” 2015,” URL: http://www. gurobi. com, 2014.
-  J. Otterbach, R. Manenti et al., “Unsupervised machine learning on a hybrid quantum computer,” arXiv preprint arXiv:1712.05771, 2017.
-  G. Palla, I. Derényi et al., “Uncovering the overlapping community structure of complex networks in nature and society,” Nature, vol. 435, no. 7043, p. 814, 2005.
-  J. Preskill, “Quantum computing in the nisq era and beyond,” arXiv preprint arXiv:1801.00862, 2018.
-  J. Romero, R. Babbush et al., “Strategies for quantum computing molecular energies using the unitary coupled cluster ansatz,” Quantum Science and Technology, 2018.
-  R. Rotta and A. Noack, “Multilevel local search algorithms for modularity clustering,” Journal of Experimental Algorithmics (JEA), vol. 16, pp. 2–3, 2011.
-  M. Smelyanskiy, N. P. Sawaya, and A. Aspuru-Guzik, “qhipster: the quantum high performance software testing environment,” arXiv preprint arXiv:1601.07195, 2016.
-  G. Su, A. Kuchinsky et al., “Glay: community structure analysis of biological networks,” Bioinformatics, vol. 26, no. 24, pp. 3135–3137, 2010.
-  H. Ushijima-Mwesigwa, C. F. Negre, and S. M. Mniszewski, “Graph partitioning using quantum annealing on the d-wave system,” in Proceedings of the Second International Workshop on Post Moores Era Supercomputing. ACM, 2017, pp. 22–29.
-  Z.-C. Yang, A. Rahmani et al., “Optimizing variational quantum algorithms using pontryagin’s minimum principle,” Physical Review X, vol. 7, no. 2, p. 021027, 2017.