quantum-compiler / quartz

The Quartz Quantum Compiler
Apache License 2.0
76 stars 19 forks source link

[Simulator] An alternative simple quadratic DP for simulator #130

Closed xumingkuan closed 11 months ago

xumingkuan commented 11 months ago

Changes to the simulator:

Before (complicated DP):

2 stages.
Kernel info: 13 kernels (10 fusion, 3 shared-memory), cost = 268.5, local qubits 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
Kernel info: 4 kernels (4 fusion, 0 shared-memory), cost = 25.4, local qubits 5 6 7 8 9 10 11 12 13 28 29 30 31 32 19 20 21 22 23 24 25 26 27 0 1 2 3 4
6 seconds.

After https://github.com/quantum-compiler/quartz/commit/22a6d42ddb09b4a0b19d2eee7719286f8f28def6 (simple DP without considering the fact that shared-memory kernels only need the non-insular qubits to be active):

2 stages.
Kernel info: 68 kernels (14 fusion, 54 shared-memory), cost = 582.4, local qubits 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
Kernel info: 4 kernels (4 fusion, 0 shared-memory), cost = 25.4, local qubits 5 6 7 8 9 10 11 12 13 28 29 30 31 32 19 20 21 22 23 24 25 26 27 0 1 2 3 4
0 seconds.

After this PR:

2 stages.
Kernel info: 11 kernels (8 fusion, 3 shared-memory), cost = 271.5, local qubits 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
Kernel info: 4 kernels (4 fusion, 0 shared-memory), cost = 25.4, local qubits 5 6 7 8 9 10 11 12 13 28 29 30 31 32 19 20 21 22 23 24 25 26 27 0 1 2 3 4
0 seconds.

Global changes: