squander 1.9.2__tar.gz → 1.9.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. {squander-1.9.2 → squander-1.9.3}/CMakeLists.txt +5 -2
  2. {squander-1.9.2/squander.egg-info → squander-1.9.3}/PKG-INFO +1 -1
  3. {squander-1.9.2 → squander-1.9.3}/setup.py +1 -1
  4. {squander-1.9.2 → squander-1.9.3}/squander/IO_interfaces/Qiskit_IO.py +10 -3
  5. {squander-1.9.2 → squander-1.9.3}/squander/__init__.py +12 -5
  6. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/CMakeLists.txt +60 -11
  7. squander-1.9.3/squander/decomposition/qgd_N_Qubit_Decomposition_Tabu_Search.py +381 -0
  8. squander-1.9.3/squander/decomposition/qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp +1988 -0
  9. squander-1.9.3/squander/decomposition/qgd_N_Qubit_Decomposition_Tree_Search.py +384 -0
  10. squander-1.9.2/squander/decomposition/qgd_N_Qubit_Decomposition_non_unitary_adaptive_Wrapper.cpp → squander-1.9.3/squander/decomposition/qgd_N_Qubit_Decomposition_Tree_Search_Wrapper.cpp +151 -823
  11. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/qgd_N_Qubit_Decomposition_adaptive.py +0 -1
  12. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/qgd_N_Qubit_Decomposition_custom.py +20 -0
  13. squander-1.9.3/squander/decomposition/qgd_Wide_Circuit_Optimization.py +15 -0
  14. {squander-1.9.2 → squander-1.9.3}/squander/gates/CMakeLists.txt +82 -0
  15. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_CH_Wrapper.cpp +25 -4
  16. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_CNOT_Wrapper.cpp +27 -4
  17. squander-1.9.3/squander/gates/qgd_CROT.py +115 -0
  18. squander-1.9.3/squander/gates/qgd_CROT_Wrapper.cpp +493 -0
  19. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_CRY_Wrapper.cpp +48 -7
  20. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_CZ_Wrapper.cpp +25 -3
  21. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_Circuit.py +137 -24
  22. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_Circuit_Wrapper.cpp +386 -9
  23. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_H_Wrapper.cpp +25 -3
  24. squander-1.9.3/squander/gates/qgd_R.py +129 -0
  25. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_RX_Wrapper.cpp +50 -7
  26. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_RY_Wrapper.cpp +46 -7
  27. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_RZ_Wrapper.cpp +46 -2
  28. squander-1.9.3/squander/gates/qgd_R_Wrapper.cpp +541 -0
  29. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_SX_Wrapper.cpp +25 -3
  30. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_U3_Wrapper.cpp +47 -8
  31. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_X_Wrapper.cpp +25 -3
  32. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_Y_Wrapper.cpp +26 -4
  33. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_Z_Wrapper.cpp +25 -3
  34. squander-1.9.3/squander/partitioning/__pycache__/partition.cpython-310.pyc +0 -0
  35. squander-1.9.3/squander/partitioning/partition.py +201 -0
  36. squander-1.9.3/squander/src-cpp/common/GrayCode.cpp +29 -0
  37. squander-1.9.3/squander/src-cpp/common/include/GrayCode.h +44 -0
  38. squander-1.9.3/squander/src-cpp/common/include/GrayCodeHash.h +41 -0
  39. squander-1.9.3/squander/src-cpp/common/include/GrayCodeHash_base.hpp +81 -0
  40. squander-1.9.3/squander/src-cpp/common/include/GrayCode_base.hpp +274 -0
  41. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/QGDTypes.h +1 -45
  42. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/matrix.h +1 -1
  43. squander-1.9.2/squander/src-cpp/common/include/matrix_base.h → squander-1.9.3/squander/src-cpp/common/include/matrix_base.hpp +1 -1
  44. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/matrix_real.h +1 -1
  45. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/n_aryGrayCodeCounter.h +3 -3
  46. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/n_aryGrayCodeCounter.cpp +3 -3
  47. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/Decomposition_Base.cpp +11 -6
  48. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/N_Qubit_Decomposition.cpp +18 -22
  49. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/N_Qubit_Decomposition_Cost_Function.cpp +10 -0
  50. squander-1.9.3/squander/src-cpp/decomposition/N_Qubit_Decomposition_Tabu_Search.cpp +514 -0
  51. squander-1.9.3/squander/src-cpp/decomposition/N_Qubit_Decomposition_Tree_Search.cpp +795 -0
  52. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/N_Qubit_Decomposition_adaptive.cpp +80 -54
  53. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/N_Qubit_Decomposition_custom.cpp +6 -17
  54. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/Optimization_Interface.cpp +18 -0
  55. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/include/Decomposition_Base.h +2 -0
  56. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/include/N_Qubit_Decomposition_Cost_Function.h +7 -0
  57. squander-1.9.3/squander/src-cpp/decomposition/include/N_Qubit_Decomposition_Tabu_Search.h +142 -0
  58. squander-1.9.3/squander/src-cpp/decomposition/include/N_Qubit_Decomposition_Tree_Search.h +183 -0
  59. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/include/N_Qubit_Decomposition_adaptive.h +2 -1
  60. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/include/Optimization_Interface.h +1 -1
  61. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/Adaptive.cpp +20 -13
  62. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/CH.cpp +55 -36
  63. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/CNOT.cpp +62 -41
  64. squander-1.9.3/squander/src-cpp/gates/CROT.cpp +666 -0
  65. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/CRY.cpp +19 -16
  66. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/CZ.cpp +47 -36
  67. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/CZ_NU.cpp +49 -39
  68. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/Composite.cpp +8 -4
  69. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/Gate.cpp +40 -0
  70. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/Gates_block.cpp +277 -149
  71. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/H.cpp +42 -33
  72. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/ON.cpp +7 -4
  73. squander-1.9.3/squander/src-cpp/gates/R.cpp +342 -0
  74. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/RX.cpp +56 -52
  75. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/RY.cpp +56 -53
  76. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/RZ.cpp +59 -54
  77. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/RZ_P.cpp +60 -54
  78. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/SX.cpp +37 -32
  79. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/SYC.cpp +48 -37
  80. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/U3.cpp +78 -72
  81. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/UN.cpp +7 -4
  82. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/X.cpp +36 -34
  83. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/Y.cpp +36 -36
  84. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/Z.cpp +36 -33
  85. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/custom_kernel_1qubit_gate.cpp +35 -33
  86. squander-1.9.3/squander/src-cpp/gates/include/CROT.h +92 -0
  87. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/Gate.h +13 -2
  88. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/Gates_block.h +55 -3
  89. squander-1.9.3/squander/src-cpp/gates/include/R.h +117 -0
  90. squander-1.9.3/squander/src-cpp/gates/kernels/apply_large_kernel_to_input.cpp +509 -0
  91. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/kernels/apply_large_kernel_to_input_AVX.cpp +359 -17
  92. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/kernels/include/apply_large_kernel_to_input.h +6 -1
  93. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/kernels/include/apply_large_kernel_to_input_AVX.h +4 -1
  94. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/optimization_engines/AGENTS.cpp +3 -3
  95. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/optimization_engines/include/RL_experience.h +0 -1
  96. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/variational_quantum_eigensolver/Variational_Quantum_Eigensolver_Base.cpp +9 -16
  97. squander-1.9.3/squander/synthesis/qgd_SABRE.py +394 -0
  98. {squander-1.9.2 → squander-1.9.3}/squander/utils.py +46 -19
  99. {squander-1.9.2 → squander-1.9.3}/squander/variational_quantum_eigensolver/qgd_VQE_Base_Wrapper.cpp +62 -0
  100. {squander-1.9.2 → squander-1.9.3}/squander/variational_quantum_eigensolver/qgd_Variational_Quantum_Eigensolver_Base.py +6 -0
  101. {squander-1.9.2 → squander-1.9.3/squander.egg-info}/PKG-INFO +1 -1
  102. {squander-1.9.2 → squander-1.9.3}/squander.egg-info/SOURCES.txt +26 -6
  103. squander-1.9.2/squander/decomposition/qgd_N_Qubit_Decomposition_non_unitary_adaptive.py +0 -603
  104. squander-1.9.2/squander/decomposition/qgd_SABRE.py +0 -272
  105. squander-1.9.2/squander/src-cpp/decomposition/N_Qubit_Decomposition_non_unitary_adaptive.cpp +0 -1742
  106. squander-1.9.2/squander/src-cpp/decomposition/include/N_Qubit_Decomposition_non_unitary_adaptive.h +0 -267
  107. squander-1.9.2/squander/src-cpp/gates/kernels/apply_large_kernel_to_input.cpp +0 -166
  108. {squander-1.9.2 → squander-1.9.3}/LICENSE +0 -0
  109. {squander-1.9.2 → squander-1.9.3}/MANIFEST.in +0 -0
  110. {squander-1.9.2 → squander-1.9.3}/README.md +0 -0
  111. {squander-1.9.2 → squander-1.9.3}/cmake/check_AVX.cmake +0 -0
  112. {squander-1.9.2 → squander-1.9.3}/pyproject.toml +0 -0
  113. {squander-1.9.2 → squander-1.9.3}/setup.cfg +0 -0
  114. {squander-1.9.2 → squander-1.9.3}/squander/.nfs00000000124a108700000b3d +0 -0
  115. {squander-1.9.2 → squander-1.9.3}/squander/IO_interfaces/__init__.py +0 -0
  116. {squander-1.9.2 → squander-1.9.3}/squander/IO_interfaces/__pycache__/Qiskit_IO.cpython-310.pyc +0 -0
  117. {squander-1.9.2 → squander-1.9.3}/squander/IO_interfaces/__pycache__/Qiskit_IO.cpython-38.pyc +0 -0
  118. {squander-1.9.2 → squander-1.9.3}/squander/IO_interfaces/__pycache__/__init__.cpython-310.pyc +0 -0
  119. {squander-1.9.2 → squander-1.9.3}/squander/IO_interfaces/__pycache__/__init__.cpython-38.pyc +0 -0
  120. {squander-1.9.2 → squander-1.9.3}/squander/__pycache__/__init__.cpython-310.pyc +0 -0
  121. {squander-1.9.2 → squander-1.9.3}/squander/__pycache__/__init__.cpython-38.pyc +0 -0
  122. {squander-1.9.2 → squander-1.9.3}/squander/__pycache__/utils.cpython-310.pyc +0 -0
  123. {squander-1.9.2 → squander-1.9.3}/squander/__pycache__/utils.cpython-38.pyc +0 -0
  124. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/.nfs00000000124a108900000b3e +0 -0
  125. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/.nfs00000000124a108a00000b3f +0 -0
  126. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/.nfs00000000124a108b00000b40 +0 -0
  127. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/__init__.py +0 -0
  128. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/__pycache__/__init__.cpython-310.pyc +0 -0
  129. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/__pycache__/__init__.cpython-38.pyc +0 -0
  130. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/__pycache__/qgd_N_Qubit_Decomposition.cpython-310.pyc +0 -0
  131. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/__pycache__/qgd_N_Qubit_Decomposition.cpython-38.pyc +0 -0
  132. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/__pycache__/qgd_N_Qubit_Decomposition_adaptive.cpython-310.pyc +0 -0
  133. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/__pycache__/qgd_N_Qubit_Decomposition_adaptive.cpython-38.pyc +0 -0
  134. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/__pycache__/qgd_N_Qubit_Decomposition_adaptive.cpython-38.pyc.140703368779504 +0 -0
  135. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/__pycache__/qgd_N_Qubit_Decomposition_custom.cpython-310.pyc +0 -0
  136. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/__pycache__/qgd_N_Qubit_Decomposition_custom.cpython-38.pyc +0 -0
  137. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/__pycache__/qgd_N_Qubit_Decomposition_non_unitary_adaptive.cpython-310.pyc +0 -0
  138. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/__pycache__/qgd_N_Qubit_State_Preparation_adaptive.cpython-310.pyc +0 -0
  139. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/__pycache__/qgd_N_Qubit_State_Preparation_adaptive.cpython-38.pyc +0 -0
  140. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/__pycache__/qgd_SABRE.cpython-310.pyc +0 -0
  141. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/qgd_N_Qubit_Decomposition.py +0 -0
  142. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/qgd_N_Qubit_Decomposition_Wrapper.cpp +0 -0
  143. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/qgd_N_Qubit_Decomposition_adaptive_Wrapper.cpp +0 -0
  144. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/qgd_N_Qubit_Decomposition_custom_Wrapper.cpp +0 -0
  145. {squander-1.9.2 → squander-1.9.3}/squander/decomposition/qgd_N_Qubit_State_Preparation_adaptive.py +0 -0
  146. {squander-1.9.2 → squander-1.9.3}/squander/gates/.nfs00000000124a108c00000b41 +0 -0
  147. {squander-1.9.2 → squander-1.9.3}/squander/gates/.nfs00000000124a108d00000b42 +0 -0
  148. {squander-1.9.2 → squander-1.9.3}/squander/gates/.nfs00000000124a108e00000b43 +0 -0
  149. {squander-1.9.2 → squander-1.9.3}/squander/gates/.nfs00000000124a108f00000b44 +0 -0
  150. {squander-1.9.2 → squander-1.9.3}/squander/gates/.nfs00000000124a109000000b46 +0 -0
  151. {squander-1.9.2 → squander-1.9.3}/squander/gates/.nfs00000000124a109100000b45 +0 -0
  152. {squander-1.9.2 → squander-1.9.3}/squander/gates/.nfs00000000124a109200000b47 +0 -0
  153. {squander-1.9.2 → squander-1.9.3}/squander/gates/.nfs00000000124a109300000b48 +0 -0
  154. {squander-1.9.2 → squander-1.9.3}/squander/gates/.nfs00000000124a109400000b4a +0 -0
  155. {squander-1.9.2 → squander-1.9.3}/squander/gates/.nfs00000000124a109500000b49 +0 -0
  156. {squander-1.9.2 → squander-1.9.3}/squander/gates/.nfs00000000124a109600000b4b +0 -0
  157. {squander-1.9.2 → squander-1.9.3}/squander/gates/.nfs00000000124a109900000b4c +0 -0
  158. {squander-1.9.2 → squander-1.9.3}/squander/gates/.nfs00000000124a109a00000b4d +0 -0
  159. {squander-1.9.2 → squander-1.9.3}/squander/gates/.nfs00000000124a109b00000b4e +0 -0
  160. {squander-1.9.2 → squander-1.9.3}/squander/gates/.nfs00000000124a109c00000b4f +0 -0
  161. {squander-1.9.2 → squander-1.9.3}/squander/gates/__init__.py +0 -0
  162. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/__init__.cpython-310.pyc +0 -0
  163. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/__init__.cpython-38.pyc +0 -0
  164. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_CH.cpython-310.pyc +0 -0
  165. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_CH.cpython-38.pyc +0 -0
  166. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_CNOT.cpython-310.pyc +0 -0
  167. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_CNOT.cpython-38.pyc +0 -0
  168. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_CRY.cpython-310.pyc +0 -0
  169. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_CRY.cpython-38.pyc +0 -0
  170. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_CZ.cpython-310.pyc +0 -0
  171. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_CZ.cpython-38.pyc +0 -0
  172. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_Circuit.cpython-310.pyc +0 -0
  173. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_Circuit.cpython-38.pyc +0 -0
  174. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_H.cpython-310.pyc +0 -0
  175. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_H.cpython-38.pyc +0 -0
  176. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_RX.cpython-310.pyc +0 -0
  177. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_RX.cpython-38.pyc +0 -0
  178. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_RY.cpython-310.pyc +0 -0
  179. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_RY.cpython-38.pyc +0 -0
  180. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_RZ.cpython-310.pyc +0 -0
  181. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_RZ.cpython-38.pyc +0 -0
  182. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_SX.cpython-310.pyc +0 -0
  183. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_SX.cpython-38.pyc +0 -0
  184. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_U3.cpython-310.pyc +0 -0
  185. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_U3.cpython-38.pyc +0 -0
  186. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_X.cpython-310.pyc +0 -0
  187. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_X.cpython-38.pyc +0 -0
  188. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_Y.cpython-310.pyc +0 -0
  189. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_Y.cpython-38.pyc +0 -0
  190. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_Z.cpython-310.pyc +0 -0
  191. {squander-1.9.2 → squander-1.9.3}/squander/gates/__pycache__/qgd_Z.cpython-38.pyc +0 -0
  192. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_CH.py +0 -0
  193. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_CNOT.py +0 -0
  194. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_CRY.py +0 -0
  195. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_CZ.py +0 -0
  196. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_H.py +0 -0
  197. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_RX.py +0 -0
  198. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_RY.py +0 -0
  199. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_RZ.py +0 -0
  200. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_SX.py +0 -0
  201. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_SYC.cpp +0 -0
  202. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_U3.py +0 -0
  203. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_X.py +0 -0
  204. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_Y.py +0 -0
  205. {squander-1.9.2 → squander-1.9.3}/squander/gates/qgd_Z.py +0 -0
  206. {squander-1.9.2 → squander-1.9.3}/squander/nn/.nfs00000000124a109d00000b50 +0 -0
  207. {squander-1.9.2 → squander-1.9.3}/squander/nn/CMakeLists.txt +0 -0
  208. {squander-1.9.2 → squander-1.9.3}/squander/nn/__init__.py +0 -0
  209. {squander-1.9.2 → squander-1.9.3}/squander/nn/__pycache__/__init__.cpython-310.pyc +0 -0
  210. {squander-1.9.2 → squander-1.9.3}/squander/nn/__pycache__/__init__.cpython-38.pyc +0 -0
  211. {squander-1.9.2 → squander-1.9.3}/squander/nn/__pycache__/qgd_nn.cpython-310.pyc +0 -0
  212. {squander-1.9.2 → squander-1.9.3}/squander/nn/__pycache__/qgd_nn.cpython-38.pyc +0 -0
  213. {squander-1.9.2 → squander-1.9.3}/squander/nn/qgd_nn.py +0 -0
  214. {squander-1.9.2 → squander-1.9.3}/squander/nn/qgd_nn_Wrapper.cpp +0 -0
  215. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/Adam.cpp +0 -0
  216. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/BFGS_Powell.cpp +0 -0
  217. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/Bayes_Opt.cpp +0 -0
  218. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/Powells_method.cpp +0 -0
  219. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/common.cpp +0 -0
  220. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/common_DFE.cpp +0 -0
  221. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/config_element.cpp +0 -0
  222. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/dot.cpp +0 -0
  223. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/grad_descend.cpp +0 -0
  224. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/Adam.h +0 -0
  225. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/BFGS_Powell.h +0 -0
  226. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/Bayes_Opt.h +0 -0
  227. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/Config.h +0 -0
  228. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/Config.h.in +0 -0
  229. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/Powells_method.h +0 -0
  230. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/common.h +0 -0
  231. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/common_DFE.h +0 -0
  232. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/config_element.h +0 -0
  233. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/dot.h +0 -0
  234. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/grad_descend.h +0 -0
  235. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/logging.h +0 -0
  236. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/matrix_sparse.h +0 -0
  237. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/mpi_base.h +0 -0
  238. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/include/numpy_interface.h +0 -0
  239. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/logging.cpp +0 -0
  240. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/matrix.cpp +0 -0
  241. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/matrix_real.cpp +0 -0
  242. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/matrix_sparse.cpp +0 -0
  243. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/mpi_base.cpp +0 -0
  244. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/common/numpy_interface.cpp +0 -0
  245. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/Sub_Matrix_Decomposition.cpp +0 -0
  246. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/Sub_Matrix_Decomposition_Cost_Function.cpp +0 -0
  247. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/include/N_Qubit_Decomposition.h +0 -0
  248. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/include/N_Qubit_Decomposition_custom.h +0 -0
  249. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/include/Sub_Matrix_Decomposition.h +0 -0
  250. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/decomposition/include/Sub_Matrix_Decomposition_Cost_Function.h +0 -0
  251. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/Adaptive.h +0 -0
  252. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/CH.h +0 -0
  253. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/CNOT.h +0 -0
  254. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/CRY.h +0 -0
  255. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/CZ.h +0 -0
  256. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/CZ_NU.h +0 -0
  257. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/Composite.h +0 -0
  258. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/H.h +0 -0
  259. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/ON.h +0 -0
  260. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/RX.h +0 -0
  261. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/RY.h +0 -0
  262. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/RZ.h +0 -0
  263. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/RZ_P.h +0 -0
  264. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/SX.h +0 -0
  265. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/SYC.h +0 -0
  266. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/U3.h +0 -0
  267. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/UN.h +0 -0
  268. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/X.h +0 -0
  269. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/Y.h +0 -0
  270. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/Z.h +0 -0
  271. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/include/custom_kernel_1qubit_gate.h +0 -0
  272. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/kernels/apply_kernel_to_input.cpp +0 -0
  273. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/kernels/apply_kernel_to_input_AVX.cpp +0 -0
  274. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/kernels/apply_kernel_to_state_vector_input.cpp +0 -0
  275. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/kernels/apply_kernel_to_state_vector_input_AVX.cpp +0 -0
  276. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/kernels/include/apply_kernel_to_input.h +0 -0
  277. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/kernels/include/apply_kernel_to_input_AVX.h +0 -0
  278. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/kernels/include/apply_kernel_to_state_vector_input.h +0 -0
  279. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/kernels/include/apply_kernel_to_state_vector_input_AVX.h +0 -0
  280. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/squander.egg-info/PKG-INFO +0 -0
  281. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/squander.egg-info/SOURCES.txt +0 -0
  282. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/squander.egg-info/dependency_links.txt +0 -0
  283. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/gates/squander.egg-info/top_level.txt +0 -0
  284. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/nn/NN.cpp +0 -0
  285. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/nn/include/NN.h +0 -0
  286. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/optimization_engines/ADAM.cpp +0 -0
  287. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/optimization_engines/ADAM_BATCHED.cpp +0 -0
  288. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/optimization_engines/BAYES_AGENTS.cpp +0 -0
  289. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/optimization_engines/BAYES_OPT.cpp +0 -0
  290. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/optimization_engines/BFGS.cpp +0 -0
  291. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/optimization_engines/BFGS2.cpp +0 -0
  292. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/optimization_engines/COSINE.cpp +0 -0
  293. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/optimization_engines/GRAD_DESCEND.cpp +0 -0
  294. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/optimization_engines/GRAD_DESCEND_PARAMETER_SHIFT_RULE.cpp +0 -0
  295. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/optimization_engines/RL_experience.cpp +0 -0
  296. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/random_unitary/Random_Orthogonal.cpp +0 -0
  297. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/random_unitary/Random_Unitary.cpp +0 -0
  298. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/random_unitary/include/Random_Orthogonal.h +0 -0
  299. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/random_unitary/include/Random_Unitary.h +0 -0
  300. {squander-1.9.2 → squander-1.9.3}/squander/src-cpp/variational_quantum_eigensolver/include/Variational_Quantum_Eigensolver_Base.h +0 -0
  301. {squander-1.9.2 → squander-1.9.3}/squander/variational_quantum_eigensolver/.nfs00000000124a14fa00000b51 +0 -0
  302. {squander-1.9.2 → squander-1.9.3}/squander/variational_quantum_eigensolver/CMakeLists.txt +0 -0
  303. {squander-1.9.2 → squander-1.9.3}/squander/variational_quantum_eigensolver/__init__.py +0 -0
  304. {squander-1.9.2 → squander-1.9.3}/squander/variational_quantum_eigensolver/__pycache__/__init__.cpython-310.pyc +0 -0
  305. {squander-1.9.2 → squander-1.9.3}/squander/variational_quantum_eigensolver/__pycache__/__init__.cpython-38.pyc +0 -0
  306. {squander-1.9.2 → squander-1.9.3}/squander/variational_quantum_eigensolver/__pycache__/qgd_Variational_Quantum_Eigensolver_Base.cpython-310.pyc +0 -0
  307. {squander-1.9.2 → squander-1.9.3}/squander/variational_quantum_eigensolver/__pycache__/qgd_Variational_Quantum_Eigensolver_Base.cpython-38.pyc +0 -0
  308. {squander-1.9.2 → squander-1.9.3}/squander.egg-info/dependency_links.txt +0 -0
  309. {squander-1.9.2 → squander-1.9.3}/squander.egg-info/top_level.txt +0 -0
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10.2)
3
3
  # CMAKE to create the shared library of the quantum gate decomposition project
