luna-quantum 1.0.8rc2__cp311-cp311-win_amd64.whl → 1.0.8rc4__cp311-cp311-win_amd64.whl
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.
Potentially problematic release.
This version of luna-quantum might be problematic. Click here for more details.
- luna_quantum/__init__.py +19 -1
- luna_quantum/__init__.pyi +14 -1
- luna_quantum/_core.cp311-win_amd64.pyd +0 -0
- luna_quantum/_core.pyi +185 -84
- luna_quantum/_utility.py +148 -0
- luna_quantum/_utility.pyi +20 -0
- luna_quantum/exceptions/luna_quantum_call_type_error.py +9 -0
- luna_quantum/factories/usecase_factory.py +32 -0
- luna_quantum/solve/domain/solve_job.py +42 -8
- luna_quantum/solve/interfaces/usecases/__init__.py +4 -0
- luna_quantum/solve/interfaces/usecases/solve_job_get_by_id_usecase_i.py +27 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/__init__.py +1 -1
- luna_quantum/solve/parameters/algorithms/quantum_gate/flex_qaoa/__init__.py +9 -25
- luna_quantum/solve/parameters/algorithms/quantum_gate/flexqaoa/__init__.py +29 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/flexqaoa/config.py +58 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/{flex_qaoa/flex_qaoa.py → flexqaoa/flexqaoa.py} +48 -86
- luna_quantum/solve/parameters/algorithms/quantum_gate/flexqaoa/optimizers.py +53 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/flexqaoa/pipeline.py +164 -0
- luna_quantum/solve/parameters/backends/__init__.py +2 -0
- luna_quantum/solve/parameters/backends/aqarios_gpu.py +17 -0
- luna_quantum/solve/parameters/errors.py +30 -0
- luna_quantum/solve/usecases/solve_job_get_by_id_usecase.py +44 -0
- luna_quantum/solve/usecases/solve_job_get_result_usecase.py +21 -11
- {luna_quantum-1.0.8rc2.dist-info → luna_quantum-1.0.8rc4.dist-info}/METADATA +1 -1
- {luna_quantum-1.0.8rc2.dist-info → luna_quantum-1.0.8rc4.dist-info}/RECORD +28 -20
- luna_quantum/solve/parameters/algorithms/quantum_gate/flex_qaoa/config.py +0 -80
- luna_quantum/solve/parameters/algorithms/quantum_gate/flex_qaoa/optimizers.py +0 -99
- luna_quantum/solve/parameters/algorithms/quantum_gate/flex_qaoa/pipeline.py +0 -87
- {luna_quantum-1.0.8rc2.dist-info → luna_quantum-1.0.8rc4.dist-info}/WHEEL +0 -0
- {luna_quantum-1.0.8rc2.dist-info → luna_quantum-1.0.8rc4.dist-info}/licenses/LICENSE +0 -0
- {luna_quantum-1.0.8rc2.dist-info → luna_quantum-1.0.8rc4.dist-info}/licenses/NOTICE +0 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
luna_quantum-1.0.
|
|
2
|
-
luna_quantum-1.0.
|
|
3
|
-
luna_quantum-1.0.
|
|
4
|
-
luna_quantum-1.0.
|
|
5
|
-
luna_quantum/__init__.py,sha256=
|
|
6
|
-
luna_quantum/__init__.pyi,sha256=
|
|
7
|
-
luna_quantum/_core.cp311-win_amd64.pyd,sha256=
|
|
8
|
-
luna_quantum/_core.pyi,sha256=
|
|
1
|
+
luna_quantum-1.0.8rc4.dist-info/METADATA,sha256=cxEL3-ylYkSr5yiFx4tzrfiQZ6AQzJCTG1QhmezVNbg,1585
|
|
2
|
+
luna_quantum-1.0.8rc4.dist-info/WHEEL,sha256=bNaa2-XeaoMXnkzV391Sm2NgCjpJ3A2VmfN6ZUnNTZA,96
|
|
3
|
+
luna_quantum-1.0.8rc4.dist-info/licenses/LICENSE,sha256=bR2Wj7Il7KNny38LiDGrASo12StUfpReF--OewXD5cw,10349
|
|
4
|
+
luna_quantum-1.0.8rc4.dist-info/licenses/NOTICE,sha256=GHZYA5H4QFAhbhXliAi2SjWWXLjxl4hrHdEPyUbC0r0,601
|
|
5
|
+
luna_quantum/__init__.py,sha256=cDX6B05OrMYC6qE2HzzWIu6OqD4oGSg1dkSGo27JgQY,3919
|
|
6
|
+
luna_quantum/__init__.pyi,sha256=ZMecAvOd63PVKXS6XuYbcT3AhA0mOAmFYk0JMMSwU64,2103
|
|
7
|
+
luna_quantum/_core.cp311-win_amd64.pyd,sha256=M_A931AhNXySPrU9naY8MjUadmr4DYoeNnY6IH16GyQ,6493696
|
|
8
|
+
luna_quantum/_core.pyi,sha256=5YkARdiUjmNbyP7riyyC1IvK3LMkUeodt-oPUt2nSF4,125884
|
|
9
|
+
luna_quantum/_utility.py,sha256=VUjKDi1sialcbuajsnSVx7kKo0DpSLlmksygirjQuRw,6179
|
|
10
|
+
luna_quantum/_utility.pyi,sha256=M77kDpEuZv8LX5Wg1z9hhbg-Gds5hFbz3uVQEmAm9wk,507
|
|
9
11
|
luna_quantum/algorithms/__init__.py,sha256=EoTNO0FXXjPrhpYfN7q9c_nUhmVHk2nEZsbhaVOBh_g,70
|
|
10
12
|
luna_quantum/aqm_overwrites/__init__.py,sha256=ieIVhfslOwrznbvwqu3vNzU_nFIHS1hyeUgIV097WdQ,49
|
|
11
13
|
luna_quantum/aqm_overwrites/model.py,sha256=stqMo97W0nzDLoWmTqwefdu7xgtPAWS46dsxOcJDHpU,6283
|
|
@@ -86,10 +88,11 @@ luna_quantum/errors.py,sha256=9qeMJY-hI1qlBqrWjaESVGx3ujEQuFdqONGgIl107kk,1458
|
|
|
86
88
|
luna_quantum/errors.pyi,sha256=HrStx8_qvXZe3hfDGAtVbnCftKsnqAW7wjLsJjezlp8,9730
|
|
87
89
|
luna_quantum/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
88
90
|
luna_quantum/exceptions/base_luna_quantum_error.py,sha256=Gl65slQxbNJoo8Kgnqif-slshlluCke0O0ow2r5PZE0,91
|
|
91
|
+
luna_quantum/exceptions/luna_quantum_call_type_error.py,sha256=OS7ou6fzwEsCSNlYGbBVrxLssCxqysbsnAjhvtd8lkE,388
|
|
89
92
|
luna_quantum/exceptions/patch_class_field_exists_error.py,sha256=4nmnGlPXp-SjuNX72PETXQ4eZzVpMTxH0eYs1IVDUPQ,408
|
|
90
93
|
luna_quantum/factories/__init__.py,sha256=uetMDQn7uOcq2aytTkV-J0k4rXM4VppriFsN9_y1cIo,166
|
|
91
94
|
luna_quantum/factories/luna_solve_client_factory.py,sha256=KMtWEOeb6S35HNHiCYV6gft_twqBDJDh0yaq_ZuEJQ8,3384
|
|
92
|
-
luna_quantum/factories/usecase_factory.py,sha256=
|
|
95
|
+
luna_quantum/factories/usecase_factory.py,sha256=HjMZ6jDy8_h9chNyx6XWfOCtzPCOl8VZ7kcACunDwyo,16556
|
|
93
96
|
luna_quantum/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
94
97
|
luna_quantum/solve/__init__.py,sha256=j6K4QzAHU6mE6Hq0gWKJlSgkXo4MnPONMUBlpf890fs,320
|
|
95
98
|
luna_quantum/solve/default_token.py,sha256=dMyxO2BS2IrMZqja6aFTkGzkDDxt4mb3Jt3fAw3bqSo,8995
|
|
@@ -98,7 +101,7 @@ luna_quantum/solve/domain/abstract/__init__.py,sha256=QjmDfEn-Wil0xWC5YronLrtyHt
|
|
|
98
101
|
luna_quantum/solve/domain/abstract/luna_algorithm.py,sha256=5wMRpf176TJ529xsBt0ui9UHHPsSzP_t-a7MMKJ2otI,7250
|
|
99
102
|
luna_quantum/solve/domain/abstract/qpu_token_backend.py,sha256=70FZ4RwRygee_ZR8qHmjFTSnlWSZjYSkxauP89jK5_M,1263
|
|
100
103
|
luna_quantum/solve/domain/model_metadata.py,sha256=vDrF21cSAXOBg3aLVHCejV9dWFugJYCpRiXKJaF5yjc,1742
|
|
101
|
-
luna_quantum/solve/domain/solve_job.py,sha256=
|
|
104
|
+
luna_quantum/solve/domain/solve_job.py,sha256=P4wz9fuvDFKcu0YeSFkcQcCfenQrR0EEmQQa0F1c3ks,8022
|
|
102
105
|
luna_quantum/solve/errors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
103
106
|
luna_quantum/solve/errors/incompatible_backend_error.py,sha256=k1qzt2gabHPSsgYjcD_vD8b5I1nB4CwyWYxwTbAnVtY,619
|
|
104
107
|
luna_quantum/solve/errors/model_metadata_missing_error.py,sha256=BNSbjn0s0z6H4uAANl7r7c-uwOucNnknuAvhFNa3rZM,374
|
|
@@ -107,7 +110,7 @@ luna_quantum/solve/errors/token_missing_error.py,sha256=QKV5RCx6gXw8eJZQsW8xlkWh
|
|
|
107
110
|
luna_quantum/solve/interfaces/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
108
111
|
luna_quantum/solve/interfaces/algorithm_i.py,sha256=RGYnx8TfSSa9BwudB_euZ1SebKgMMyJwHKDnfBcmTJQ,1714
|
|
109
112
|
luna_quantum/solve/interfaces/backend_i.py,sha256=Y7llgjGi3DUGV6SGXPpfOnAI1mWoWzMYofCTJkRwx_k,630
|
|
110
|
-
luna_quantum/solve/interfaces/usecases/__init__.py,sha256=
|
|
113
|
+
luna_quantum/solve/interfaces/usecases/__init__.py,sha256=3-T0t6iQXFQSCQr-cTSzQtiDfcB2n0zM9EJH2VfcrW8,1580
|
|
111
114
|
luna_quantum/solve/interfaces/usecases/model_delete_usecase_i.py,sha256=AX1Ln63LQ9_zU3CqpECxAcWXnmTjo1pEu3eskS6Jy2k,675
|
|
112
115
|
luna_quantum/solve/interfaces/usecases/model_fetch_metadata_usecase_i.py,sha256=86SIolif7Ctr0ZHyBWI5x56wjhRi-p_B14Z0qT9cxHM,923
|
|
113
116
|
luna_quantum/solve/interfaces/usecases/model_get_solutions_usecase_i.py,sha256=yNHFrABV05xrkLfV3W3U8bgIwnyTSbX_cdbm8FPhiGE,873
|
|
@@ -120,6 +123,7 @@ luna_quantum/solve/interfaces/usecases/solve_job_cancel_usecase_i.py,sha256=71yO
|
|
|
120
123
|
luna_quantum/solve/interfaces/usecases/solve_job_create_usecase_i.py,sha256=f0U1_oKZQz9aqQHPIIx8ehEM1x0_xX5VD8n80fWFbUA,1378
|
|
121
124
|
luna_quantum/solve/interfaces/usecases/solve_job_delete_usecase_i.py,sha256=qX0RCXM5eRT8QvMlweM085A_-02Rv5fZTR_IqLuVD5U,815
|
|
122
125
|
luna_quantum/solve/interfaces/usecases/solve_job_fetch_updates_usecase_i.py,sha256=qKbiZ91LhXnNGqydTNSqpVzfodBaxEgI29w69rbjaV8,1116
|
|
126
|
+
luna_quantum/solve/interfaces/usecases/solve_job_get_by_id_usecase_i.py,sha256=BPm0zfo_lgDOS_QsFX3mJubFg7ayBkemnQpSkCxvSEE,783
|
|
123
127
|
luna_quantum/solve/interfaces/usecases/solve_job_get_result_usecase_i.py,sha256=rmlf0ratcQsLgYfVC1-nKmsWbY6EFtlJv558LUfQI-g,2103
|
|
124
128
|
luna_quantum/solve/parameters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
125
129
|
luna_quantum/solve/parameters/algorithms/__init__.py,sha256=OkVSAdQXVxV0v-vs3YP5pXF6GocPnLQjVsQobDwZETM,1349
|
|
@@ -149,12 +153,13 @@ luna_quantum/solve/parameters/algorithms/quantum_annealing/population_annealing_
|
|
|
149
153
|
luna_quantum/solve/parameters/algorithms/quantum_annealing/qbsolv_like_qpu.py,sha256=bOJWhYYcTCHUaBPYTLP6beOuHEfT8X5Dj6O101X1Dqw,4188
|
|
150
154
|
luna_quantum/solve/parameters/algorithms/quantum_annealing/quantum_annealing.py,sha256=AcYhvDS8--ZRmg21xDDZIA3pYmb8o7cfFQtt9YldoY4,5019
|
|
151
155
|
luna_quantum/solve/parameters/algorithms/quantum_annealing/repeated_reverse_quantum_annealing.py,sha256=MwJoT_uNnv1VkqLpYZXtLQ13BZw1iV5AKkwrYECQeBw,8614
|
|
152
|
-
luna_quantum/solve/parameters/algorithms/quantum_gate/__init__.py,sha256=
|
|
153
|
-
luna_quantum/solve/parameters/algorithms/quantum_gate/flex_qaoa/__init__.py,sha256=
|
|
154
|
-
luna_quantum/solve/parameters/algorithms/quantum_gate/
|
|
155
|
-
luna_quantum/solve/parameters/algorithms/quantum_gate/
|
|
156
|
-
luna_quantum/solve/parameters/algorithms/quantum_gate/
|
|
157
|
-
luna_quantum/solve/parameters/algorithms/quantum_gate/
|
|
156
|
+
luna_quantum/solve/parameters/algorithms/quantum_gate/__init__.py,sha256=jEpaAQ-zm4-oZf8CykoSnHcrpLdGbczaamEbOF9ytqU,160
|
|
157
|
+
luna_quantum/solve/parameters/algorithms/quantum_gate/flex_qaoa/__init__.py,sha256=qfEzIwVC9226WRuc27vNczoqaDOjpEY2xsJjECV3GoY,288
|
|
158
|
+
luna_quantum/solve/parameters/algorithms/quantum_gate/flexqaoa/__init__.py,sha256=eQjOLNHT0fMx0-U8tQ1y8qukbcD0U99fUl7Z4uEO0AA,694
|
|
159
|
+
luna_quantum/solve/parameters/algorithms/quantum_gate/flexqaoa/config.py,sha256=SbweG-GxTBVUfpZVdqjDNhhX8SBK49ZJcRK9U5j8sh4,2310
|
|
160
|
+
luna_quantum/solve/parameters/algorithms/quantum_gate/flexqaoa/flexqaoa.py,sha256=xWojuQht57ojC4dgdMwBoj3nf3xPRbbbiQCOCGOTyX4,8089
|
|
161
|
+
luna_quantum/solve/parameters/algorithms/quantum_gate/flexqaoa/optimizers.py,sha256=Mp-WV_e9ynkGVuj2E4O5q8XLz0FRVHFtB9vskbUrU0c,1812
|
|
162
|
+
luna_quantum/solve/parameters/algorithms/quantum_gate/flexqaoa/pipeline.py,sha256=6K2ZobkvlY11fa7JEy94lFdKmyHzScs8jknXjUJYbP4,5468
|
|
158
163
|
luna_quantum/solve/parameters/algorithms/quantum_gate/qaoa.py,sha256=IE_Y1DgTI6wMjzq_L0VHitA87XXx9D3l6cftzvYqfgo,3945
|
|
159
164
|
luna_quantum/solve/parameters/algorithms/quantum_gate/qaoa_fo.py,sha256=xPTab8Mb-qY7hfvMZ0HAsv0RZZ5qGMYZSPvenqPJz5g,2656
|
|
160
165
|
luna_quantum/solve/parameters/algorithms/quantum_gate/vqe.py,sha256=2UhHuGEfC9B3V6UKQK8zOlg8JAfAAT3w_nqNv8NDNvs,3983
|
|
@@ -168,8 +173,9 @@ luna_quantum/solve/parameters/algorithms/simulated_annealing/population_annealin
|
|
|
168
173
|
luna_quantum/solve/parameters/algorithms/simulated_annealing/qbsolv_like_simulated_annealing.py,sha256=_Nlo0MeIyqSHVzmYPNFH_bNgY_GXo7PNwLAQyjm_s1I,6724
|
|
169
174
|
luna_quantum/solve/parameters/algorithms/simulated_annealing/repeated_reverse_simulated_annealing.py,sha256=vrNYGwwEPhm2Ad-SXm7ynv3NL3-wPX0-VY92-4pdE4M,8392
|
|
170
175
|
luna_quantum/solve/parameters/algorithms/simulated_annealing/simulated_annealing.py,sha256=EyvYWVDJiHTKJB0TiX8vcZvhRi2v551a5IKYgolSMzs,5786
|
|
171
|
-
luna_quantum/solve/parameters/backends/__init__.py,sha256=
|
|
176
|
+
luna_quantum/solve/parameters/backends/__init__.py,sha256=oAZw4v3JA_TDYp-Bhy2BO2GmGjLsR8E2Oifv7kEcsic,466
|
|
172
177
|
luna_quantum/solve/parameters/backends/aqarios.py,sha256=B13jMYYNSRMB90tHiSgef9xFUrc_fklsLfaJTGZj7PY,381
|
|
178
|
+
luna_quantum/solve/parameters/backends/aqarios_gpu.py,sha256=NeMNUEj94Dx6IQDVM55JliKKE8h8xP1hgqg0tt30FW4,392
|
|
173
179
|
luna_quantum/solve/parameters/backends/aws/__init__.py,sha256=PLCSdxAUF65wzV0GP5gRBfRT3Ev9UfoczOs5PGOR-v0,169
|
|
174
180
|
luna_quantum/solve/parameters/backends/aws/aws.py,sha256=WPWX1ZZhbBYgJd52a6UuWxtX48NqVjpJLx1Ytdu82WY,1155
|
|
175
181
|
luna_quantum/solve/parameters/backends/aws/aws_backend_base.py,sha256=HAomLB7a2ABQG-_aUxnK3WN8BfKjIgalMk8nbUvZKNc,2439
|
|
@@ -183,6 +189,7 @@ luna_quantum/solve/parameters/backends/ibm.py,sha256=4T7vNcyrG2IAAR-LuJMQZKdndhq
|
|
|
183
189
|
luna_quantum/solve/parameters/backends/qctrl.py,sha256=W0BzW6HqcuynQOsm1HP38PUMB2AYMz2FC5LvUa8DJ5U,3606
|
|
184
190
|
luna_quantum/solve/parameters/backends/zib.py,sha256=_hqSR5RyVJ5TBIUTPUHoCf-h--THt2jP5hRJkggMUCw,369
|
|
185
191
|
luna_quantum/solve/parameters/constants.py,sha256=-i0Moh5JJZw5yYcX_393rSGw1TMXzNmez1vGoy18tOk,521
|
|
192
|
+
luna_quantum/solve/parameters/errors.py,sha256=0sa_Vn1uD7r2ZcNruVEcXxTxqSRQmr1F_EB0Q7PV9KA,1010
|
|
186
193
|
luna_quantum/solve/parameters/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
187
194
|
luna_quantum/solve/parameters/mixins/fujitsu_common_params_mixin.py,sha256=UKKUo-z9PKaLAWkRlWlxusKKC9fv5CKrnhm8c49mS9M,11098
|
|
188
195
|
luna_quantum/solve/parameters/mixins/fujitsu_v2_mixin.py,sha256=zWPufFTSpwhV8t2Ur5t0zhvlkfRcbz73uDAS2jG2z7I,3552
|
|
@@ -247,7 +254,8 @@ luna_quantum/solve/usecases/solve_job_cancel_usecase.py,sha256=WY9fd6mGW1FyaZ0cv
|
|
|
247
254
|
luna_quantum/solve/usecases/solve_job_create_usecase.py,sha256=KOnLBMTbjv_2v957cpUqbnKGAhy64wIeeMPmkxAyvGs,4046
|
|
248
255
|
luna_quantum/solve/usecases/solve_job_delete_usecase.py,sha256=a-lo9CoWjePo-aq7Y_pHy-bF3HLlyoRHi7rJIYd-Pbw,1166
|
|
249
256
|
luna_quantum/solve/usecases/solve_job_fetch_updates_usecase.py,sha256=9vcs3x5uLmBjkqSF12IMHrPjrPSodm0AHI0qPVAruNE,1735
|
|
250
|
-
luna_quantum/solve/usecases/
|
|
257
|
+
luna_quantum/solve/usecases/solve_job_get_by_id_usecase.py,sha256=E6DeHz8GWe2xQVH0zIhcxafZcvWASwLHSJuc8F1oOjQ,1393
|
|
258
|
+
luna_quantum/solve/usecases/solve_job_get_result_usecase.py,sha256=o3P8KALi1erzV19gMLhgRKcjPd_sbrxHOslEOiVaBbo,4012
|
|
251
259
|
luna_quantum/transformations.py,sha256=A00BqmKpZz1Ixrb77a_ynpuqtB7w-AlVshg-QHp2UwM,920
|
|
252
260
|
luna_quantum/transformations.pyi,sha256=rqDnvS_a1sGRezWK6s_QN5FO--XSPo3sFUeQnaqYdF4,11334
|
|
253
261
|
luna_quantum/translator.py,sha256=5RDTzFzd5sw3JzxFQsHdZQWhz2KDl03nzik5dUHebHI,1157
|
|
@@ -261,4 +269,4 @@ luna_quantum/util/pretty_base.py,sha256=tvl9_LeqllYv41RibDuF_gCtO8Z54P1S0DkdGZG5
|
|
|
261
269
|
luna_quantum/util/pydantic_utils.py,sha256=KipyyVaajjFB-krdPl_j5BLogaiPqn0L8mrJuLwZtic,1301
|
|
262
270
|
luna_quantum/utils.py,sha256=RlF0LFK0qXavL22BSjMuNcGBGJrEL8mde_rAPX66qhw,137
|
|
263
271
|
luna_quantum/utils.pyi,sha256=TRV-THwZJdYDD5q3kn4W-p4dslim54xNJW0yFbXPFhs,2001
|
|
264
|
-
luna_quantum-1.0.
|
|
272
|
+
luna_quantum-1.0.8rc4.dist-info/RECORD,,
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
from typing import Literal
|
|
2
|
-
|
|
3
|
-
from pydantic import BaseModel, Field, field_validator
|
|
4
|
-
|
|
5
|
-
from luna_quantum.solve.errors.solve_base_error import SolveBaseError
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class MixerTypeError(SolveBaseError):
|
|
9
|
-
"""Custom Mixer type exception."""
|
|
10
|
-
|
|
11
|
-
def __init__(self) -> None:
|
|
12
|
-
super().__init__("XY-mixer type can only occur once.")
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class XYMixer(BaseModel):
|
|
16
|
-
"""XY-mixer configuration.
|
|
17
|
-
|
|
18
|
-
Attributes
|
|
19
|
-
----------
|
|
20
|
-
types: list[Literal["even", "odd", "last"]]
|
|
21
|
-
XY-ring-mixer pipeline
|
|
22
|
-
"""
|
|
23
|
-
|
|
24
|
-
types: list[Literal["even", "odd", "last"]] = Field(
|
|
25
|
-
default=["even", "odd", "last"],
|
|
26
|
-
description="XY-ring-mixer types and order.",
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
@field_validator("types")
|
|
30
|
-
@classmethod
|
|
31
|
-
def _validate_type_once(
|
|
32
|
-
cls, v: list[Literal["even", "odd", "last"]]
|
|
33
|
-
) -> list[Literal["even", "odd", "last"]]:
|
|
34
|
-
if len(set(v)) < len(v):
|
|
35
|
-
raise MixerTypeError
|
|
36
|
-
return v
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
class AdvancedConfig(BaseModel):
|
|
40
|
-
"""Additional FlexQAOA algorithm configuration.
|
|
41
|
-
|
|
42
|
-
Attributes
|
|
43
|
-
----------
|
|
44
|
-
mixer: XYMixer | Dict
|
|
45
|
-
Mixer types in XY-ring-mixer. Default: `["even", "odd", "last"]`
|
|
46
|
-
parallel_indicators: bool
|
|
47
|
-
Toggle to apply indicator functions in parallel. Does not affect sampling
|
|
48
|
-
performance of QAOA, but only circuit metrics, like number of qubits and
|
|
49
|
-
circuit depth.
|
|
50
|
-
discard_slack: bool
|
|
51
|
-
Discard slack qubits in evaluation, i.e. only measure on the binary variables of
|
|
52
|
-
the initial problem. This requires an auxilary cost function that penalizes
|
|
53
|
-
infeasible solutions.
|
|
54
|
-
infeas_penalty: float | None
|
|
55
|
-
Penalty for infeasible solutions if `discard_slack` is activated. By defalt,
|
|
56
|
-
10 times the max absolute intial bias is chosen.
|
|
57
|
-
"""
|
|
58
|
-
|
|
59
|
-
mixer: XYMixer = Field(
|
|
60
|
-
default_factory=lambda: XYMixer(),
|
|
61
|
-
description='Mixer types in XY-ring-mixer. Default: `["even", "odd", "last"]`',
|
|
62
|
-
)
|
|
63
|
-
parallel_indicators: bool = Field(
|
|
64
|
-
default=True,
|
|
65
|
-
description="Toggle to apply indicator functions in parallel. Does not affect "
|
|
66
|
-
"sampling performance of QAOA, but only circuit metrics, "
|
|
67
|
-
"like number of qubits and circuit depth.",
|
|
68
|
-
)
|
|
69
|
-
discard_slack: bool = Field(
|
|
70
|
-
default=False,
|
|
71
|
-
description="Discard slack qubits in evaluation, i.e. only measure on the "
|
|
72
|
-
"binary variables of the initial problem. This requires an auxilary cost "
|
|
73
|
-
"function that penalizes infeasible solutions.",
|
|
74
|
-
)
|
|
75
|
-
infeas_penalty: float | None = Field(
|
|
76
|
-
default=None,
|
|
77
|
-
ge=0,
|
|
78
|
-
description="Penalty for infeasible solutions if `discard_slack` is activated."
|
|
79
|
-
"By defalt, 10 times the max absolute intial bias is chosen.",
|
|
80
|
-
)
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
from typing import Literal
|
|
2
|
-
|
|
3
|
-
from pydantic import BaseModel, Field
|
|
4
|
-
|
|
5
|
-
from luna_quantum.solve.parameters.algorithms.base_params.scipy_optimizer import (
|
|
6
|
-
ScipyOptimizerParams,
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class LinearOptimizerParams(ScipyOptimizerParams):
|
|
11
|
-
"""Optimizer for tuning a linear schedule of QAOA parameters.
|
|
12
|
-
|
|
13
|
-
Optimizes onyl two parameters: `delta_beta` and `delta_gamma` with the default
|
|
14
|
-
ScipyOptimizer.
|
|
15
|
-
|
|
16
|
-
Wrapper for scipy.optimize.minimize. See
|
|
17
|
-
[SciPy minimize documentation](
|
|
18
|
-
https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html)
|
|
19
|
-
for more information of the available methods and parameters.
|
|
20
|
-
|
|
21
|
-
Attributes
|
|
22
|
-
----------
|
|
23
|
-
method: ScipyOptimizerMethod
|
|
24
|
-
Type of solver. See
|
|
25
|
-
[SciPy minimize documentation](
|
|
26
|
-
https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html)
|
|
27
|
-
for supported methods.
|
|
28
|
-
tol: float | None
|
|
29
|
-
Tolerance for termination.
|
|
30
|
-
bounds: None | tuple[float, float] | list[tuple[float, float]]
|
|
31
|
-
Bounds on variables for Nelder-Mead, L-BFGS-B, TNC, SLSQP, Powell,
|
|
32
|
-
trust-constr, COBYLA, and COBYQA methods. None is used to specify no bounds,
|
|
33
|
-
`(min, max)` is used to specify bounds for all variables. A sequence of
|
|
34
|
-
`(min, max)` can be used to specify bounds for each parameter individually.
|
|
35
|
-
jac: None | Literal["2-point", "3-point", "cs"]
|
|
36
|
-
Method for computing the gradient vector. Only for CG, BFGS, Newton-CG,
|
|
37
|
-
L-BFGS-B, TNC, SLSQP, dogleg, trust-ncg, trust-krylov, trust-exact and
|
|
38
|
-
trust-constr.
|
|
39
|
-
hess: None | Literal["2-point", "3-point", "cs"]
|
|
40
|
-
Method for computing the Hessian matrix. Only for Newton-CG, dogleg, trust-ncg,
|
|
41
|
-
trust-krylov, trust-exact and trust-constr.
|
|
42
|
-
maxiter: int
|
|
43
|
-
Maximum number of iterations to perform. Depending on the method
|
|
44
|
-
each iteration may use several function evaluations. Will be ignored for TNC
|
|
45
|
-
optimizer. Default: 100
|
|
46
|
-
options: dict[str, float]
|
|
47
|
-
A dictionary of solver options.
|
|
48
|
-
"""
|
|
49
|
-
|
|
50
|
-
optimizer_type: Literal["linear"] = "linear"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
class CombinedOptimizerParams(BaseModel):
|
|
54
|
-
"""Combination of LinearOptimizer and ScipyOptimizer.
|
|
55
|
-
|
|
56
|
-
Optimizer that first performs an optimization of the linear schedule and then
|
|
57
|
-
fine tunes individual parameters.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Attributes
|
|
61
|
-
----------
|
|
62
|
-
linear: LinearOptimizerParams | Dict
|
|
63
|
-
Parameters of the linear optimizer.
|
|
64
|
-
fine_tune: ScipyOptimizerParams | Dict
|
|
65
|
-
Parameters of the fine tuning optimizer.
|
|
66
|
-
"""
|
|
67
|
-
|
|
68
|
-
optimizer_type: Literal["combined"] = "combined"
|
|
69
|
-
linear: LinearOptimizerParams = Field(
|
|
70
|
-
default_factory=lambda: LinearOptimizerParams()
|
|
71
|
-
)
|
|
72
|
-
fine_tune: ScipyOptimizerParams = Field(
|
|
73
|
-
default_factory=lambda: ScipyOptimizerParams()
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class InterpolateOptimizerParams(BaseModel):
|
|
78
|
-
"""Optimizer with sequentially increasing number of QAOA layers.
|
|
79
|
-
|
|
80
|
-
Optimizer that starts with `reps` iteration and interpolates sequentially in
|
|
81
|
-
`reps_step` steps to `reps_end`. In between it performs a full optimization routine
|
|
82
|
-
tunes individual parameters.
|
|
83
|
-
|
|
84
|
-
Attributes
|
|
85
|
-
----------
|
|
86
|
-
optimiezr: LinearOptimizerParams | ScipyOptimizerParams | Dict
|
|
87
|
-
Parameters of the optimizer.
|
|
88
|
-
reps_step: int
|
|
89
|
-
Number of QAOA layers added for one interpolation.
|
|
90
|
-
reps_end: int
|
|
91
|
-
Final number of QAOA layers to be reached.
|
|
92
|
-
"""
|
|
93
|
-
|
|
94
|
-
optimizer_type: Literal["interpolate"] = "interpolate"
|
|
95
|
-
optimizer: ScipyOptimizerParams | LinearOptimizerParams = Field(
|
|
96
|
-
default_factory=lambda: ScipyOptimizerParams()
|
|
97
|
-
)
|
|
98
|
-
reps_step: int = Field(default=1, ge=1)
|
|
99
|
-
reps_end: int = Field(default=10, ge=1)
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
from pydantic import BaseModel, Field
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class OneHotParams(BaseModel):
|
|
5
|
-
"""Implements one-hot constraints through XY-mixers."""
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class IndicatorFunctionParams(BaseModel):
|
|
9
|
-
"""Implements inequality constraints via indicator functions.
|
|
10
|
-
|
|
11
|
-
Attributes
|
|
12
|
-
----------
|
|
13
|
-
penalty: float | None
|
|
14
|
-
Custom penalty factor for indicator functions. If none set, automatically
|
|
15
|
-
determined through upper and lower bounds.
|
|
16
|
-
penalty_scaling: float
|
|
17
|
-
Scaling of automatically determined penalty factor. Default: 2
|
|
18
|
-
"""
|
|
19
|
-
|
|
20
|
-
penalty: float | None = Field(
|
|
21
|
-
default=None,
|
|
22
|
-
ge=0,
|
|
23
|
-
description="Custom penalty factor for indicator functions. If none set, "
|
|
24
|
-
"automatically determined through upper and lower bounds.",
|
|
25
|
-
)
|
|
26
|
-
penalty_scaling: float = Field(
|
|
27
|
-
default=2,
|
|
28
|
-
ge=0,
|
|
29
|
-
description="Scaling of automatically determined penalty factor. Default: 2",
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class QuadraticPenaltyParams(BaseModel):
|
|
34
|
-
"""Implements all constraints through quadratic penalties.
|
|
35
|
-
|
|
36
|
-
Adds penalty terms to the objective. Adds slack variables for inequality constraints
|
|
37
|
-
if neccessaray.
|
|
38
|
-
|
|
39
|
-
Attributes
|
|
40
|
-
----------
|
|
41
|
-
penalty: float | None
|
|
42
|
-
Custom penalty factor for quadratic penalty terms. If none is set, it is
|
|
43
|
-
automatically determined by taking 10 times the maximum absolute initial bias.
|
|
44
|
-
"""
|
|
45
|
-
|
|
46
|
-
penalty: float | None = Field(
|
|
47
|
-
default=None,
|
|
48
|
-
ge=0,
|
|
49
|
-
description="Custom penalty factor for quadratic penalty terms. If none set, "
|
|
50
|
-
"automatically determined by taking 10 times the maximum absolute initial "
|
|
51
|
-
"bias.",
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
class PipelineParams(BaseModel):
|
|
56
|
-
"""Defines the modular Constrained QAOA Pipeline.
|
|
57
|
-
|
|
58
|
-
By default all features are enabled.
|
|
59
|
-
|
|
60
|
-
Attributes
|
|
61
|
-
----------
|
|
62
|
-
indicator_function: IndicatorFunctionParams | Dict | None
|
|
63
|
-
Whether to implement inequality constraints with indicator functions. Disable
|
|
64
|
-
with setting to `None`.
|
|
65
|
-
one_hot: OneHotParams | Dict | None
|
|
66
|
-
Whether to implement inequality constraints with indicator functions. Disable
|
|
67
|
-
with setting to `None`.
|
|
68
|
-
quadratic_penalty: QuadraticPenaltyParams | Dict | None
|
|
69
|
-
Whether to implement inequality constraints with indicator functions. Disable
|
|
70
|
-
with setting to `None`.
|
|
71
|
-
"""
|
|
72
|
-
|
|
73
|
-
indicator_function: IndicatorFunctionParams | None = Field(
|
|
74
|
-
default_factory=lambda: IndicatorFunctionParams(),
|
|
75
|
-
description="Whether to implement inequality constraints with indicator "
|
|
76
|
-
"functions. Disable with setting to `None`.",
|
|
77
|
-
)
|
|
78
|
-
one_hot: OneHotParams | None = Field(
|
|
79
|
-
default_factory=lambda: OneHotParams(),
|
|
80
|
-
description="Whether to implement inequality constraints with indicator "
|
|
81
|
-
"functions. Disable with setting to `None`.",
|
|
82
|
-
)
|
|
83
|
-
quadratic_penalty: QuadraticPenaltyParams | None = Field(
|
|
84
|
-
default_factory=lambda: QuadraticPenaltyParams(),
|
|
85
|
-
description="Whether to implement inequality constraints with indicator "
|
|
86
|
-
"functions. Disable with setting to `None`.",
|
|
87
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|