emulating multi-pattern quantum grover's search on a high

3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 Emulating Multi-paern antum Grover’s Search on a High-Performance Reconfigurable Computer Naveed Mahmud, Bennett Haase-Divine, Bailey Kouson Srimoungchanh, Nolan Blankenau, Annika Kuhnke, and Esam El-Araby University of Kansas, Lawrence, KS-66045 {naveed_923,b.haase-divine,srimoungchanh.bailey,nolanblankenau,akkuhnke,esam}@ku.edu ABSTRACT Grover’s search (GS) is a widely studied quantum algorithm that can be employed for both single and multi-pattern search problems and potentially provides quadratic speedup over existing classical search algorithms. In this paper, we propose a multi-pattern quan- tum search methodology based on a modified GS quantum circuit. The proposed method combines classical post-processing permu- tations with a modified Grover’s circuit to efficiently search for given single/multiple input patterns. Our proposed methodology reduces quantum circuit complexity, realizes space-efficient emu- lation hardware and improves overall system configurability for dynamic, multi-pattern search. We use a high-performance recon- figurable computer to emulate multi-pattern GS (MGS) and present scalable emulation architectures of a complete multi-pattern search system. We validate the system and provide analysis of experimen- tal results in terms of FPGA resource utilization and emulation time. Our results include a successful hardware architecture that is capable of emulating MGS algorithm up to 32 fully-entangled quantum bits on a single FPGA. 1 INTRODUCTION Quantum algorithms have the potential to solve classical NP-hard problems in polynomial time [13], thus gaining a supreme advan- tage [4] over existing classical methods. Grover’s quantum search algorithm [3] has a complexity of O ( N ) compared to O (N ) of equivalent classical search algorithms [5], and can be used for data- base queries [6]. In this work, we propose a single-pattern/multi- pattern quantum Grover’s search methodology and demonstrate the corresponding hardware implementation. We generalized Grover’s quantum circuit in our proposed system so that the circuit grows only depending on the number of data items, unlike the conven- tional Grover’s circuit [7] that changes with the target pattern. In our proposed system, the target pattern matching is handled by classical components, while target quantum state amplification [3] is performed by a quantum component. We develop an emulator for the quantum computation and the full system is implemented on a state-of-the-art high-performance reconfigurable computer (HPRC) from DirectStream [8]. We provide experimental results in terms of FPGA resource utilization and emulation time. The obtained results show that the proposed methodology is feasible for use in search applications that require multiple pattern matching [9]. 2 PROPOSED METHODOLOGY FOR MGS An overview of the proposed system is shown in Fig. 1. The algo- rithm takes in two inputs, | 0which is n entangled ground state qubits, and P which is a vector of N patterns entries each consisting of n ancilla bits encoding the pattern(s) to be searched for in | ψ in . First | 0is initialized to a uniform superposition state | ψ in using Hadamard gates H n , then a modified oracle U oracle , followed by a Grover diffusion U diffusion , are applied for m iterations [7, 10]. A permutation step U permute , is performed to set the basis coefficients in the desired order depending on the pattern(s). The output is the quantum state | ψ out , with the target states amplified. Figure 1: Proposed multi-pattern Grover’s search (MGS). 2.1 Modified Oracle Circuit and Diffusion Our implementation for the oracle uses controlled X gates (cX) [7] to dynamically modify the target pattern. Modification of the search pattern allows us to extend and generalize the algorithm for dy- namic search of patterns as seen in Fig. 2a, whereas in conventional GS the oracle is static for any given pattern. For a multi-pattern oracle we cascade single-pattern oracle circuits as seen in Fig. 2b. The diffusion circuit, which is identical to the conventional GS diffusion [7], takes in the output of the oracle circuit and amplifies the corresponding amplitude of the solution(s). 2.2 Quantum State Permutation Our modified design of GS only amplifies the first N patterns indices, therefore the permutation is required to shift the target patterns to the target indices in the output quantum register. In the permutation process, the output vector | ψ out is first initialized to the base low probability value located at index N patterns . Then the amplified indices (0 to N patterns 1) are shifted to the correct indices based on P . We derived the quantum circuit for the permutation using cX gates as shown in Fig. 3a. 3 HARDWARE ARCHITECTURES A high throughput, high precision, and scalable quantum circuit emulator is designed. The emulator determines the output quantum state | ψ out , given an input quantum state | ψ in , and the unitary operation of the quantum algorithm U G . The emulator architecture

Upload: others

Post on 13-Jan-2022

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Emulating Multi-pattern Quantum Grover's Search on a High

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

Emulating Multi-patternQuantum Grover’s Search on aHigh-Performance Reconfigurable Computer