4
4
 
5
5
  # set the project name and version
6
- project(CQGD VERSION 1.9.2)
6
+ project(CQGD VERSION 1.9.3)
7
7
 
8
8
  # reuse compilation time linking for use runtime linking
9
9
  SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
@@ -337,6 +337,7 @@ list(APPEND qgd_files
337
337
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/gates/Gate.cpp
338
338
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/gates/UN.cpp
339
339
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/gates/ON.cpp
340
+ ${PROJECT_SOURCE_DIR}/squander/src-cpp/gates/CROT.cpp
340
341
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/gates/Gates_block.cpp
341
342
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/gates/H.cpp
342
343
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/gates/X.cpp
@@ -347,6 +348,7 @@ list(APPEND qgd_files
347
348
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/gates/RY.cpp
348
349
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/gates/CRY.cpp
349
350
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/gates/Adaptive.cpp
351
+ ${PROJECT_SOURCE_DIR}/squander/src-cpp/gates/R.cpp
350
352
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/gates/RX.cpp
351
353
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/gates/RZ.cpp
352
354
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/gates/RZ_P.cpp
@@ -365,7 +367,8 @@ list(APPEND qgd_files
365
367
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/decomposition/N_Qubit_Decomposition_Cost_Function.cpp
366
368
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/decomposition/Sub_Matrix_Decomposition_Cost_Function.cpp
367
369
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/decomposition/Sub_Matrix_Decomposition.cpp
368
- ${PROJECT_SOURCE_DIR}/squander/src-cpp/decomposition/N_Qubit_Decomposition_non_unitary_adaptive.cpp
370
+ ${PROJECT_SOURCE_DIR}/squander/src-cpp/decomposition/N_Qubit_Decomposition_Tree_Search.cpp
371
+ ${PROJECT_SOURCE_DIR}/squander/src-cpp/decomposition/N_Qubit_Decomposition_Tabu_Search.cpp
369
372
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/variational_quantum_eigensolver/Variational_Quantum_Eigensolver_Base.cpp
370
373
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/random_unitary/Random_Unitary.cpp
371
374
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/random_unitary/Random_Orthogonal.cpp
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: squander
3
- Version: 1.9.2
3
+ Version: 1.9.3
4
4
  Summary: C++ library with Python interface to train quantum circuits, quantum gate synthesis and state preparation.
5
5
  Home-page: https://github.com/rakytap/sequential-quantum-gate-decomposer
6
6
  Maintainer: Peter Rakyta
@@ -32,7 +32,7 @@ from skbuild.cmaker import get_cmake_version
32
32
  setup(
33
33
  name="squander",
34
34
  packages= [ 'squander' ],
35
- version='1.9.2',
35
+ version='1.9.3',
36
36
  url="https://github.com/rakytap/sequential-quantum-gate-decomposer",
37
37
  maintainer="Peter Rakyta",
38
38
  maintainer_email="peter.rakyta@ttk.elte.hu",
@@ -43,7 +43,7 @@ from squander import X
43
43
  from squander import Y
44
44
  from squander import Z
45
45
  from squander import SX
46
-
46
+ from squander import R
47
47
 
48
48
 
49
49
 
@@ -73,7 +73,7 @@ def get_Qiskit_Circuit( Squander_circuit, parameters ):
73
73
  elif isinstance( gate, CRY ):
74
74
  # adding CNOT gate to the quantum circuit
75
75
  parameters_gate = gate.Extract_Parameters( parameters )
76
- circuits.cry( parameters_gate[0], gate.get_Control_Qbit(), gate.get_Target_Qbit() )
76
+ circuit.cry( parameters_gate[0], gate.get_Control_Qbit(), gate.get_Target_Qbit() )
77
77
 
78
78
  elif isinstance( gate, CZ ):
79
79
  # adding CZ gate to the quantum circuit
@@ -108,6 +108,10 @@ def get_Qiskit_Circuit( Squander_circuit, parameters ):
108
108
  parameters_gate = gate.Extract_Parameters( parameters )
109
109
  circuit.rz( parameters_gate[0], gate.get_Target_Qbit() )
110
110
 
111
+ elif isinstance( gate, R ):
112
+ # R gate
113
+ parameters_gate = gate.Extract_Parameters( parameters )
114
+ circuit.r( parameters_gate[0],parameters_gate[1], gate.get_Target_Qbit() )
111
115
  elif isinstance( gate, H ):
112
116
  # Hadamard gate
113
117
  circuit.h( gate.get_Target_Qbit() )
@@ -165,7 +169,10 @@ def get_Qiskit_Circuit_inverse( Squander_circuit, parameters ):
165
169
  # adding CNOT gate to the quantum circuit
166
170
  parameters_gate = gate.Extract_Parameters( parameters )
167
171
  circuit.cry( -parameters_gate[0], gate.get_Control_Qbit(), gate.get_Target_Qbit() )
168
-
172
+ elif isinstance( gate, R ):
173
+ # R gate
174
+ parameters_gate = gate.Extract_Parameters( parameters )
175
+ circuit.r( -parameters_gate[0],parameters_gate[1], gate.get_Target_Qbit() )
169
176
  elif isinstance( gate, CZ ):
170
177
  # adding CZ gate to the quantum circuit
171
178
  circuit.cz( gate.get_Control_Qbit(), gate.get_Target_Qbit() )
@@ -1,13 +1,17 @@
1
1
  # python exported interfaces of the SQUANDER package
2
2
 
3
3
 
4
- #decomposition classes
5
- from squander.decomposition.qgd_N_Qubit_Decomposition_non_unitary_adaptive import qgd_N_Qubit_Decomposition_non_unitary_adaptive as N_Qubit_Decomposition_non_unitary_adaptive
4
+ #decomposition classes of narrow circuits (up to 10 qubits)
5
+ from squander.decomposition.qgd_N_Qubit_Decomposition_Tree_Search import qgd_N_Qubit_Decomposition_Tree_Search as N_Qubit_Decomposition_Tree_Search
6
+ from squander.decomposition.qgd_N_Qubit_Decomposition_Tabu_Search import qgd_N_Qubit_Decomposition_Tabu_Search as N_Qubit_Decomposition_Tabu_Search
6
7
  from squander.decomposition.qgd_N_Qubit_Decomposition_adaptive import qgd_N_Qubit_Decomposition_adaptive as N_Qubit_Decomposition_adaptive
7
8
  from squander.decomposition.qgd_N_Qubit_State_Preparation_adaptive import qgd_N_Qubit_State_Preparation_adaptive as N_Qubit_State_Preparation_adaptive
8
9
  from squander.decomposition.qgd_N_Qubit_Decomposition_custom import qgd_N_Qubit_Decomposition_custom as N_Qubit_Decomposition_custom
9
10
  from squander.decomposition.qgd_N_Qubit_Decomposition import qgd_N_Qubit_Decomposition as N_Qubit_Decomposition
10
11
 
12
+ # optimization of wide circuits (optimize wide circuits)
13
+ from squander.decomposition.qgd_Wide_Circuit_Optimization import qgd_Wide_Circuit_Optimization as Wide_Circuit_Optimization
14
+
11
15
  # variational quantum solver
12
16
  from squander.variational_quantum_eigensolver.qgd_Variational_Quantum_Eigensolver_Base import qgd_Variational_Quantum_Eigensolver_Base as Variational_Quantum_Eigensolver
13
17
 
@@ -26,17 +30,20 @@ from squander.gates.qgd_RZ import qgd_RZ as RZ
26
30
  from squander.gates.qgd_SX import qgd_SX as SX
27
31
  from squander.gates.qgd_SYC import qgd_SYC as SYC
28
32
  from squander.gates.qgd_CRY import qgd_CRY as CRY
33
+ from squander.gates.qgd_CROT import qgd_CROT as CROT
34
+ from squander.gates.qgd_R import qgd_R as R
29
35
 
30
36
  # quantum circuit
31
37
  from squander.gates.qgd_Circuit import qgd_Circuit as Circuit
32
38
 
33
39
  #SABRE
34
- from squander.decomposition.qgd_SABRE import qgd_SABRE as SABRE
40
+ from squander.synthesis.qgd_SABRE import qgd_SABRE as SABRE
35
41
 
36
42
  # Qiskit IO
37
43
  from squander.IO_interfaces import Qiskit_IO
38
44
 
45
+ import squander.utils
46
+
47
+
39
48
  ## NN component (experimental interface)
40
49
  from squander.nn.qgd_nn import qgd_nn as NN
41
-
42
- import squander.utils
@@ -97,21 +97,21 @@ install(TARGETS qgd_N_Qubit_Decomposition_adaptive_Wrapper LIBRARY
97
97
  ###############################################################################
98
98
 
99
99
 
100
- add_library( qgd_N_Qubit_Decomposition_non_unitary_adaptive_Wrapper MODULE
101
- ${EXT_DIR}/qgd_N_Qubit_Decomposition_non_unitary_adaptive_Wrapper.cpp
100
+ add_library( qgd_N_Qubit_Decomposition_Tree_Search_Wrapper MODULE
101
+ ${EXT_DIR}/qgd_N_Qubit_Decomposition_Tree_Search_Wrapper.cpp
102
102
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/common/numpy_interface.cpp
103
103
  )
104
104
 
105
105
 
106
- ADD_DEPENDENCIES (qgd_N_Qubit_Decomposition_non_unitary_adaptive_Wrapper qgd)
106
+ ADD_DEPENDENCIES (qgd_N_Qubit_Decomposition_Tree_Search_Wrapper qgd)
107
107
 
108
- target_link_libraries (qgd_N_Qubit_Decomposition_non_unitary_adaptive_Wrapper qgd ${BLAS_LIBRARIES} ${LAPACKE_LIBRARIES} ${TBB_LIB} ${TBBMALLOC_LIB})
108
+ target_link_libraries (qgd_N_Qubit_Decomposition_Tree_Search_Wrapper qgd ${BLAS_LIBRARIES} ${LAPACKE_LIBRARIES} ${TBB_LIB} ${TBBMALLOC_LIB})
109
109
 
110
- python_extension_module(qgd_N_Qubit_Decomposition_non_unitary_adaptive_Wrapper)
110
+ python_extension_module(qgd_N_Qubit_Decomposition_Tree_Search_Wrapper)
111
111
 
112
112
 
113
113
  # adding compile options
114
- target_compile_options(qgd_N_Qubit_Decomposition_non_unitary_adaptive_Wrapper PRIVATE
114
+ target_compile_options(qgd_N_Qubit_Decomposition_Tree_Search_Wrapper PRIVATE
115
115
  ${CXX_FLAGS}
116
116
  "$<$<CONFIG:Debug>:${CXX_FLAGS_DEBUG}>"
117
117
  "$<$<CONFIG:Release>:${CXX_FLAGS_RELEASE}>"
@@ -119,7 +119,7 @@ target_compile_options(qgd_N_Qubit_Decomposition_non_unitary_adaptive_Wrapper PR
119
119
  )
120
120
 
121
121
 
122
- target_include_directories(qgd_N_Qubit_Decomposition_non_unitary_adaptive_Wrapper PRIVATE
122
+ target_include_directories(qgd_N_Qubit_Decomposition_Tree_Search_Wrapper PRIVATE
123
123
  ${PYTHON_INCLUDE_DIR}
124
124
  ${NUMPY_INC_DIR}
125
125
  ${PROJECT_SOURCE_DIR}/squander/src-cpp/decomposition/include
@@ -128,7 +128,7 @@ target_include_directories(qgd_N_Qubit_Decomposition_non_unitary_adaptive_Wrappe
128
128
  ${EXTRA_INCLUDES})
129
129
 
130
130
 
131
- set_target_properties( qgd_N_Qubit_Decomposition_non_unitary_adaptive_Wrapper PROPERTIES
131
+ set_target_properties( qgd_N_Qubit_Decomposition_Tree_Search_Wrapper PROPERTIES
132
132
  INSTALL_RPATH "$ORIGIN/.."
133
133
  LIBRARY_OUTPUT_DIRECTORY ${EXT_DIR}
134
134
  )
@@ -136,12 +136,62 @@ set_target_properties( qgd_N_Qubit_Decomposition_non_unitary_adaptive_Wrapper PR
136
136
 
137
137
 
138
138
 
139
- install(TARGETS qgd_N_Qubit_Decomposition_non_unitary_adaptive_Wrapper LIBRARY
139
+ install(TARGETS qgd_N_Qubit_Decomposition_Tree_Search_Wrapper LIBRARY
140
140
  DESTINATION squander/decomposition)
141
141
 
142
142
 
143
143
 
144
144
 
145
+
146
+ ###############################################################################
147
+
148
+
149
+ add_library( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper MODULE
150
+ ${EXT_DIR}/qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper.cpp
151
+ ${PROJECT_SOURCE_DIR}/squander/src-cpp/common/numpy_interface.cpp
152
+ )
153
+
154
+
155
+ ADD_DEPENDENCIES (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper qgd)
156
+
157
+ target_link_libraries (qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper qgd ${BLAS_LIBRARIES} ${LAPACKE_LIBRARIES} ${TBB_LIB} ${TBBMALLOC_LIB})
158
+
159
+ python_extension_module(qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper)
160
+
161
+
162
+ # adding compile options
163
+ target_compile_options(qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper PRIVATE
164
+ ${CXX_FLAGS}
165
+ "$<$<CONFIG:Debug>:${CXX_FLAGS_DEBUG}>"
166
+ "$<$<CONFIG:Release>:${CXX_FLAGS_RELEASE}>"
167
+ "-DCPYTHON"
168
+ )
169
+
170
+
171
+ target_include_directories(qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper PRIVATE
172
+ ${PYTHON_INCLUDE_DIR}
173
+ ${NUMPY_INC_DIR}
174
+ ${PROJECT_SOURCE_DIR}/squander/src-cpp/decomposition/include
175
+ ${PROJECT_SOURCE_DIR}/squander/src-cpp/gates/include
176
+ ${PROJECT_SOURCE_DIR}/squander/src-cpp/common/include
177
+ ${EXTRA_INCLUDES})
178
+
179
+
180
+ set_target_properties( qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper PROPERTIES
181
+ INSTALL_RPATH "$ORIGIN/.."
182
+ LIBRARY_OUTPUT_DIRECTORY ${EXT_DIR}
183
+ )
184
+
185
+
186
+
187
+
188
+ install(TARGETS qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper LIBRARY
189
+ DESTINATION squander/decomposition)
190
+
191
+
192
+
193
+
194
+
145
195
  ###############################################################################
146
196
 
147
197
 
@@ -187,5 +237,4 @@ set_target_properties( qgd_N_Qubit_Decomposition_custom_Wrapper PROPERTIES
187
237
  install(TARGETS qgd_N_Qubit_Decomposition_custom_Wrapper LIBRARY
188
238
  DESTINATION squander/decomposition)
189
239
 
190
-
191
-
240
+ ###############################################################################
@@ -0,0 +1,381 @@
1
+ ## #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ Created on Tue Jun 30 15:44:26 2020
5
+ Copyright 2020 Peter Rakyta, Ph.D.
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+
19
+ You should have received a copy of the GNU General Public License
20
+ along with this program. If not, see http://www.gnu.org/licenses/.
21
+
22
+ @author: Peter Rakyta, Ph.D.
23
+ """
24
+
25
+ ## \file qgd_N_Qubit_Decomposition_Tabu_Search.py
26
+ ## \brief A QGD Python interface class for the decomposition of N-qubit unitaries into a set of two-qubit and one-qubit gates.
27
+
28
+
29
+ import numpy as np
30
+ from os import path
31
+ from squander.decomposition.qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper import qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper
32
+ from squander.gates.qgd_Circuit import qgd_Circuit
33
+
34
+
35
+
36
+ ##
37
+ # @brief A QGD Python interface class for the decomposition of N-qubit unitaries into U3 and CNOT gates.
38
+ class qgd_N_Qubit_Decomposition_Tabu_Search(qgd_N_Qubit_Decomposition_Tabu_Search_Wrapper):
39
+
40
+
41
+ ##
42
+ # @brief Constructor of the class.
43
+ # @param Umtx_in The unitary matrix to be decomposed
44
+ # @param qbit_num_in The number of qubits spanning the unitary Umtx
45
+ # @param level_limit_max The maximal number of two-qubit gates in the decomposition
46
+ # @param topology_in A list of <target_qubit, control_qubit> pairs describing the connectivity between qubits.
47
+ # @param config std::map conatining custom config parameters
48
+ # @param accelerator_num The number of DFE accelerators used in the calculations
49
+ # @return An instance of the class
50
+ def __init__( self, Umtx, level_limit_max=8, topology=None, config={}, accelerator_num=0 ):
51
+
52
+ ## the number of qubits
53
+ self.qbit_num = int(round( np.log2( len(Umtx) ) ))
54
+
55
+ # validate input parameters
56
+
57
+ topology_validated = list()
58
+ if isinstance(topology, list) or isinstance(topology, tuple):
59
+ for item in topology:
60
+ if isinstance(item, tuple) and len(item) == 2:
61
+ item_validated = (np.intc(item[0]), np.intc(item[1]))
62
+ topology_validated.append(item_validated)
63
+ else:
64
+ print("Elements of topology should be two-component tuples (int, int)")
65
+ return
66
+ elif topology == None:
67
+ pass
68
+ else:
69
+ print("Input parameter topology should be a list of (int, int) describing the connected qubits in the topology")
70
+ return
71
+
72
+
73
+ # config
74
+ if not( type(config) is dict):
75
+ print("Input parameter config should be a dictionary describing the following hyperparameters:") #TODO
76
+ return
77
+
78
+ # call the constructor of the wrapper class
79
+ super().__init__(Umtx, self.qbit_num, level_limit_max, topology=topology_validated, config=config, accelerator_num=accelerator_num)
80
+
81
+
82
+ ##
83
+ # @brief Wrapper function to call the start_decomposition method of C++ class N_Qubit_Decomposition
84
+ # @param prepare_export Logical parameter. Set true to prepare the list of gates to be exported, or false otherwise.
85
+ def Start_Decomposition(self):
86
+
87
+ # call the C wrapper function
88
+ super().Start_Decomposition()
89
+
90
+
91
+ ##
92
+ # @brief Call to reorder the qubits in the matrix of the gate
93
+ # @param qbit_list The reordered list of qubits spanning the matrix
94
+ def Reorder_Qubits( self, qbit_list ):
95
+
96
+ # call the C wrapper function
97
+ super().Reorder_Qubits(qbit_list)
98
+
99
+
100
+ ##
101
+ # @brief @brief Call to print the gates decomposing the initial unitary. These gates brings the intial matrix into unity.
102
+ def List_Gates(self):
103
+
104
+ # call the C wrapper function
105
+ super().List_Gates()
106
+
107
+ ##
108
+ # @brief Export the unitary decomposition into Qiskit format.
109
+ # @return Return with a Qiskit compatible quantum circuit.
110
+ def get_Qiskit_Circuit( self ):
111
+
112
+ from squander import Qiskit_IO
113
+
114
+ squander_circuit = self.get_Circuit()
115
+ parameters = self.get_Optimized_Parameters()
116
+
117
+ return Qiskit_IO.get_Qiskit_Circuit( squander_circuit, parameters )
118
+
119
+
120
+
121
+ ##
122
+ # @brief Call to set unitary matrix from a numpy array
123
+ # @param Umtx_arr numpy complex array
124
+ def set_Unitary( self, Umtx_arr ):
125
+
126
+ return super().set_Unitary( Umtx_arr )
127
+
128
+
129
+ ##
130
+ # @brief Call to set the error tolerance of the decomposition
131
+ # @param tolerance Error tolerance given as a floating point number
132
+ def set_Optimization_Tolerance( self, tolerance ):
133
+
134
+ return super().set_Optimization_Tolerance( tolerance )
135
+
136
+ ##
137
+ # @brief Call to get unitary matrix
138
+ def get_Unitary( self ):
139
+
140
+ return super().get_Unitary()
141
+
142
+ ##
143
+ # @brief Call to export unitary matrix to binary file
144
+ # @param filename string
145
+ def export_Unitary( self, filename ):
146
+
147
+ return super().export_Unitary(filename)
148
+
149
+
150
+ ##
151
+ # @brief Call to get the number of free parameters in the gate structure used for the decomposition
152
+ def get_Parameter_Num( self ):
153
+
154
+ return super().get_Parameter_Num()
155
+
156
+ ##
157
+ # @brief Call to get global phase
158
+ def get_Global_Phase( self ):
159
+
160
+ return super().get_Global_Phase()
161
+
162
+ ##
163
+ # @brief Call to set global phase
164
+ # @param new_global_phase New global phase (in radians)
165
+ def set_Global_Phase( self, new_global_phase ):
166
+
167
+ return super().set_Global_Phase(new_global_phase)
168
+ ##
169
+ # @brief Call to get the name of the SQUANDER project
170
+ def get_Project_Name( self ):
171
+
172
+ return super().get_Project_Name()
173
+
174
+ ##
175
+ # @brief Call to set the name of the SQUANDER project
176
+ # @param project_name_new new project name
177
+ def set_Project_Name( self, project_name_new ):
178
+
179
+ return super().set_Project_Name(project_name_new)
180
+ ##
181
+ # @brief Call to apply global phase on Unitary matrix
182
+ def apply_Global_Phase_Factor( self ):
183
+
184
+ return super().apply_Global_Phase_Factor()
185
+
186
+
187
+ ##
188
+ # @brief Call to set the optimizer used in the gate synthesis process
189
+ # @param optimizer String indicating the optimizer. Possible values: "BFGS" ,"ADAM", "BFGS2", "ADAM_BATCHED", "AGENTS", "COSINE", "AGENTS_COMBINED".
190
+ def set_Optimizer( self, optimizer="BFGS" ):
191
+
192
+ # Set the optimizer
193
+ super().set_Optimizer(optimizer)
194
+
195
+
196
+ ##
197
+ # @brief Call to retrieve the unitary of the circuit
198
+ # @param parameters A float64 numpy array
199
+ def get_Matrix( self, parameters = None ):
200
+
201
+
202
+ if parameters is None:
203
+ print( "get_Matrix: arary of input parameters is None")
204
+ return None
205
+
206
+ return super().get_Matrix( parameters )
207
+
208
+ ##
209
+ # @brief Call to set the optimizer used in the gate synthesis process
210
+ # @param costfnc Variant of the cost function. Input argument 0 stands for FROBENIUS_NORM, 1 for FROBENIUS_NORM_CORRECTION1, 2 for FROBENIUS_NORM_CORRECTION2
211
+ def set_Cost_Function_Variant( self, costfnc=0 ):
212
+
213
+ # Set the optimizer
214
+ super().set_Cost_Function_Variant(costfnc=costfnc)
215
+
216
+
217
+
218
+ ##
219
+ # @brief Call to set the trace offset used in the cost function. In this case Tr(A) = sum_(i-offset=j) A_{ij}
220
+ # @param trace_offset The trace offset to be set
221
+ def set_Trace_Offset( self, trace_offset=0 ):
222
+
223
+ # Set the trace offset
224
+ super().set_Trace_Offset(trace_offset=trace_offset)
225
+
226
+
227
+ ##
228
+ # @brief Call to get the trace offset used in the cost function. In this case Tr(A) = sum_(i-offset=j) A_{ij}
229
+ # @return Returns with the trace offset
230
+ def get_Trace_Offset( self ):
231
+
232
+ # Set the optimizer
233
+ return super().get_Trace_Offset()
234
+
235
+
236
+ ##
237
+ # @brief Call to get the optimized parameters set in numpy array
238
+ # @return Returns with the optimized parameters
239
+ def get_Optimized_Parameters(self):
240
+
241
+ return super().get_Optimized_Parameters()
242
+
243
+
244
+ ##
245
+ # @brief Call to set the parameters which are used as a starting point in the optimization
246
+ # @param A numpy array containing the parameters. The number of parameters can be retrieved with method get_Parameter_Num
247
+ def set_Optimized_Parameters(self, new_params):
248
+
249
+ super().set_Optimized_Parameters(new_params)
250
+
251
+
252
+ ##
253
+ # @brief Call to evaluate the cost function.
254
+ # @param parameters A float64 numpy array. The number of parameters can be retrieved with method get_Parameter_Num
255
+ def Optimization_Problem( self, parameters=None ):
256
+
257
+ if parameters is None:
258
+ print( "Optimization_Problem: array of input parameters is None")
259
+ return None
260
+
261
+ # evaluate the cost function and gradients
262
+ cost_function = super().Optimization_Problem(parameters)
263
+
264
+
265
+ return cost_function
266
+
267
+
268
+ ##
269
+ # @brief Call to evaluate the gradient components.
270
+ # @param parameters A float64 numpy array
271
+ def Optimization_Problem_Grad( self, parameters=None ):
272
+
273
+ if parameters is None:
274
+ print( "Optimization_Problem: array of input parameters is None")
275
+ return None
276
+
277
+ # evaluate the cost function and gradients
278
+ grad = super().Optimization_Problem_Grad(parameters)
279
+
280
+ grad = grad.reshape( (-1,))
281
+
282
+ return grad
283
+
284
+
285
+ ##
286
+ # @brief Call to evaluate the cost function and the gradient components.
287
+ # @param parameters A float64 numpy array
288
+ def Optimization_Problem_Combined( self, parameters=None ):
289
+
290
+ if parameters is None:
291
+ print( "Optimization_Problem_Combined: array of input parameters is None")
292
+ return None
293
+
294
+ # evaluate the cost function and gradients
295
+ cost_function, grad = super().Optimization_Problem_Combined(parameters)
296
+
297
+ grad = grad.reshape( (-1,))
298
+
299
+ return cost_function, grad
300
+
301
+ ##
302
+ # @brief Call to get the number of iterations
303
+ def get_Num_of_Iters(self):
304
+
305
+ return super().get_Num_of_Iters()
306
+
307
+ ##
308
+ # @brief Call to set the maximum number of iterations for each optimization loop
309
+ # @param max_iters int number of maximum iterations each loop
310
+ def set_Max_Iterations(self, max_iters):
311
+
312
+ super().set_Max_Iterations(max_iters)
313
+
314
+ ##
315
+ # @brief call to set the cost function type of the optimization problem
316
+ # @param cost_func int argument 0 stands for FROBENIUS_NORM, 1 for FROBENIUS_NORM_CORRECTION1, 2 for FROBENIUS_NORM_CORRECTION2, 3 for HILBERT_SCHMIDT_TEST, 4 for HILBERT_SCHMIDT_TEST_CORRECTION1, 5 for HILBERT_SCHMIDT_TEST_CORRECTION2 see more at: https://arxiv.org/abs/2210.09191
317
+ def set_Cost_Function_Variant(self, cost_func):
318
+
319
+ super().set_Cost_Function_Variant(cost_func)
320
+
321
+
322
+ ##
323
+ # @brief Call to get the error of the decomposition. (i.e. the final value of the cost function)
324
+ # @return Returns with the error of the decmposition
325
+ def get_Decomposition_Error(self):
326
+
327
+ return super().get_Decomposition_Error()
328
+
329
+
330
+
331
+ ##
332
+ # @brief Call to get the second Rényi entropy
333
+ # @param parameters A float64 numpy array
334
+ # @param input_state A complex array storing the input state. If None |0> is created.
335
+ # @param qubit_list A subset of qubits for which the Rényi entropy should be calculated.
336
+ # @Return Returns with the calculated entropy
337
+ def get_Second_Renyi_Entropy(self, parameters=None, input_state=None, qubit_list=None ):
338
+
339
+ qbit_num = self.get_Qbit_Num()
340
+
341
+ qubit_list_validated = list()
342
+ if isinstance(qubit_list, list) or isinstance(qubit_list, tuple):
343
+ for item in qubit_list:
344
+ if isinstance(item, int):
345
+ qubit_list_validated.append(item)
346
+ qubit_list_validated = list(set(qubit_list_validated))
347
+ else:
348
+ print("Elements of qbit_list should be integers")
349
+ return
350
+ elif qubit_list == None:
351
+ qubit_list_validated = [ x for x in range(qbit_num) ]
352
+
353
+ else:
354
+ print("Elements of qbit_list should be integers")
355
+ return
356
+
357
+
358
+ if parameters is None:
359
+ print( "get_Second_Renyi_entropy: array of input parameters is None")
360
+ return None
361
+
362
+
363
+ if input_state is None:
364
+ matrix_size = 1 << qbit_num
365
+ input_state = np.zeros( (matrix_size,1) )
366
+ input_state[0] = 1
367
+
368
+ # evaluate the entropy
369
+ entropy = super().get_Second_Renyi_Entropy( parameters, input_state, qubit_list_validated)
370
+
371
+
372
+ return entropy
373
+
374
+
375
+
376
+ ##
377
+ # @brief Call to get the number of qubits in the circuit
378
+ # @return Returns with the number of qubits
379
+ def get_Qbit_Num(self):
380
+
381
+ return super().get_Qbit_Num()