luna-quantum 0.0.16__py3-none-any.whl → 0.0.33__py3-none-any.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-0.0.16.dist-info → luna_quantum-0.0.33.dist-info}/METADATA +2 -1
- {luna_quantum-0.0.16.dist-info → luna_quantum-0.0.33.dist-info}/RECORD +64 -58
- luna_sdk/controllers/luna_http_client.py +27 -0
- luna_sdk/controllers/luna_platform_client.py +41 -23
- luna_sdk/controllers/luna_q.py +11 -16
- luna_sdk/controllers/luna_solve.py +12 -17
- luna_sdk/controllers/luna_transform.py +14 -15
- luna_sdk/error/http_error_utils.py +10 -3
- luna_sdk/interfaces/circuit_repo_i.py +18 -12
- luna_sdk/interfaces/cplex_repo_i.py +25 -10
- luna_sdk/interfaces/info_repo_i.py +10 -3
- luna_sdk/interfaces/lp_repo_i.py +20 -8
- luna_sdk/interfaces/optimization_repo_i.py +35 -60
- luna_sdk/interfaces/qpu_token_repo_i.py +40 -38
- luna_sdk/interfaces/solutions_repo_i.py +44 -24
- luna_sdk/repositories/circuit_repo.py +11 -44
- luna_sdk/repositories/cplex_repo.py +32 -20
- luna_sdk/repositories/info_repo.py +4 -7
- luna_sdk/repositories/lp_repo.py +21 -15
- luna_sdk/repositories/optimization_repo.py +36 -210
- luna_sdk/repositories/qpu_token_repo.py +52 -128
- luna_sdk/repositories/solutions_repo.py +109 -181
- luna_sdk/schemas/create/solution.py +2 -2
- luna_sdk/schemas/enums/optimization.py +8 -7
- luna_sdk/schemas/enums/qpu_token_type.py +1 -1
- luna_sdk/schemas/optimization.py +15 -24
- luna_sdk/schemas/optimization_formats/qubo.py +8 -0
- luna_sdk/schemas/pretty_base.py +10 -3
- luna_sdk/schemas/qpu_token.py +4 -5
- luna_sdk/schemas/rest/qpu_token/qpu_token_source.py +18 -0
- luna_sdk/schemas/rest/qpu_token/token_provider.py +47 -15
- luna_sdk/schemas/solution.py +7 -6
- luna_sdk/schemas/solver_info.py +31 -1
- luna_sdk/schemas/solver_parameters/aws/optimizer_params.py +40 -0
- luna_sdk/schemas/solver_parameters/aws/qaoa.py +36 -4
- luna_sdk/schemas/solver_parameters/base_parameter.py +5 -0
- luna_sdk/schemas/solver_parameters/dwave/base.py +15 -14
- luna_sdk/schemas/solver_parameters/dwave/dialectic_search.py +3 -2
- luna_sdk/schemas/solver_parameters/dwave/kerberos.py +2 -3
- luna_sdk/schemas/solver_parameters/dwave/leap_hybrid_bqm.py +2 -2
- luna_sdk/schemas/solver_parameters/dwave/leap_hybrid_cqm.py +2 -2
- luna_sdk/schemas/solver_parameters/dwave/parallel_tempering.py +2 -3
- luna_sdk/schemas/solver_parameters/dwave/parallel_tempering_qpu.py +2 -3
- luna_sdk/schemas/solver_parameters/dwave/population_annealing.py +2 -3
- luna_sdk/schemas/solver_parameters/dwave/population_annealing_qpu.py +2 -1
- luna_sdk/schemas/solver_parameters/dwave/qaga.py +4 -2
- luna_sdk/schemas/solver_parameters/dwave/qbsolv_like_qpu.py +2 -3
- luna_sdk/schemas/solver_parameters/dwave/qbsolv_like_simulated_annealing.py +2 -3
- luna_sdk/schemas/solver_parameters/dwave/qbsolv_like_tabu_search.py +2 -3
- luna_sdk/schemas/solver_parameters/dwave/quantum_annealing.py +2 -3
- luna_sdk/schemas/solver_parameters/dwave/repeated_reverse_quantum_annealing.py +4 -2
- luna_sdk/schemas/solver_parameters/dwave/repeated_reverse_simulated_annealing.py +3 -2
- luna_sdk/schemas/solver_parameters/dwave/saga.py +1 -1
- luna_sdk/schemas/solver_parameters/dwave/tabu_search.py +3 -1
- luna_sdk/schemas/solver_parameters/fujitsu/base.py +5 -4
- luna_sdk/schemas/solver_parameters/fujitsu/partial_config.py +7 -5
- luna_sdk/schemas/solver_parameters/ibm/standard_parameters.py +121 -7
- luna_sdk/schemas/solver_parameters/qctrl/qaoa.py +2 -2
- luna_sdk/schemas/wrappers/__init__.py +1 -0
- luna_sdk/schemas/wrappers/datetime_wrapper.py +31 -0
- luna_sdk/utils/parameter_finder.py +90 -0
- luna_sdk/utils/qpu_tokens.py +14 -13
- luna_sdk/constants.py +0 -1
- luna_sdk/controllers/custom_login_client.py +0 -61
- {luna_quantum-0.0.16.dist-info → luna_quantum-0.0.33.dist-info}/LICENSE +0 -0
- {luna_quantum-0.0.16.dist-info → luna_quantum-0.0.33.dist-info}/WHEEL +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: luna-quantum
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.33
|
|
4
4
|
Summary: Python SDK for Aqarios' Luna Platform
|
|
5
5
|
Home-page: https://aqarios.com/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -25,6 +25,7 @@ Requires-Dist: dwave-neal (>=0.6.0,<0.7.0) ; extra == "transformations" or extra
|
|
|
25
25
|
Requires-Dist: httpx (>=0.26.0,<0.27.0)
|
|
26
26
|
Requires-Dist: networkx (>=2.7.1,<3.0.0) ; extra == "examples"
|
|
27
27
|
Requires-Dist: pydantic (>=2.6.1,<3.0.0)
|
|
28
|
+
Requires-Dist: python-dateutil (>=2.9.0,<3.0.0)
|
|
28
29
|
Requires-Dist: qiskit (>=0.45.1,<0.46.0) ; extra == "examples"
|
|
29
30
|
Requires-Dist: qiskit-ibm-runtime (>=0.18.0,<0.19.0) ; extra == "examples"
|
|
30
31
|
Requires-Dist: qiskit-optimization[cplex] (>=0.6.0,<0.7.0) ; extra == "transformations" or extra == "examples"
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
luna_sdk/__init__.py,sha256=9s6JkcSeRF4WtFo80TelzXXHFhX8w7fXiaJr59V9ScM,100
|
|
2
|
-
luna_sdk/constants.py,sha256=MmbYlLrwDYmahL0yMtC2BUNVeSLAitVqTG31PJZTTv4,33
|
|
3
2
|
luna_sdk/controllers/__init__.py,sha256=ivTapH8np5mQeVEevxwsWawCtVSG4Wep72rNp7nEZXw,60
|
|
4
|
-
luna_sdk/controllers/
|
|
5
|
-
luna_sdk/controllers/luna_platform_client.py,sha256=
|
|
6
|
-
luna_sdk/controllers/luna_q.py,sha256
|
|
7
|
-
luna_sdk/controllers/luna_solve.py,sha256=
|
|
8
|
-
luna_sdk/controllers/luna_transform.py,sha256=
|
|
3
|
+
luna_sdk/controllers/luna_http_client.py,sha256=_q3_o-bjC61uQMnNTfbbGei0eNR_AoIv-2R1cYRfEgU,819
|
|
4
|
+
luna_sdk/controllers/luna_platform_client.py,sha256=EH1jxruuRKwaJ1Vos79PGT4-hwp7jdoSaRFKqjUMbZA,2406
|
|
5
|
+
luna_sdk/controllers/luna_q.py,sha256=cv28o2fYDSaI8iAsfMYWtR68mfuUDxY3jmBWY2KnkRk,1199
|
|
6
|
+
luna_sdk/controllers/luna_solve.py,sha256=ioMdB7Rlx-1-XB5WE5OT8oVlO_T1l5T64R-ccaNUCAA,1797
|
|
7
|
+
luna_sdk/controllers/luna_transform.py,sha256=7kdIp5oRMG1NQZ1hBSkcNrj-z6g_2dWvQZ4j8BK3M0A,1337
|
|
9
8
|
luna_sdk/error/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
luna_sdk/error/http_error_utils.py,sha256=
|
|
9
|
+
luna_sdk/error/http_error_utils.py,sha256=qZ4a43GVR35-bn3QTVmGZBJzEjieo43r36M2G5rfIyw,3509
|
|
11
10
|
luna_sdk/exceptions/__init__.py,sha256=DSKaPN374rR2zccmpLvlqntxDsjFwgSexXtva795ae0,52
|
|
12
11
|
luna_sdk/exceptions/encryption_exception.py,sha256=qe38EPRen4c63ti6bbA3jXl4PK48Ommi_cb2Lvhn8tg,264
|
|
13
12
|
luna_sdk/exceptions/luna_exception.py,sha256=m7U3qFpP9Sc77Z3RG9I4bQXsJSQuVeBLvfHQWziC9sQ,114
|
|
@@ -15,28 +14,28 @@ luna_sdk/exceptions/luna_server_exception.py,sha256=y4J1TzfMF_kmuh5g8hpP2k_SnV0a
|
|
|
15
14
|
luna_sdk/exceptions/timeout_exception.py,sha256=ppEGsUk-6NtBy2-RyBfzjR1IhDmIwPWwg03BOsET4OA,367
|
|
16
15
|
luna_sdk/exceptions/transformation.py,sha256=lykEeWonvfvWAyU2DoKzR-GtFc-KEAvrfWlnWT9ylqc,381
|
|
17
16
|
luna_sdk/interfaces/__init__.py,sha256=WwAzuNWP6SNMJk_U_Hqc5U2mRsG2_m-sSQZPMYUDWfY,213
|
|
18
|
-
luna_sdk/interfaces/circuit_repo_i.py,sha256=
|
|
17
|
+
luna_sdk/interfaces/circuit_repo_i.py,sha256=65SSefsrpo_MKFTGkdT1o5PJ7pQ9n9tmSnunoQ_Mruo,1946
|
|
19
18
|
luna_sdk/interfaces/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
19
|
luna_sdk/interfaces/clients/client_i.py,sha256=_I8mTIfavI3Yv7TPD9HsTxF3uI4WzDucFvgEb2EtOAo,185
|
|
21
20
|
luna_sdk/interfaces/clients/luna_q_i.py,sha256=_DHDirve9yoVO8zb5i3WkTMx-LPu9TtasjF4OUfCaRw,765
|
|
22
21
|
luna_sdk/interfaces/clients/luna_solve_i.py,sha256=UTqDpNPnkFgxFAsA555xMFWq42GTwxGgDJUFcRMi2R8,955
|
|
23
22
|
luna_sdk/interfaces/clients/luna_transform_i.py,sha256=xpS2ODs83rICbA3oAKzf80rpBezZO924WI-P6NzIv2M,676
|
|
24
|
-
luna_sdk/interfaces/cplex_repo_i.py,sha256=
|
|
25
|
-
luna_sdk/interfaces/info_repo_i.py,sha256=
|
|
26
|
-
luna_sdk/interfaces/lp_repo_i.py,sha256=
|
|
27
|
-
luna_sdk/interfaces/optimization_repo_i.py,sha256=
|
|
28
|
-
luna_sdk/interfaces/qpu_token_repo_i.py,sha256=
|
|
23
|
+
luna_sdk/interfaces/cplex_repo_i.py,sha256=a2CWG1m4YmQAlcM022Xfk09BHVmcd3y2H-GMr1N4vx8,3786
|
|
24
|
+
luna_sdk/interfaces/info_repo_i.py,sha256=hCUYNoqjAKwz6l-61XtymX-UboosDX1RaTTiX64EXXc,1345
|
|
25
|
+
luna_sdk/interfaces/lp_repo_i.py,sha256=hixIKvJ8jz9VOUi33B3K2VvFLcR7eKfeooJwktquyhc,3052
|
|
26
|
+
luna_sdk/interfaces/optimization_repo_i.py,sha256=4JZikxWTJZTX4tG85ydSP711WROQ5B8RtbvOp1EDvxE,6202
|
|
27
|
+
luna_sdk/interfaces/qpu_token_repo_i.py,sha256=q5aWiGxFnuRSasgHcceRAjQ0NvMPRoBfkeJHCByBy_0,4626
|
|
29
28
|
luna_sdk/interfaces/repository_i.py,sha256=vJz8pbggkuLLC333qzjepj3TMPh49LUnyh3pJDlcGi0,287
|
|
30
|
-
luna_sdk/interfaces/solutions_repo_i.py,sha256=
|
|
29
|
+
luna_sdk/interfaces/solutions_repo_i.py,sha256=YmQxgDGSLZNQ-P7jzlw1zTnut5Q1KVeRbcJEuocB3VQ,7767
|
|
31
30
|
luna_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
31
|
luna_sdk/repositories/__init__.py,sha256=HxD02fpzlcIt5YkBHd7LwIp_eE6eFuAz2VDnlrakwJQ,169
|
|
33
|
-
luna_sdk/repositories/circuit_repo.py,sha256=
|
|
34
|
-
luna_sdk/repositories/cplex_repo.py,sha256=
|
|
35
|
-
luna_sdk/repositories/info_repo.py,sha256=
|
|
36
|
-
luna_sdk/repositories/lp_repo.py,sha256=
|
|
37
|
-
luna_sdk/repositories/optimization_repo.py,sha256=
|
|
38
|
-
luna_sdk/repositories/qpu_token_repo.py,sha256=
|
|
39
|
-
luna_sdk/repositories/solutions_repo.py,sha256=
|
|
32
|
+
luna_sdk/repositories/circuit_repo.py,sha256=h3Moypl-pba8J-sNTBsOxnbKtu6RCmmX5c_4JnfQfCw,2552
|
|
33
|
+
luna_sdk/repositories/cplex_repo.py,sha256=6vlx6YTJoDSWFSZDDNrPk3E7pa5WWGqG25bhTwQdqHQ,5098
|
|
34
|
+
luna_sdk/repositories/info_repo.py,sha256=GzRW5RwhRJrNjujw8Y7vJY8vV_tHzbfwXo0viHuxqUM,1270
|
|
35
|
+
luna_sdk/repositories/lp_repo.py,sha256=T44XMbdbW7k9a4z6JgIj1kb0bBZxepn-93vxdZOQa80,4370
|
|
36
|
+
luna_sdk/repositories/optimization_repo.py,sha256=xHjMdXhzdwt9DtZG7AvGtUgOqWH142veOpAzaNe-nxk,6078
|
|
37
|
+
luna_sdk/repositories/qpu_token_repo.py,sha256=6V3PH2YLMoWx6Dv6hxDoe2ohXH2mRN37nfvzVS6bHDA,5063
|
|
38
|
+
luna_sdk/repositories/solutions_repo.py,sha256=Q5Q30oRyUnayXkp4z_jPcjDpxYRoPjzWBWUqg2EAFWQ,9242
|
|
40
39
|
luna_sdk/schemas/__init__.py,sha256=lTix3zUl2Z8ZLA2BTF4pls5S-kqlVZ3cIdAZwGxPSUI,248
|
|
41
40
|
luna_sdk/schemas/circuit.py,sha256=r3Bv0lyhrvFoI3Gf8eq-PS3kyivTWY3IJmRH0X2LoCk,1067
|
|
42
41
|
luna_sdk/schemas/create/__init__.py,sha256=7G2yflImpZJxHn3l4Op5CsQAxwKGmvWJSttq9kmiHq0,90
|
|
@@ -44,64 +43,68 @@ luna_sdk/schemas/create/circuit.py,sha256=vV2r6xk24_aHe9oo0dt3wVeOHcyD02lXNR-Yyj
|
|
|
44
43
|
luna_sdk/schemas/create/optimization.py,sha256=Z9pKoD0y6BjKvl8gQ6XK76bdvq8etvcoNU4RwxnUvHA,759
|
|
45
44
|
luna_sdk/schemas/create/qpu_token.py,sha256=XE3WoNL3Q8QFEDshXoSrAKQXgT_zthKvihKqJHi8250,492
|
|
46
45
|
luna_sdk/schemas/create/qubo.py,sha256=5Y_jWicEnoV82Ubc-f0a_qy9hCuPBumhsGWY8wzMIuA,293
|
|
47
|
-
luna_sdk/schemas/create/solution.py,sha256=
|
|
46
|
+
luna_sdk/schemas/create/solution.py,sha256=K97JHH-p5z0P_niTVX6YBPoDc0rgIpJG5O4uaUhcs48,410
|
|
48
47
|
luna_sdk/schemas/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
48
|
luna_sdk/schemas/enums/circuit.py,sha256=smz_DouDo_K8rs4N5aIOj2PS9w6DX1CFYX0bv6f6JFw,252
|
|
50
|
-
luna_sdk/schemas/enums/optimization.py,sha256=
|
|
49
|
+
luna_sdk/schemas/enums/optimization.py,sha256=XtFdcfLxGe-MAL64itjxszhRkTcUzUf83tO-5DBVLeY,198
|
|
51
50
|
luna_sdk/schemas/enums/problem.py,sha256=HWL6Lc1pqPtJ0J-rXkUTL6WHe2fiBY1ctuZvDnx1hmM,754
|
|
52
|
-
luna_sdk/schemas/enums/qpu_token_type.py,sha256=
|
|
51
|
+
luna_sdk/schemas/enums/qpu_token_type.py,sha256=KBRrB8ExuTTmpp48obxdJGWwWEHb7xgq9Ajjwptl1VY,105
|
|
53
52
|
luna_sdk/schemas/enums/solution.py,sha256=Vax6MX62UDwApbwzf1nrhuFWw1Iiq77gUch7_1roCYo,114
|
|
54
53
|
luna_sdk/schemas/enums/status.py,sha256=KHaOgePqB3GNhFYLo2Sp-JAEXBPN_ZVDmj2WobrT5N4,204
|
|
55
54
|
luna_sdk/schemas/enums/timeframe.py,sha256=vwoZsgAYGvqF67qdcXMEnHkqbiRcVY5uK-4-ZTFcurI,238
|
|
56
55
|
luna_sdk/schemas/error_message.py,sha256=svCs-mWQsp3BMEhzZFqskbyP6iS78eVUOPaiWFc4sEQ,307
|
|
57
|
-
luna_sdk/schemas/optimization.py,sha256=
|
|
56
|
+
luna_sdk/schemas/optimization.py,sha256=pCbDL93PFGf7IOGz-0PHFrrpOwQdszm78WnS0oo2xqU,1884
|
|
58
57
|
luna_sdk/schemas/optimization_formats/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
59
58
|
luna_sdk/schemas/optimization_formats/bqm.py,sha256=rrmiZYe_iEdgBFusJeJfY8PVSxgf1Wv79FgMQUm2YVs,910
|
|
60
59
|
luna_sdk/schemas/optimization_formats/cqm.py,sha256=VZiNJy4yc-8o3gHoH0E-uaNOHj7UfAGCqznTzKBv0NQ,4257
|
|
61
60
|
luna_sdk/schemas/optimization_formats/lp.py,sha256=iXFDBmHktHsYc79ngSraylCpa-EVMFwN01788fnjFzY,175
|
|
62
61
|
luna_sdk/schemas/optimization_formats/qm.py,sha256=yUEZF7FOvXv1Mb5FMiX1q0Rk5w2ltrh7HInfFEiVSXU,912
|
|
63
|
-
luna_sdk/schemas/
|
|
64
|
-
luna_sdk/schemas/
|
|
62
|
+
luna_sdk/schemas/optimization_formats/qubo.py,sha256=YN-VbPGTgqOKJuJ7t_TT8H_WIWr1ifU974K98W9Blao,135
|
|
63
|
+
luna_sdk/schemas/pretty_base.py,sha256=ZyVdwdY5JfmNlfqZDm6MdTs5roNGtv0Pe805r4N25Z4,1845
|
|
64
|
+
luna_sdk/schemas/qpu_token.py,sha256=CFKbAhFgo0G-LO_lameHH4-iOFUJWx9hmMWi3xQwURw,1508
|
|
65
65
|
luna_sdk/schemas/representation.py,sha256=0RKVV0XxHOJZ1o9grxTq5ri3cGLziyCFObDwQuXIOEY,364
|
|
66
66
|
luna_sdk/schemas/rest/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
67
67
|
luna_sdk/schemas/rest/qpu_token/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
68
|
-
luna_sdk/schemas/rest/qpu_token/
|
|
69
|
-
luna_sdk/schemas/
|
|
70
|
-
luna_sdk/schemas/
|
|
68
|
+
luna_sdk/schemas/rest/qpu_token/qpu_token_source.py,sha256=EPMXHpgxqsQ4uJ1hlwe5gPdSsjuHEuKKAIMtBFgPJ1A,583
|
|
69
|
+
luna_sdk/schemas/rest/qpu_token/token_provider.py,sha256=3Gecn2AmN7E_wAPUac_c55Fg-LwdDKsgbwAN2-0msJU,2985
|
|
70
|
+
luna_sdk/schemas/solution.py,sha256=IRtZneNRN5IbSEMHKHc0NYJ7lf74RxZTHoYJI7z2QoY,6871
|
|
71
|
+
luna_sdk/schemas/solver_info.py,sha256=ZUCdTI8zpPZ8EquLYyrLU35pZ4VkzcPUSYeQWkdijHM,799
|
|
71
72
|
luna_sdk/schemas/solver_parameters/aws/__init__.py,sha256=CXjKWzgnP_d1_RvQUfWyaaWvsZ1FxLJN5K61QmRa-uw,33
|
|
72
|
-
luna_sdk/schemas/solver_parameters/aws/
|
|
73
|
+
luna_sdk/schemas/solver_parameters/aws/optimizer_params.py,sha256=w0eg1SnTpKnuq48YG8JAC1LY0bxsTlZIJ2XbT2ySTHw,1374
|
|
74
|
+
luna_sdk/schemas/solver_parameters/aws/qaoa.py,sha256=Mc7zfdWgLxh2Kb0r5OmL3RIkYlB1mnu6jUpmfYG2BBg,2290
|
|
75
|
+
luna_sdk/schemas/solver_parameters/base_parameter.py,sha256=v8nk1aVKW_MaePxxNXXb3hcVDtzkQF1sGlvZ2YXXJVI,123
|
|
73
76
|
luna_sdk/schemas/solver_parameters/dwave/__init__.py,sha256=yHsBQ5d1mCS90Y1JcTCOPjNCrEiGT23wI9GyPnYlIqo,2453
|
|
74
|
-
luna_sdk/schemas/solver_parameters/dwave/base.py,sha256=
|
|
75
|
-
luna_sdk/schemas/solver_parameters/dwave/dialectic_search.py,sha256=
|
|
76
|
-
luna_sdk/schemas/solver_parameters/dwave/kerberos.py,sha256=
|
|
77
|
-
luna_sdk/schemas/solver_parameters/dwave/leap_hybrid_bqm.py,sha256=
|
|
78
|
-
luna_sdk/schemas/solver_parameters/dwave/leap_hybrid_cqm.py,sha256=
|
|
79
|
-
luna_sdk/schemas/solver_parameters/dwave/parallel_tempering.py,sha256=
|
|
80
|
-
luna_sdk/schemas/solver_parameters/dwave/parallel_tempering_qpu.py,sha256=
|
|
81
|
-
luna_sdk/schemas/solver_parameters/dwave/population_annealing.py,sha256=
|
|
82
|
-
luna_sdk/schemas/solver_parameters/dwave/population_annealing_qpu.py,sha256=
|
|
83
|
-
luna_sdk/schemas/solver_parameters/dwave/qaga.py,sha256=
|
|
84
|
-
luna_sdk/schemas/solver_parameters/dwave/qbsolv_like_qpu.py,sha256=
|
|
85
|
-
luna_sdk/schemas/solver_parameters/dwave/qbsolv_like_simulated_annealing.py,sha256=
|
|
86
|
-
luna_sdk/schemas/solver_parameters/dwave/qbsolv_like_tabu_search.py,sha256=
|
|
87
|
-
luna_sdk/schemas/solver_parameters/dwave/quantum_annealing.py,sha256=
|
|
88
|
-
luna_sdk/schemas/solver_parameters/dwave/repeated_reverse_quantum_annealing.py,sha256=
|
|
89
|
-
luna_sdk/schemas/solver_parameters/dwave/repeated_reverse_simulated_annealing.py,sha256=
|
|
90
|
-
luna_sdk/schemas/solver_parameters/dwave/saga.py,sha256=
|
|
77
|
+
luna_sdk/schemas/solver_parameters/dwave/base.py,sha256=PpPF49uT8XWzK-kRpkszYeFdFbksWkEDBqimq38-mzc,17281
|
|
78
|
+
luna_sdk/schemas/solver_parameters/dwave/dialectic_search.py,sha256=CnXg7rcZ7mHkbSLrYXPot3-73YiWTRhkhyRmjZ_pvvs,1205
|
|
79
|
+
luna_sdk/schemas/solver_parameters/dwave/kerberos.py,sha256=OPzCgo9h5845R3Sg_TrSkwp4gjoRKEHxhAhSdcJxY6c,2674
|
|
80
|
+
luna_sdk/schemas/solver_parameters/dwave/leap_hybrid_bqm.py,sha256=foPfMJLQ0enO3omknKuqIxfZTXd9oIbfi_e-N0o2tmM,637
|
|
81
|
+
luna_sdk/schemas/solver_parameters/dwave/leap_hybrid_cqm.py,sha256=vEKPvNB06hV_AWjRpUDrvpXPTlCqmQD0Sd-VHhoc5qs,727
|
|
82
|
+
luna_sdk/schemas/solver_parameters/dwave/parallel_tempering.py,sha256=maiOxI4YxcyA4gg2Xx6Oa0mNbmusDEM1ZWbsw6wcQys,1123
|
|
83
|
+
luna_sdk/schemas/solver_parameters/dwave/parallel_tempering_qpu.py,sha256=wy4l1KeiR8bmUHbv0r2Y1rohzU45L-Pce2ka3aPDijI,1197
|
|
84
|
+
luna_sdk/schemas/solver_parameters/dwave/population_annealing.py,sha256=dwWsCdeu16dYXX9n46_TXs-8TwuIT6Sp46Dur40Ga-Q,1044
|
|
85
|
+
luna_sdk/schemas/solver_parameters/dwave/population_annealing_qpu.py,sha256=bBMO68siEmpCcgPmi8YwiSy9L2LirHvK_fWsxiWpBcU,1338
|
|
86
|
+
luna_sdk/schemas/solver_parameters/dwave/qaga.py,sha256=gVucZ_1feFb7aKl6W2m34_Hx46mbshoz9Z2K4EZgngc,2499
|
|
87
|
+
luna_sdk/schemas/solver_parameters/dwave/qbsolv_like_qpu.py,sha256=d72lNLdtD-G6WtVGwqmCse9r_O3inDAbLc6tbDlyu-Y,554
|
|
88
|
+
luna_sdk/schemas/solver_parameters/dwave/qbsolv_like_simulated_annealing.py,sha256=wo5Gt6A-N7APE2Nhz_eOhxmW7P_IYTzvdDKe-4kIMn4,976
|
|
89
|
+
luna_sdk/schemas/solver_parameters/dwave/qbsolv_like_tabu_search.py,sha256=5r5piwo5BsAAlXmyqYMxXZDvgVTvjdJ2hVMr7-7h_lk,840
|
|
90
|
+
luna_sdk/schemas/solver_parameters/dwave/quantum_annealing.py,sha256=h7HXAV67hdcsB0v00AcGNoMtb3pGjyjTG2HY-u3rsHg,631
|
|
91
|
+
luna_sdk/schemas/solver_parameters/dwave/repeated_reverse_quantum_annealing.py,sha256=9QTkdgSesWVIfGo31uNMM0Xo-qIuL8XcmIOHlT4MzJU,3771
|
|
92
|
+
luna_sdk/schemas/solver_parameters/dwave/repeated_reverse_simulated_annealing.py,sha256=UeLr2MnPS3zTBQgH6eq5hYvPJpOjQjqG-shHuQ8Ct0M,4569
|
|
93
|
+
luna_sdk/schemas/solver_parameters/dwave/saga.py,sha256=pXWGZVXRgSMJRi3-NuyO7moai198cWXeGbvq5We-1EE,3118
|
|
91
94
|
luna_sdk/schemas/solver_parameters/dwave/simulated_annealing.py,sha256=cU2UoN8xo3iM34LJhaLc-tYsCo-RqpOstiktEi79QRU,4047
|
|
92
|
-
luna_sdk/schemas/solver_parameters/dwave/tabu_search.py,sha256=
|
|
95
|
+
luna_sdk/schemas/solver_parameters/dwave/tabu_search.py,sha256=fqLoUcBT_CVBq8nmY-KGO_wBmVpAgUSSoS8N_tAOZ6E,3979
|
|
93
96
|
luna_sdk/schemas/solver_parameters/fujitsu/__init__.py,sha256=V4CSTiNSmtBvNuQpxiTZqX9T-oV4M8hZGQ_eO5Ro8vU,549
|
|
94
|
-
luna_sdk/schemas/solver_parameters/fujitsu/base.py,sha256=
|
|
97
|
+
luna_sdk/schemas/solver_parameters/fujitsu/base.py,sha256=yDM2sLBtg-a5OsD3GqwTd-HMmIwJtubbP_QxQcrkDnA,1813
|
|
95
98
|
luna_sdk/schemas/solver_parameters/fujitsu/digital_annealer_cpu.py,sha256=EBPE7mwtUNs5CmyVkdWV9jQT_YnW8FWsYQ0VyCHBVNM,9747
|
|
96
99
|
luna_sdk/schemas/solver_parameters/fujitsu/digital_annealer_v2.py,sha256=SJb4Uffj7WmBf1-9ai0dTj1WE5A7A3pVhV9FXAcmJ-8,10343
|
|
97
100
|
luna_sdk/schemas/solver_parameters/fujitsu/digital_annealer_v3.py,sha256=0iQBGLtT8SJaR6iKwoNytANtnZuoTtQmmc-jGSFCntU,12743
|
|
98
|
-
luna_sdk/schemas/solver_parameters/fujitsu/partial_config.py,sha256=
|
|
101
|
+
luna_sdk/schemas/solver_parameters/fujitsu/partial_config.py,sha256=4m9DURxXSr1-yKRCCMii-VUKSNTL4Zs1ibYzAHFhPeg,8166
|
|
99
102
|
luna_sdk/schemas/solver_parameters/ibm/__init__.py,sha256=KGH8Dx8mNe2qKeIS6emcuibbVzqUETXDsQk9OwemyuQ,165
|
|
100
103
|
luna_sdk/schemas/solver_parameters/ibm/qaoa.py,sha256=71ogy-ViA2bggVf4-GglVW-LVn9yKDNWEoKs09ApI5A,2453
|
|
101
|
-
luna_sdk/schemas/solver_parameters/ibm/standard_parameters.py,sha256=
|
|
104
|
+
luna_sdk/schemas/solver_parameters/ibm/standard_parameters.py,sha256=ntWmDrf672syYZ1PwOg33e-yBuVi0de4H58qWEcRa8g,4710
|
|
102
105
|
luna_sdk/schemas/solver_parameters/ibm/vqe.py,sha256=2uCgqHJHAmRO53wP4YKLkFVVwHhThkgk3A9CB1tQOFM,2198
|
|
103
106
|
luna_sdk/schemas/solver_parameters/qctrl/__init__.py,sha256=mB7Rl-9cNCiJ7ueGXEHazSecxlOI3CVZd1AD-xKqzJY,73
|
|
104
|
-
luna_sdk/schemas/solver_parameters/qctrl/qaoa.py,sha256=
|
|
107
|
+
luna_sdk/schemas/solver_parameters/qctrl/qaoa.py,sha256=wolh1p0A7iD-q2vbITjzPUmp3Jva0D1_Ft4LjZm81Ak,1950
|
|
105
108
|
luna_sdk/schemas/transformations/__init__.py,sha256=3M2rkSeGCuEHvL9joHjA34xiXgocpvpCey4GkywkW58,90
|
|
106
109
|
luna_sdk/schemas/transformations/bqm.py,sha256=n3D8rVFutJ3ChWNakqfQaBMcTTldaF3bFQsYyDo-mt4,679
|
|
107
110
|
luna_sdk/schemas/transformations/matrix.py,sha256=SbPzVQUm7racTECkgRLeiUreaNwaa_RXZI3IivnpKw0,251
|
|
@@ -152,9 +155,12 @@ luna_sdk/schemas/use_cases/traffic_flow.py,sha256=wWDOPsFOYw3RxOh4Q8NLOm270pvuIj
|
|
|
152
155
|
luna_sdk/schemas/use_cases/travelling_salesman_problem.py,sha256=PnqDf4CihQB4PRZd3BNxT1W2bizmQ_h7dccxrp99qLc,1701
|
|
153
156
|
luna_sdk/schemas/use_cases/type_aliases.py,sha256=4qR7uRU77aTGC5x1q8Vi_zgTrpVMhVbpnSQovzSV-Rs,257
|
|
154
157
|
luna_sdk/schemas/use_cases/weighted_max_cut.py,sha256=fpAns-MiONHvotI-lSSQvoxW7lx9OUzBtihx3GbGuyw,1022
|
|
158
|
+
luna_sdk/schemas/wrappers/__init__.py,sha256=1zq5BWRjDidbRJ346JOCSbP6Q9rhf4NiLhZY4xKrKq4,54
|
|
159
|
+
luna_sdk/schemas/wrappers/datetime_wrapper.py,sha256=6usmPJNRYA4Fe_-0NGwe7RYams46CCAXpJs8YULu_yc,794
|
|
155
160
|
luna_sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
156
|
-
luna_sdk/utils/
|
|
157
|
-
|
|
158
|
-
luna_quantum-0.0.
|
|
159
|
-
luna_quantum-0.0.
|
|
160
|
-
luna_quantum-0.0.
|
|
161
|
+
luna_sdk/utils/parameter_finder.py,sha256=LKkd1upH3Djd6eqkcSQ2feNwPUiKi8soYkx6JT1_VSg,2937
|
|
162
|
+
luna_sdk/utils/qpu_tokens.py,sha256=xrh5KSoWzbul-6eRa0ELH9iwEENanE7PIms7jlCt3NY,1641
|
|
163
|
+
luna_quantum-0.0.33.dist-info/LICENSE,sha256=rwwuFPLz36oRvjWu2oEeX42Qtn9gmbh7zRC2OqCFNaI,11342
|
|
164
|
+
luna_quantum-0.0.33.dist-info/METADATA,sha256=5ojTfod6BKHtIKnRn_utUm3CVd9OifvhK8Lk2xqhD8o,2311
|
|
165
|
+
luna_quantum-0.0.33.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
166
|
+
luna_quantum-0.0.33.dist-info/RECORD,,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from importlib.metadata import version
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
from httpx import Client, Response
|
|
5
|
+
|
|
6
|
+
from luna_sdk.error.http_error_utils import HttpErrorUtils
|
|
7
|
+
from luna_sdk.exceptions.timeout_exception import TimeoutException
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class LunaHTTPClient(Client):
|
|
11
|
+
_version: str = version("luna-quantum")
|
|
12
|
+
|
|
13
|
+
_user_agent: str = f"LunaSDK/{_version}"
|
|
14
|
+
|
|
15
|
+
def __init__(self, *args, **kwargs):
|
|
16
|
+
super().__init__(*args, **kwargs)
|
|
17
|
+
|
|
18
|
+
self.headers["User-Agent"] = self._user_agent
|
|
19
|
+
|
|
20
|
+
def request(self, *args, **kwargs) -> Response:
|
|
21
|
+
try:
|
|
22
|
+
response: Response = super().request(*args, **kwargs)
|
|
23
|
+
except httpx.TimeoutException:
|
|
24
|
+
# Handle all possible in httpx timeout exceptions
|
|
25
|
+
raise TimeoutException()
|
|
26
|
+
HttpErrorUtils.check_for_error(response)
|
|
27
|
+
return response
|
|
@@ -1,57 +1,75 @@
|
|
|
1
1
|
import os
|
|
2
|
+
from enum import Enum
|
|
3
|
+
from typing import Optional, Literal
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
from luna_sdk.controllers.custom_login_client import CustomLoginClient
|
|
5
|
+
import httpx
|
|
5
6
|
|
|
7
|
+
from luna_sdk.controllers.luna_http_client import LunaHTTPClient
|
|
8
|
+
from luna_sdk.error.http_error_utils import HttpErrorUtils
|
|
6
9
|
from luna_sdk.interfaces.clients.client_i import IClient
|
|
7
10
|
|
|
8
11
|
|
|
12
|
+
class LunaPrefixEnum(str, Enum):
|
|
13
|
+
LUNA_SOLVE = "luna-solve"
|
|
14
|
+
LUNA_Q = "luna-q"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def check_httpx_exceptions(response):
|
|
18
|
+
HttpErrorUtils.check_for_error(response)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class APIKeyAuth(httpx.Auth):
|
|
22
|
+
def __init__(self, token):
|
|
23
|
+
self.token = token
|
|
24
|
+
|
|
25
|
+
def auth_flow(self, request):
|
|
26
|
+
request.headers["Luna-API-Key"] = self.token
|
|
27
|
+
yield request
|
|
28
|
+
|
|
29
|
+
|
|
9
30
|
class LunaPlatformClient(IClient):
|
|
10
31
|
_base_url: str = ""
|
|
11
32
|
|
|
12
|
-
_client: Client = None # type: ignore
|
|
33
|
+
_client: httpx.Client = None # type: ignore
|
|
13
34
|
|
|
14
35
|
def __init__(
|
|
15
36
|
self,
|
|
16
|
-
|
|
17
|
-
|
|
37
|
+
api_key: str,
|
|
38
|
+
api: LunaPrefixEnum,
|
|
18
39
|
base_url: str = os.getenv("LUNA_BASE_URL", "https://api.aqarios.com"),
|
|
19
|
-
timeout: float =
|
|
40
|
+
timeout: Optional[float] = 240.0,
|
|
20
41
|
):
|
|
21
42
|
"""
|
|
22
|
-
|
|
43
|
+
LunaPlatformClient is a main entrypoint of the SDK.
|
|
23
44
|
All the operations with entities should be processed using an instance of
|
|
24
|
-
|
|
45
|
+
LunaPlatformClient.
|
|
25
46
|
|
|
26
47
|
Parameters
|
|
27
48
|
----------
|
|
28
|
-
|
|
29
|
-
User's
|
|
30
|
-
|
|
31
|
-
|
|
49
|
+
api_key:
|
|
50
|
+
User's API key
|
|
51
|
+
api: str
|
|
52
|
+
Current API with which luna client is working. Can be luna-solve or luna-q.
|
|
32
53
|
base_url:
|
|
33
54
|
Base API URL.
|
|
34
55
|
If you want to use API not on your local PC then change it.
|
|
35
56
|
You can do that by setting the environment variable LUNA_BASE_URL.
|
|
36
57
|
Default value https://api.aqarios.com.
|
|
37
58
|
timeout:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-------
|
|
59
|
+
Default timeout in seconds for the requests via the LunaQ client. `None`
|
|
60
|
+
means that the SDK uses no timeouts. Note that either way the Luna platform
|
|
61
|
+
itself will time out after 240 seconds.
|
|
62
|
+
Default: 240.0
|
|
43
63
|
"""
|
|
44
|
-
self._base_url = f"{base_url}/api"
|
|
64
|
+
self._base_url = f"{base_url}/{api.value}/api/v1"
|
|
45
65
|
|
|
46
66
|
# setup client
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
email=email,
|
|
50
|
-
password=password,
|
|
51
|
-
login_url=f"{base_url}/accessToken",
|
|
67
|
+
self._client = LunaHTTPClient(
|
|
68
|
+
auth=APIKeyAuth(api_key),
|
|
52
69
|
base_url=self._base_url,
|
|
53
70
|
follow_redirects=True,
|
|
54
71
|
timeout=timeout,
|
|
72
|
+
event_hooks={"response": [check_httpx_exceptions]},
|
|
55
73
|
)
|
|
56
74
|
|
|
57
75
|
def __del__(self):
|
luna_sdk/controllers/luna_q.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
from
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from luna_sdk.controllers.luna_platform_client import LunaPlatformClient, LunaPrefixEnum
|
|
2
4
|
from luna_sdk.interfaces import ICircuitRepo
|
|
3
5
|
from luna_sdk.interfaces.clients.luna_q_i import ILunaQ
|
|
4
6
|
from luna_sdk.interfaces.qpu_token_repo_i import IQpuTokenRepo
|
|
@@ -9,28 +11,21 @@ class LunaQ(LunaPlatformClient, ILunaQ):
|
|
|
9
11
|
qpu_token: IQpuTokenRepo = None # type: ignore
|
|
10
12
|
circuit: ICircuitRepo = None # type: ignore
|
|
11
13
|
|
|
12
|
-
def __init__(
|
|
13
|
-
self,
|
|
14
|
-
email: str,
|
|
15
|
-
password: str,
|
|
16
|
-
timeout: float = 10.0,
|
|
17
|
-
):
|
|
14
|
+
def __init__(self, api_key: str, timeout: Optional[float] = 240.0):
|
|
18
15
|
"""
|
|
19
16
|
LunaQ is the main entrypoint for all LunaQ related tasks.
|
|
20
17
|
|
|
21
18
|
Parameters
|
|
22
19
|
----------
|
|
23
|
-
|
|
24
|
-
User's
|
|
25
|
-
password: str
|
|
26
|
-
User's password
|
|
20
|
+
api_key: str
|
|
21
|
+
User's API key
|
|
27
22
|
timeout: float
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
Default timeout in seconds for the requests via the LunaQ client. `None`
|
|
24
|
+
means that the SDK uses no timeouts. Note that either way the Luna platform
|
|
25
|
+
itself will time out after 240 seconds.
|
|
26
|
+
Default: 240.0
|
|
32
27
|
"""
|
|
33
|
-
super().__init__(
|
|
28
|
+
super().__init__(api_key=api_key, api=LunaPrefixEnum.LUNA_Q, timeout=timeout)
|
|
34
29
|
|
|
35
30
|
self.circuit = CircuitRepo(self._client)
|
|
36
31
|
self.qpu_token = QpuTokenRepo(self._client)
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
from
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from luna_sdk.controllers.luna_platform_client import LunaPlatformClient, LunaPrefixEnum
|
|
2
4
|
from luna_sdk.interfaces import ISolutionsRepo
|
|
3
5
|
from luna_sdk.interfaces.clients.luna_solve_i import ILunaSolve
|
|
4
6
|
from luna_sdk.interfaces.info_repo_i import IInfoRepo
|
|
@@ -16,30 +18,23 @@ class LunaSolve(LunaPlatformClient, ILunaSolve):
|
|
|
16
18
|
qpu_token: IQpuTokenRepo = None # type: ignore
|
|
17
19
|
info: IInfoRepo = None # type: ignore
|
|
18
20
|
|
|
19
|
-
def __init__(
|
|
20
|
-
self,
|
|
21
|
-
email: str,
|
|
22
|
-
password: str,
|
|
23
|
-
timeout: float = 10.0,
|
|
24
|
-
):
|
|
21
|
+
def __init__(self, api_key: str, timeout: Optional[float] = 240.0):
|
|
25
22
|
"""
|
|
26
23
|
LunaSolve is the main entrypoint for all LunaSolve related tasks.
|
|
27
24
|
|
|
28
25
|
Parameters
|
|
29
26
|
----------
|
|
30
|
-
|
|
31
|
-
User's
|
|
32
|
-
password: str
|
|
33
|
-
User's password
|
|
27
|
+
api_key: str
|
|
28
|
+
User's API key
|
|
34
29
|
timeout: float
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
Default timeout in seconds for the requests via the LunaQ client. `None`
|
|
31
|
+
means that the SDK uses no timeouts. Note that either way the Luna platform
|
|
32
|
+
itself will time out after 240 seconds.
|
|
33
|
+
Default: 240.0
|
|
39
34
|
"""
|
|
40
35
|
super().__init__(
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
api_key=api_key,
|
|
37
|
+
api=LunaPrefixEnum.LUNA_SOLVE,
|
|
43
38
|
timeout=timeout,
|
|
44
39
|
)
|
|
45
40
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
from
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from luna_sdk.controllers.luna_platform_client import LunaPlatformClient, LunaPrefixEnum
|
|
2
4
|
from luna_sdk.interfaces.clients.luna_transform_i import ILunaTransform
|
|
3
5
|
from luna_sdk.interfaces.cplex_repo_i import ICplexRepo
|
|
4
6
|
from luna_sdk.interfaces.lp_repo_i import ILPRepo
|
|
@@ -12,28 +14,25 @@ class LunaTransform(LunaPlatformClient, ILunaTransform):
|
|
|
12
14
|
|
|
13
15
|
def __init__(
|
|
14
16
|
self,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
timeout: float = 10.0,
|
|
17
|
+
api_key: str,
|
|
18
|
+
timeout: Optional[float] = 240.0,
|
|
18
19
|
):
|
|
19
20
|
"""
|
|
20
|
-
|
|
21
|
+
LunaTransform is the main entrypoint for all LunaTransform related tasks.
|
|
21
22
|
|
|
22
23
|
Parameters
|
|
23
24
|
----------
|
|
24
|
-
|
|
25
|
-
User's
|
|
26
|
-
password: str
|
|
27
|
-
User's password
|
|
25
|
+
api_key: str
|
|
26
|
+
User's API key
|
|
28
27
|
timeout: float
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
Default timeout in seconds for the requests via the LunaQ client. `None`
|
|
29
|
+
means that the SDK uses no timeouts. Note that either way the Luna platform
|
|
30
|
+
itself will time out after 240 seconds.
|
|
31
|
+
Default: 240.0
|
|
33
32
|
"""
|
|
34
33
|
super().__init__(
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
api_key=api_key,
|
|
35
|
+
api=LunaPrefixEnum.LUNA_SOLVE,
|
|
37
36
|
timeout=timeout,
|
|
38
37
|
)
|
|
39
38
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
from typing import Optional
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import httpx
|
|
5
|
+
from httpx import RequestError, Response
|
|
5
6
|
|
|
6
7
|
from luna_sdk.exceptions.luna_server_exception import LunaServerException
|
|
7
8
|
from luna_sdk.schemas.error_message import ErrorMessage
|
|
@@ -50,6 +51,12 @@ class HttpErrorUtils:
|
|
|
50
51
|
" leading to a timeout. Try reducing the size of the optimization.",
|
|
51
52
|
)
|
|
52
53
|
|
|
54
|
+
elif response.status_code == 403:
|
|
55
|
+
exception = create_error_message(
|
|
56
|
+
"FORBIDDEN",
|
|
57
|
+
response.text,
|
|
58
|
+
)
|
|
59
|
+
|
|
53
60
|
return exception
|
|
54
61
|
|
|
55
62
|
@staticmethod
|
|
@@ -70,15 +77,15 @@ class HttpErrorUtils:
|
|
|
70
77
|
If an error occurred with the request outside the http status codes 4xx and 5xx.
|
|
71
78
|
"""
|
|
72
79
|
try:
|
|
80
|
+
response.read()
|
|
73
81
|
response.raise_for_status()
|
|
74
|
-
except HTTPStatusError as e:
|
|
82
|
+
except httpx.HTTPStatusError as e:
|
|
75
83
|
exception: Optional[LunaServerException]
|
|
76
84
|
|
|
77
85
|
try:
|
|
78
86
|
error_msg: ErrorMessage = ErrorMessage.model_validate_json(
|
|
79
87
|
response.text
|
|
80
88
|
)
|
|
81
|
-
|
|
82
89
|
# Convert the error message to the correct exception
|
|
83
90
|
exception = LunaServerException(response.status_code, error_msg)
|
|
84
91
|
|
|
@@ -15,8 +15,8 @@ class ICircuitRepo(IRepository, ABC):
|
|
|
15
15
|
provider: CircuitProviderEnum,
|
|
16
16
|
params: Dict[str, Any] = {},
|
|
17
17
|
qpu_tokens: Optional[TokenProvider] = None,
|
|
18
|
-
timeout: Optional[float] = 10800.0,
|
|
19
18
|
encryption_key: Optional[str] = None,
|
|
19
|
+
**kwargs,
|
|
20
20
|
) -> CircuitJob:
|
|
21
21
|
"""
|
|
22
22
|
Create a circuit solution.
|
|
@@ -31,12 +31,11 @@ class ICircuitRepo(IRepository, ABC):
|
|
|
31
31
|
Additional parameters of the circuit.
|
|
32
32
|
qpu_tokens: Optional[TokenProvider]
|
|
33
33
|
The tokens to be used for the QPU.
|
|
34
|
-
timeout: Optional[float]
|
|
35
|
-
Default = 10800.0. Timeout for the api request. If set to None,
|
|
36
|
-
there won't be any timeout. Increase or disable the timeout if you face
|
|
37
|
-
issues uploading big Problems.
|
|
38
34
|
encryption_key: Optional[str]
|
|
39
35
|
Encryption key to be used for encryption of QPU tokens.
|
|
36
|
+
**kwargs
|
|
37
|
+
Parameters to pass to `httpx.request`.
|
|
38
|
+
|
|
40
39
|
Returns
|
|
41
40
|
-------
|
|
42
41
|
CircuitJob
|
|
@@ -46,17 +45,24 @@ class ICircuitRepo(IRepository, ABC):
|
|
|
46
45
|
|
|
47
46
|
@abstractmethod
|
|
48
47
|
def get(
|
|
49
|
-
self,
|
|
48
|
+
self,
|
|
49
|
+
job: CircuitJob,
|
|
50
|
+
encryption_key: Optional[str] = None,
|
|
51
|
+
**kwargs,
|
|
50
52
|
) -> CircuitResult:
|
|
51
53
|
"""
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
Get the result of a circuit.
|
|
55
|
+
|
|
56
|
+
Parameters
|
|
57
|
+
----------
|
|
54
58
|
encryption_key: Optional[str]
|
|
55
59
|
Encryption key to be used for encryption of QPU tokens.
|
|
60
|
+
**kwargs
|
|
61
|
+
Parameters to pass to `httpx.request`.
|
|
56
62
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
Returns
|
|
64
|
+
-------
|
|
65
|
+
CircuitResult
|
|
66
|
+
The result of solving the circuit.
|
|
61
67
|
"""
|
|
62
68
|
raise NotImplementedError
|