Naveed Mahmud, Bennett Haase-Divine, Bailey Kouson Srimoungchanh, Nolan Blankenau,Annika Kuhnke, and Esam El-ArabyUniversity of Kansas, Lawrence, KS-66045

{naveed_923,b.haase-divine,srimoungchanh.bailey,nolanblankenau,akkuhnke,esam}@ku.edu

ABSTRACTGrover’s search (GS) is a widely studied quantum algorithm thatcan be employed for both single and multi-pattern search problemsand potentially provides quadratic speedup over existing classicalsearch algorithms. In this paper, we propose a multi-pattern quan-tum search methodology based on a modified GS quantum circuit.The proposed method combines classical post-processing permu-tations with a modified Grover’s circuit to efficiently search forgiven single/multiple input patterns. Our proposed methodologyreduces quantum circuit complexity, realizes space-efficient emu-lation hardware and improves overall system configurability fordynamic, multi-pattern search. We use a high-performance recon-figurable computer to emulate multi-pattern GS (MGS) and presentscalable emulation architectures of a complete multi-pattern searchsystem. We validate the system and provide analysis of experimen-tal results in terms of FPGA resource utilization and emulationtime. Our results include a successful hardware architecture thatis capable of emulating MGS algorithm up to 32 fully-entangledquantum bits on a single FPGA.

1 INTRODUCTIONQuantum algorithms have the potential to solve classical NP-hardproblems in polynomial time [1–3], thus gaining a supreme advan-tage [4] over existing classical methods. Grover’s quantum searchalgorithm [3] has a complexity of O(

√N ) compared to O(N ) of

equivalent classical search algorithms [5], and can be used for data-base queries [6]. In this work, we propose a single-pattern/multi-pattern quantumGrover’s searchmethodology and demonstrate thecorresponding hardware implementation. We generalized Grover’squantum circuit in our proposed system so that the circuit growsonly depending on the number of data items, unlike the conven-tional Grover’s circuit [7] that changes with the target pattern. Inour proposed system, the target pattern matching is handled byclassical components, while target quantum state amplification [3]is performed by a quantum component. We develop an emulator forthe quantum computation and the full system is implemented on astate-of-the-art high-performance reconfigurable computer (HPRC)from DirectStream [8]. We provide experimental results in terms ofFPGA resource utilization and emulation time. The obtained resultsshow that the proposed methodology is feasible for use in searchapplications that require multiple pattern matching [9].

2 PROPOSED METHODOLOGY FOR MGSAn overview of the proposed system is shown in Fig. 1. The algo-rithm takes in two inputs, |0⟩ which is n entangled ground statequbits, and P which is a vector of Npatterns entries each consisting

of n ancilla bits encoding the pattern(s) to be searched for in |ψin⟩.First |0⟩ is initialized to a uniform superposition state |ψin⟩ usingHadamard gates H ⊗n , then a modified oracle Uoracle, followed bya Grover diffusionUdiffusion, are applied form iterations [7, 10]. Apermutation stepUpermute, is performed to set the basis coefficientsin the desired order depending on the pattern(s). The output is thequantum state |ψout ⟩, with the target states amplified.

Figure 1: Proposed multi-pattern Grover’s search (MGS).

2.1 Modified Oracle Circuit and DiffusionOur implementation for the oracle uses controlled X gates (cX) [7]to dynamically modify the target pattern. Modification of the searchpattern allows us to extend and generalize the algorithm for dy-namic search of patterns as seen in Fig. 2a, whereas in conventionalGS the oracle is static for any given pattern. For a multi-patternoracle we cascade single-pattern oracle circuits as seen in Fig. 2b.The diffusion circuit, which is identical to the conventional GSdiffusion [7], takes in the output of the oracle circuit and amplifiesthe corresponding amplitude of the solution(s).

2.2 Quantum State PermutationOurmodified design of GS only amplifies the firstNpatterns indices,therefore the permutation is required to shift the target patterns tothe target indices in the output quantum register. In the permutationprocess, the output vector |ψout ⟩ is first initialized to the base lowprobability value located at index Npatterns . Then the amplifiedindices (0 to Npatterns − 1) are shifted to the correct indices basedon P . We derived the quantum circuit for the permutation using cXgates as shown in Fig. 3a.

3 HARDWARE ARCHITECTURESA high throughput, high precision, and scalable quantum circuitemulator is designed. The emulator determines the output quantumstate |ψout ⟩, given an input quantum state |ψin⟩, and the unitaryoperation of the quantum algorithmUG . The emulator architecture

Page 2: Emulating Multi-pattern Quantum Grover's Search on a High

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

SC’19, November, Denver, CO, USA Mahmud et al.

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

(a) Modified oracle for single-pattern GS.

(b) Modified oracle for MGS.Figure 2: Oracle circuit.

(a) Quantum circuit. (b) Classical circuit.

Figure 3: Permutation model for modified MGS.consists of complex multiply-and-accumulate (CMAC) hardwareunits that perform complex vector-matrix and matrix-matrix mul-tiplications efficiently. We used single-precision floating-point tomodel qubits and quantum operations. For example, the complexcoefficients describing qubits and quantum states are representedusing 64 bits, with 32 floating-point bits for the real and imaginarycomponents respectively.

For emulating theUpermute circuit in Fig. 3a on classical hard-ware we implement a space-efficient design using methods likeindex scheduling, since quantum permutation is basically swap-ping of basis coefficients of the quantum input/output states. Thehardware architecture of the index scheduler for permutation isshown in Fig. 3b. In this scheduler, each output register index Aoutis matched with each target pattern, P1, P2, ..., Pi , ..., PNpatterns inthe set of target patterns, P . If there is a match, the input registerindex Ain is set to zero, and if otherwise, Ain is set to Npatterns .This design is based on the previously discussed permutation modelin Section 2.2.

4 EXPERIMENTAL RESULTS AND ANALYSISThe proposed emulator and hardware architectures were imple-mented on DirectStream (DS8) [8], a state-of-the-art high perfor-mance reconfigurable computing (HPRC) system. Simulation andhardware builds were performed using Quartus Prime version 17.0.2

on a high-end Arria 10 10AX115N4F45E3SG FPGA. We have ob-tained experimental results from hardware builds of up to 32 qubitMGS circuits. We utilized 2×32 GB SDRAM banks to store the inputand output quantum state vectors respectively, while the inputalgorithm matrix elements were streamed in. The architecture ofthe compute node used is detailed in [11]. The experimental resultsare shown in Table 1.

Table 1: Experimental results for MGS emulation.

Number of On-chip resource* utilization (%) OBM** utilization (bytes) Emulationqubits ALMs BRAMs DSPs SDRAM time (sec)

2 11 8 1 32 2.3E-064 11 8 1 128 3.4E-066 11 8 1 512 2.0E-058 11 8 1 2K 2.8E-0410 11 8 1 8K 4.5E-0312 11 8 1 32K 7.2E-0214 11 8 1 128K 1.15E016 11 8 1 512K 1.84E0118 11 8 1 2M 2.95E0220 11 8 1 8M 4.72E0322 11 8 1 32M 7.5E0424 11 8 1 128M †1.2E0626 11 8 1 512M †1.93E0728 11 8 1 2G †3.09E0830 11 8 1 8G †4.95E0932 11 8 1 32G †7.92E10

*Total on-chip resources: NALM = 427, 200,NBRAM = 2, 713,NDSP = 1, 518.**Total on-board memory: 4 parallel SRAM banks of 8MB each and 2 parallelSDRAM banks of 32GB each.

†Results are projected using regression.

Table 2: Comparative results with related work.

Simulation Reported Number of Number Precision FrequencyPlatform work search patterns of qubits type (MHz)

CPU Avila et al. [12], 2017 single 21 32-bit floating pt. 3400

GPU Avila et al. [12], 2017 single 21 - 1000Gutiérrez et al. [13], 2010 single 26 32-bit floating pt. 1350

FPGAKhalid et al. [14], 2004 single 3 16-bit fixed pt. 82.1Lee et al. [15], 2016 single 7 24-bit fixed pt. 85Proposed work single/multiple 32 32-bit floating pt. 233

A quantitative comparison with existing work on GS is shown inTable 2. Among existing FPGA-based emulators [14, 15], our workuses the highest precision (32-bit floating-point), highest operatingfrequency (233 MHz), and highest emulated circuit size (32 qubits)on a single FPGA. Implementations on large-scale CPU-based [12]and GPU-based platforms [12, 13] use significantly more resourcescompared to our FPGA-based solution. Moreover, our work is firstto provide both single and multi-pattern Grover’s search in a re-configurable hardware solution.

5 CONCLUSIONS AND FUTUREWORKUntil large-scale quantum hardware are fully functional and capableof running useful applications, the quantum research communityis heavily dependant on alternative methods such as simulationand emulation. In this work, we proposed an efficient methodologyfor multi-pattern Grover’s search (MGS) using a modified quantumGrover’s circuit. We derived corresponding emulation architecturesand implemented them on an HPRC. Our results include emulationof MGS using up to 32 fully-entangled qubits. We plan to use thiswork in the future to develop a complete image pattern recognitionsystem that can be used to identify particle track patterns in HighEnergy Physics (HEP) applications.

Page 3: Emulating Multi-pattern Quantum Grover's Search on a High

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

SC’19, November, Denver, CO, USA

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

REFERENCES[1] David Deutsch. 1985. Quantum theory, the Church-Turing principle and the

universal quantum computer. In Proceedings of the Royal Society of London A, 400,1818 (July 1985), 97-117. DOI:https://doi.org/10.1098/rspa.1985.0070

[2] Peter W. Shor. 1999. Polynomial-Time Algorithms for Prime Factor-ization and Discrete Logarithms on a Quantum Computer. Societyfor Industrial and Applied Mathemetics, 41, 2 (June 1999), 303-332.DOI:https://doi.org/10.1137/S0036144598347011

[3] Lov K. Grover. 1996. A fast quantummechanical algorithm for database search. InProceedings of the twenty-eighth annual ACM symposium on Theory of computing(STOC ’96). Philadelphia, PA, 212-219. DOI:https://doi.org/10.1145/237814.237866

[4] John Preskill. 2018. Quantum Computing in the NISQ era and beyond. Quantum:open journal for quantum science, 2 (Aug. 2018), 79. DOI:https://doi.org/10.22331/q-2018-08-06-79

[5] Lov K. Grover. 1997. Quantum Mechanics Helps in Searching for aNeedle in a Haystack. Physical Review Letters 79, 2 (1997), 325-328.DOI:http://dx.doi.org/10.1103/physrevlett.79.325

[6] Christof Zalka. 2000. Using Grover’s quantum algorithm for searchingactual databases. Physical Review A, 62, 5 (Oct. 2000), 052305. DOI:http://dx.doi.org/10.1103/PhysRevA.62.052305

[7] Michael A. Nielsen, and Isaac Chuang. 2000. QuantumComputation andQuantumInformation. Cambridge University Press.

[8] DirectStream, LLC. Retrieved July, 2019 from https://directstream.com.[9] Tanja Harbaum, Mahmoud Seboui, Matthias Balzer, Jürgen Becker and Marc We-

ber. 2016. A Content Adapted FPGA Memory Architecture with Pattern Recogni-tion Capability for L1 Track Triggering in the LHC Environment. In 24th AnnualInternational Symposium on Field-Programmable Custom Computing Machines(FCCM). IEEE, Washington, DC, USA. DOI:https://doi.org/10.1109/FCCM.2016.52

[10] Michel Boyer, Gilles Brassard, Peter Høyer, and Alain Tapp. 1998. TightBounds on Quantum Searching. Fortschritte der Physik 46, 4-5 (1998),493-505. DOI:http://dx.doi.org/10.1002/(sici)1521-3978(199806)46:4/5<493::aid-prop493>3.0.co;2-p

[11] Naveed Mahmud and Esam El-Araby. 2018. Towards Higher Scalability ofQuantum Hardware Emulation Using Efficient Resource Scheduling. In 2018IEEE International Conference on Rebooting Computing (ICRC) (2018), 1-10.DOI:http://dx.doi.org/10.1109/icrc.2018.8638610

[12] Anderson Avila, Renata H. S. Reiser, Adenauer C. Yamin, and Maurício L. Pilla.2017. Parallel simulation of Shor’s and Grover’s algorithms in the distributedgeometric machine. 2017 13th International Conference on Natural Computation,Fuzzy Systems and Knowledge Discovery (ICNC-FSKD), Guilin, (July 2017), 412-419.DOI:https://doi.org/10.1109/FSKD.2017.8393304

[13] Eladio Gutiérrez, Sergio Romero, María A. Trenas, and Emilio L. Zap-ata. 2010. Quantum Computer Simulation Using the CUDA ProgrammingModel. Computer Physics Communications 181, 2 (November 2010), 283-300.DOI:http://dx.doi.org/10.1016/j.cpc.2009.09.021

[14] Ahmed U. Khalid, Zeljko Zilic, and Katarzyna Radecka. 2004. FPGA emu-lation of quantum circuits. IEEE International Conference on Computer De-sign: VLSI in Computers and Processors (ICCD 04) (October 2004), 310-315.DOI:http://dx.doi.org/10.1109/iccd.2004.1347938

[15] Yee Hui Lee, Mohamed Khalil-Hani, and Muhammad Nadzir Marsono. 2016.An FPGA-Based Quantum Computing Emulation Framework Based on Serial-Parallel Architecture. International Journal of Reconfigurable Computing, (March2016), 1-18. DOI:http://dx.doi.org/10.1155/2016/5718124

[16] Jianxin Chen, Fang Zhang, Cupjin Huang, Michael Newman, and YaoyunShi. 2018. Classical Simulation of Intermediate-Size Quantum Circuits.arXiv:1805.01450 [quant-ph], (May 2018).