classiq 0.90.0__py3-none-any.whl → 0.91.1__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.
- classiq/evaluators/expression_evaluator.py +24 -124
- classiq/evaluators/qmod_expression_visitors/qmod_expression_simplifier.py +10 -3
- classiq/evaluators/qmod_node_evaluators/utils.py +0 -8
- classiq/interface/_version.py +1 -1
- classiq/interface/executor/result.py +22 -3
- classiq/interface/generator/expressions/expression_types.py +2 -0
- classiq/interface/generator/expressions/proxies/classical/classical_array_proxy.py +3 -8
- classiq/interface/generator/functions/classical_type.py +2 -5
- classiq/interface/generator/functions/type_name.py +0 -12
- classiq/interface/model/quantum_type.py +0 -39
- classiq/model_expansions/capturing/captured_vars.py +3 -0
- classiq/model_expansions/function_builder.py +18 -2
- classiq/model_expansions/interpreters/frontend_generative_interpreter.py +0 -10
- classiq/model_expansions/interpreters/generative_interpreter.py +63 -18
- classiq/model_expansions/quantum_operations/emitter.py +13 -3
- classiq/model_expansions/quantum_operations/expression_evaluator.py +49 -5
- classiq/model_expansions/scope.py +5 -14
- classiq/model_expansions/utils/handles_collector.py +7 -0
- classiq/qmod/builtins/operations.py +7 -3
- classiq/qmod/qmod_variable.py +3 -4
- classiq/qmod/semantics/error_manager.py +34 -15
- classiq/qmod/symbolic.py +15 -4
- classiq/qmod/utilities.py +4 -1
- classiq/synthesis.py +1 -2
- {classiq-0.90.0.dist-info → classiq-0.91.1.dist-info}/METADATA +1 -1
- {classiq-0.90.0.dist-info → classiq-0.91.1.dist-info}/RECORD +27 -41
- classiq/interface/generator/expressions/handle_identifier.py +0 -6
- classiq/interface/generator/expressions/proxies/classical/any_classical_value.py +0 -41
- classiq/interface/generator/expressions/proxies/quantum/__init__.py +0 -0
- classiq/interface/generator/expressions/proxies/quantum/qmod_qarray_proxy.py +0 -80
- classiq/interface/generator/expressions/proxies/quantum/qmod_qscalar_proxy.py +0 -77
- classiq/interface/generator/expressions/proxies/quantum/qmod_qstruct_proxy.py +0 -38
- classiq/interface/generator/expressions/proxies/quantum/qmod_sized_proxy.py +0 -39
- classiq/interface/generator/expressions/type_proxy.py +0 -10
- classiq/model_expansions/atomic_expression_functions_defs.py +0 -395
- classiq/model_expansions/model_tables.py +0 -18
- classiq/model_expansions/sympy_conversion/__init__.py +0 -0
- classiq/model_expansions/sympy_conversion/expression_to_sympy.py +0 -181
- classiq/model_expansions/sympy_conversion/sympy_to_python.py +0 -136
- classiq/model_expansions/utils/sympy_utils.py +0 -24
- {classiq-0.90.0.dist-info → classiq-0.91.1.dist-info}/WHEEL +0 -0
|
@@ -92,7 +92,7 @@ classiq/evaluators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
|
92
92
|
classiq/evaluators/argument_types.py,sha256=ecSLiaXuI9iEGIePNSM-MrTxulOb5pMPfcoKKUEdLrM,2652
|
|
93
93
|
classiq/evaluators/classical_expression.py,sha256=5xtDBn-hAguMuoQ9VCVLMd8jVIY2aD_uBpOgoWO0c3Q,2626
|
|
94
94
|
classiq/evaluators/control.py,sha256=aJvAFwWEV__hbjD97z4dcjCYf8O0Pcbg6WNjP5ymqHM,3472
|
|
95
|
-
classiq/evaluators/expression_evaluator.py,sha256=
|
|
95
|
+
classiq/evaluators/expression_evaluator.py,sha256=eMuGRocdNj3uQbcMGWBamVyFQKlh1H3MXnNzzENSYNY,1668
|
|
96
96
|
classiq/evaluators/parameter_types.py,sha256=AJ_6T-U-5PqgQK9Hm9bjQRjzWl55liIzrqIg2K2sKGM,16450
|
|
97
97
|
classiq/evaluators/qmod_annotated_expression.py,sha256=zJvgU88tX4ak--_nb0IyhWWndLhCqR0Mh3ZoibDtKnk,11227
|
|
98
98
|
classiq/evaluators/qmod_expression_visitors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -100,7 +100,7 @@ classiq/evaluators/qmod_expression_visitors/out_of_place_node_transformer.py,sha
|
|
|
100
100
|
classiq/evaluators/qmod_expression_visitors/qmod_expression_bwc.py,sha256=uiVbkLrPkEE8K6XA_rPTJ7ldrVvQ667NekRMX0W_73Y,5123
|
|
101
101
|
classiq/evaluators/qmod_expression_visitors/qmod_expression_evaluator.py,sha256=6_GuyifNpjqQnC7HfPPPfBfjpZBQrWkZGa561A_cECc,10345
|
|
102
102
|
classiq/evaluators/qmod_expression_visitors/qmod_expression_renamer.py,sha256=taYVqtadDdqerLewMXT2Up7-xk9eS60h8H0sObWL_CU,2268
|
|
103
|
-
classiq/evaluators/qmod_expression_visitors/qmod_expression_simplifier.py,sha256=
|
|
103
|
+
classiq/evaluators/qmod_expression_visitors/qmod_expression_simplifier.py,sha256=svPZPja1n-J2qGlTSt8QNRkGncna-VxdE3gluywxFjo,10680
|
|
104
104
|
classiq/evaluators/qmod_expression_visitors/sympy_wrappers.py,sha256=ljvzVBdVm-IkzNuKVZBnvnLDuDgg7ese3sfVzNx2PZk,1524
|
|
105
105
|
classiq/evaluators/qmod_node_evaluators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
106
106
|
classiq/evaluators/qmod_node_evaluators/attribute_evaluation.py,sha256=NsM2uYDeZsEH6Cm3TS500jS9kroaIC0vOnmn7Kr8Im0,7017
|
|
@@ -118,7 +118,7 @@ classiq/evaluators/qmod_node_evaluators/piecewise_evaluation.py,sha256=s7rL1lSbz
|
|
|
118
118
|
classiq/evaluators/qmod_node_evaluators/struct_instantiation_evaluation.py,sha256=wfVXs7zF-9OP6Cmw5Mhyqbeg1Rmtaf_VOxZ_86CzHSQ,2462
|
|
119
119
|
classiq/evaluators/qmod_node_evaluators/subscript_evaluation.py,sha256=ZG32ZN5jSSem8__vQ1a1SPbV9BMzWQtKa3DTMXKZccY,9312
|
|
120
120
|
classiq/evaluators/qmod_node_evaluators/unary_op_evaluation.py,sha256=xywBIh2VZDNGHewTSDnRpDvTdC4gAc3R77zJWKTwRLo,3396
|
|
121
|
-
classiq/evaluators/qmod_node_evaluators/utils.py,sha256=
|
|
121
|
+
classiq/evaluators/qmod_node_evaluators/utils.py,sha256=vcFY5mGFEgD0FtO6BjhSOmZimy5rX2opgw45ivtMyJM,4269
|
|
122
122
|
classiq/evaluators/qmod_type_inference/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
123
123
|
classiq/evaluators/qmod_type_inference/classical_type_inference.py,sha256=T08UZv9Q_WdR_YyJolrwejj3j1Hp_jMKW2Mi_k8t97I,6887
|
|
124
124
|
classiq/evaluators/qmod_type_inference/quantum_type_inference.py,sha256=0Ln1YE69rnuKsdVt9V92qZfhRxgCvziM7P6Iawdc9Fg,12631
|
|
@@ -133,7 +133,7 @@ classiq/execution/qnn.py,sha256=S7I7OK59RF9jUcfhN4zso4bF-0HnqYnZID11iquA-lM,2467
|
|
|
133
133
|
classiq/execution/user_budgets.py,sha256=aQ92T6fWMpnWUXe6WvOHHu1BdFGKjpbdPa8avoS5PaQ,2573
|
|
134
134
|
classiq/executor.py,sha256=uLr1640-DZtdPP0T6fCsmUf1Jj7QPumyoE09mJ8lVo0,2308
|
|
135
135
|
classiq/interface/__init__.py,sha256=cg7hD_XVu1_jJ1fgwmT0rMIoZHopNVeB8xtlmMx-E_A,83
|
|
136
|
-
classiq/interface/_version.py,sha256=
|
|
136
|
+
classiq/interface/_version.py,sha256=7cCqWKyPg2zyNfcMgZ8WvZjA_N5XifDYzLoEIqtsYYM,197
|
|
137
137
|
classiq/interface/analyzer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
138
138
|
classiq/interface/analyzer/analysis_params.py,sha256=lhytuFXEU7sYXo2vtvoGpuwWsB-RglOAjtQ9jT0vpn8,3010
|
|
139
139
|
classiq/interface/analyzer/cytoscape_graph.py,sha256=MpeRBIYS1TfwYwiFpgTO51IE0KoxhY510pmEM3S0rbw,2361
|
|
@@ -201,7 +201,7 @@ classiq/interface/executor/quantum_code.py,sha256=_aXwuG8wkSDPUIpTlbLoWkepHH4gv3
|
|
|
201
201
|
classiq/interface/executor/quantum_instruction_set.py,sha256=z6i6jWsXjatmyrTJW6t9XjQrO6scRgmfV1Oi2xEEu1A,592
|
|
202
202
|
classiq/interface/executor/quantum_program_params.py,sha256=yoxZRCa-O_sbzchUXPcIjQ_doT6db_8o9mf040NDWkM,503
|
|
203
203
|
classiq/interface/executor/register_initialization.py,sha256=-dkivVSDkkLGkIdu0L5VaONhPCRp_JE42LiAZuHUK7k,1365
|
|
204
|
-
classiq/interface/executor/result.py,sha256=
|
|
204
|
+
classiq/interface/executor/result.py,sha256=VfC-Fjj1CIRW98cBgbLT1MvJ1ZQJctraWjjge5qXLTU,16765
|
|
205
205
|
classiq/interface/executor/user_budget.py,sha256=ybjBF-kvN1p4m-3zJ_MqcpQfrgAf5w4DfvilwlW10bE,1322
|
|
206
206
|
classiq/interface/executor/vqe_result.py,sha256=cH66jBbZVhyU5Ud4WeoC1eKeX15aO60phEXWFrilc4E,2324
|
|
207
207
|
classiq/interface/generator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -256,25 +256,17 @@ classiq/interface/generator/expressions/atomic_expression_functions.py,sha256=BM
|
|
|
256
256
|
classiq/interface/generator/expressions/evaluated_expression.py,sha256=e1YEbcbXJlw7Bz0jsCaT5NbTmw21u9j0TtsSPWB1De4,2093
|
|
257
257
|
classiq/interface/generator/expressions/expression.py,sha256=GcjTHw9gjXnAfsVQIA7_iLLcYSASRQ18exPANJ-Rvec,3285
|
|
258
258
|
classiq/interface/generator/expressions/expression_constants.py,sha256=dUYeVNAeY_KvknuX8AeX_XaLeO9E-IOwl1iRcQ5StZY,732
|
|
259
|
-
classiq/interface/generator/expressions/expression_types.py,sha256=
|
|
260
|
-
classiq/interface/generator/expressions/handle_identifier.py,sha256=Vf1EsfzkW3tBk9S6QOLPn5yuLW1EChQ4Ja6OpLWPLFw,93
|
|
259
|
+
classiq/interface/generator/expressions/expression_types.py,sha256=yPw3Js2QFJ0IjGQ4iqQnVHNWqwSvAVD5dC-ztW8FE3c,506
|
|
261
260
|
classiq/interface/generator/expressions/non_symbolic_expr.py,sha256=9JzU1y6oYmDjZyZLjDQNA81X3p1Z7CGzweN6WeFAcY8,4036
|
|
262
261
|
classiq/interface/generator/expressions/proxies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
263
262
|
classiq/interface/generator/expressions/proxies/classical/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
264
|
-
classiq/interface/generator/expressions/proxies/classical/
|
|
265
|
-
classiq/interface/generator/expressions/proxies/classical/classical_array_proxy.py,sha256=BIHLwj1diTPRYYJvpiKom9AAYT9ffUhs2InOD9timG0,5824
|
|
263
|
+
classiq/interface/generator/expressions/proxies/classical/classical_array_proxy.py,sha256=VH7-Ts8P9OoIrxna7Ao2xvfBR-K2JVNCMfy2PWLISJQ,5673
|
|
266
264
|
classiq/interface/generator/expressions/proxies/classical/classical_proxy.py,sha256=Kp9U0p4TVKL-mzNxdhLa4iqs-jmm81PPYi87XlgrGw4,723
|
|
267
265
|
classiq/interface/generator/expressions/proxies/classical/classical_scalar_proxy.py,sha256=S0ydGd4QN5x3zCqTwkj5-cOBJzjeJo0-C4JEcU3bteg,1059
|
|
268
266
|
classiq/interface/generator/expressions/proxies/classical/classical_struct_proxy.py,sha256=NhkUd2MtfIZPu5QVBYSphOI9aUd6QNbE5LNLElGS4BE,1164
|
|
269
267
|
classiq/interface/generator/expressions/proxies/classical/qmod_struct_instance.py,sha256=0OGsJofJuVPaOaBqiCztT6CxS5-_iGwFB5s1E_aR9uo,1581
|
|
270
268
|
classiq/interface/generator/expressions/proxies/classical/utils.py,sha256=Txi_NJK-p367riMM7bOm4IXDMDeNRprMdSBp0XmJ2cM,1874
|
|
271
|
-
classiq/interface/generator/expressions/proxies/quantum/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
272
|
-
classiq/interface/generator/expressions/proxies/quantum/qmod_qarray_proxy.py,sha256=xED68iV61TSqXZnKkZ9HBdGdRgJr6RN7Q27B7rT9LdI,2550
|
|
273
|
-
classiq/interface/generator/expressions/proxies/quantum/qmod_qscalar_proxy.py,sha256=beCTjjGpXrfHaRqSNVa1DqXxE3Ya1EezRmR7aO4vDpc,2224
|
|
274
|
-
classiq/interface/generator/expressions/proxies/quantum/qmod_qstruct_proxy.py,sha256=Qw3xru_ofzGT7nOcQMWMmKNmgX5HCe_O8u4xYi5R5_M,1166
|
|
275
|
-
classiq/interface/generator/expressions/proxies/quantum/qmod_sized_proxy.py,sha256=l87A2ATDHHSw0TxxRTeuavecvAmFE2RqFcWDPVXmzTc,890
|
|
276
269
|
classiq/interface/generator/expressions/sympy_supported_expressions.py,sha256=Nq5L1sBBWP2HqVFdGyexfFttkXv29BX5Kyp45js2T-Q,1612
|
|
277
|
-
classiq/interface/generator/expressions/type_proxy.py,sha256=2TSxdmmhnz78jxzPTqGAAfuY-jWUkyXHsE5bXx1A_es,311
|
|
278
270
|
classiq/interface/generator/function_param_library.py,sha256=MzxtngUMoyRxxTZ3CRH_OR23Q5S-cxuxDsH0qwY-ZiM,630
|
|
279
271
|
classiq/interface/generator/function_param_list.py,sha256=qytPr8Fa0rjxaFI6Od2qaGVws4n4eRHtNgPtWnCc234,4452
|
|
280
272
|
classiq/interface/generator/function_params.py,sha256=GNWfJu_lmcNIZni6PwT0RvsQz0pVrvWiWzfPAnWRneI,9679
|
|
@@ -282,13 +274,13 @@ classiq/interface/generator/functions/__init__.py,sha256=HXHq8Fw2zHG3AYuRXrDEQdJ
|
|
|
282
274
|
classiq/interface/generator/functions/builtins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
283
275
|
classiq/interface/generator/functions/builtins/internal_operators.py,sha256=12AfPkgPEw8FqFpB_m8hmaKboezqNzn0lFWMpykedxI,516
|
|
284
276
|
classiq/interface/generator/functions/classical_function_declaration.py,sha256=1Y8LNr1HzKYNpxAZ5AIi7ko0fftO5kbkYPqZsJbXXto,1168
|
|
285
|
-
classiq/interface/generator/functions/classical_type.py,sha256=
|
|
277
|
+
classiq/interface/generator/functions/classical_type.py,sha256=wbOe307407mfpRG5yvxoMGKVrCpNeHIk4SFp_IqfE5E,10201
|
|
286
278
|
classiq/interface/generator/functions/concrete_types.py,sha256=XHrnvhIgRpoLi4_OVmjFn2Djib123uWu98SKPAPsHVo,1662
|
|
287
279
|
classiq/interface/generator/functions/function_declaration.py,sha256=KSZ_q2hwAxcXIocJTttWretnI7BNzoYNAkBr1TXJcok,515
|
|
288
280
|
classiq/interface/generator/functions/port_declaration.py,sha256=ESJE_19jOg_zS1reFN5dq0xgobZ6J3C3DsIs6EME1c4,1100
|
|
289
281
|
classiq/interface/generator/functions/qmod_python_interface.py,sha256=w1Oz3bV6KS7WzVB8z0_7CnNzdRqos9xoqJzD820db1c,590
|
|
290
282
|
classiq/interface/generator/functions/type_modifier.py,sha256=m7KTKcrxN0ybUv36tLbqvf2VTwVnN8JL5HftNSPzII0,902
|
|
291
|
-
classiq/interface/generator/functions/type_name.py,sha256=
|
|
283
|
+
classiq/interface/generator/functions/type_name.py,sha256=goaXBfdVjes2u1yqBRTbjP904Md4CSsRWX1EnavSfjU,7151
|
|
292
284
|
classiq/interface/generator/generated_circuit_data.py,sha256=gy9TwWaWjgJDcvD1HITsl4t7398MvZ_DBJtXxoHgZH4,13552
|
|
293
285
|
classiq/interface/generator/hadamard_transform.py,sha256=NI4oZBpDCGfaw2OTb5SL3iSGI_nDtyUgElTCO4pEKnk,673
|
|
294
286
|
classiq/interface/generator/hamiltonian_evolution/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -410,7 +402,7 @@ classiq/interface/model/quantum_function_call.py,sha256=dkMBc9o-ZkxfYLbdVG_ma_CY
|
|
|
410
402
|
classiq/interface/model/quantum_function_declaration.py,sha256=2x4PXHE9FOTYsLpDgNdaPAmexiZ8nN_ZqkBTjMwog10,9079
|
|
411
403
|
classiq/interface/model/quantum_lambda_function.py,sha256=4bAlG9czqRbrDSKusdy7EhTR2Mv3ZoLFeCdR8TdN-Fo,2527
|
|
412
404
|
classiq/interface/model/quantum_statement.py,sha256=u04etTX42gl7GdW4RqTdVfcOAUTiwaRHVYWh3_eVWVY,3830
|
|
413
|
-
classiq/interface/model/quantum_type.py,sha256=
|
|
405
|
+
classiq/interface/model/quantum_type.py,sha256=jLpDW6SIL7fpvhvierC6w3WIvet631tyE1kS0CkcDyw,16144
|
|
414
406
|
classiq/interface/model/repeat.py,sha256=1j8QBxO3swEx6-hByMeLTRSPB3Tf2aOLFUUbKqSJvCg,662
|
|
415
407
|
classiq/interface/model/statement_block.py,sha256=CWed4nDefWPK-G3vxayJ9dA13uXLfuKpPWyQkxB41G0,2260
|
|
416
408
|
classiq/interface/model/validation_handle.py,sha256=dbaY2ck5g36RkY1peYVxFXK_CFyA7L0k5flADpu9s68,1577
|
|
@@ -430,19 +422,17 @@ classiq/interface/source_reference.py,sha256=H31MKyWVq6pHdJ8fgjd56AvXBx6qWvqXJBE
|
|
|
430
422
|
classiq/model_expansions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
431
423
|
classiq/model_expansions/arithmetic.py,sha256=APgL7EbRTBQgEtZWcAri-hmFT2dOmWXmQ7otZ4zkmEU,5004
|
|
432
424
|
classiq/model_expansions/arithmetic_compute_result_attrs.py,sha256=d5CYLDlR0iGcl7XdWuzk1qIu_1McVOHqClHiw_ZpoYk,10549
|
|
433
|
-
classiq/model_expansions/atomic_expression_functions_defs.py,sha256=QKB5WAgZZCZzQa342CHMPDMECM3ZnrXjWdzqPHJQHME,12672
|
|
434
425
|
classiq/model_expansions/capturing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
435
|
-
classiq/model_expansions/capturing/captured_vars.py,sha256=
|
|
426
|
+
classiq/model_expansions/capturing/captured_vars.py,sha256=eEOPBk3zXMhbVJkXjkXjs2luzlNc3K6xUDiuDqFT_hQ,32637
|
|
436
427
|
classiq/model_expansions/capturing/mangling_utils.py,sha256=wfCsjP0pScZv9YP6JXq3oVhkS-lCFyUoZ9IROBHS3Ek,1858
|
|
437
428
|
classiq/model_expansions/closure.py,sha256=OY2cG4BGtI-HlImAkd5O2p-jc2XeXbtasEROhiJO724,4032
|
|
438
429
|
classiq/model_expansions/debug_flag.py,sha256=JWzl9FFq2CLcvTg_sh-K8Dp_xXvewsTuFKhPjTCrsrs,107
|
|
439
|
-
classiq/model_expansions/function_builder.py,sha256=
|
|
430
|
+
classiq/model_expansions/function_builder.py,sha256=gBmpins_Nw6FftEhpoq4yX_nh8mz0ManOJc3hAt0nB4,8901
|
|
440
431
|
classiq/model_expansions/generative_functions.py,sha256=RVE6bpuY1LxH95x3ZWNKb5LvLdIA_sg0Q62Hj6hGaDc,8601
|
|
441
432
|
classiq/model_expansions/interpreters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
442
433
|
classiq/model_expansions/interpreters/base_interpreter.py,sha256=tS6NzNgo7Q4T5aD2cWJRvVnY2KNfjE3CuJfRxZ8n7FA,14767
|
|
443
|
-
classiq/model_expansions/interpreters/frontend_generative_interpreter.py,sha256=
|
|
444
|
-
classiq/model_expansions/interpreters/generative_interpreter.py,sha256=
|
|
445
|
-
classiq/model_expansions/model_tables.py,sha256=dlrOGRS2x4Fd_dzClIcV7V8edmbbQzePv9eqxtJQrpo,620
|
|
434
|
+
classiq/model_expansions/interpreters/frontend_generative_interpreter.py,sha256=1cLioVejTqjOiINvaXmVgg0aVbyTaGobGLJHnQCxqpA,3784
|
|
435
|
+
classiq/model_expansions/interpreters/generative_interpreter.py,sha256=mNvGctSHzMF-Lgk8X52q1n-_t9hnQatA-SVMeXWTJ1A,15643
|
|
446
436
|
classiq/model_expansions/quantum_operations/__init__.py,sha256=unuHvw4nfyOwE_UyOcyLNHJfr_ZutX7msHNZ8yrToDM,398
|
|
447
437
|
classiq/model_expansions/quantum_operations/allocate.py,sha256=BbdvJmlUK-UBFL7g3SDiBqbhODAO6vOfx1ZTHZts5r8,10584
|
|
448
438
|
classiq/model_expansions/quantum_operations/arithmetic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -455,25 +445,21 @@ classiq/model_expansions/quantum_operations/call_emitter.py,sha256=xs9IrNDotxMew
|
|
|
455
445
|
classiq/model_expansions/quantum_operations/classical_var_emitter.py,sha256=LDYdIubNbisJlyDAMuS2qHgfs-2m344SbJrehXhDZwk,1055
|
|
456
446
|
classiq/model_expansions/quantum_operations/composite_emitter.py,sha256=AQp3cYaUUA7eEKNwmZwIq1KEdDlTKRaXiop9pXxSVZg,815
|
|
457
447
|
classiq/model_expansions/quantum_operations/declarative_call_emitter.py,sha256=IHCS_jqmKcFNSyVCj5MYAe86LZKaf1vEAFTYaLAjVIs,3641
|
|
458
|
-
classiq/model_expansions/quantum_operations/emitter.py,sha256=
|
|
459
|
-
classiq/model_expansions/quantum_operations/expression_evaluator.py,sha256=
|
|
448
|
+
classiq/model_expansions/quantum_operations/emitter.py,sha256=hzc_F9Ws42PFX0nosavvH6D_iJiCsu2gcPC-PfFNg_I,10316
|
|
449
|
+
classiq/model_expansions/quantum_operations/expression_evaluator.py,sha256=8NOnLQcoN4tRTMkRgZd9PDkRRcHL49y179wPcQtRsf4,3930
|
|
460
450
|
classiq/model_expansions/quantum_operations/function_calls_cache.py,sha256=maEDjkiPPZnT58qCD_lCXhW8_7ylv6r7XbCuTdR1BiA,2632
|
|
461
451
|
classiq/model_expansions/quantum_operations/handle_evaluator.py,sha256=VGh8W_pRhoynnn4mevOt2CHLUCuoeJmWZQk0XF5_HJ0,902
|
|
462
452
|
classiq/model_expansions/quantum_operations/quantum_function_call.py,sha256=epgknrzzwDV1zN9PDLEMelu2wFzaM8UMWBbaD28CzBc,3448
|
|
463
453
|
classiq/model_expansions/quantum_operations/repeat_block_evaluator.py,sha256=kV6quFtPq8YFrYqM5JrERxDRYJrjJOBueTvNOu-qAgc,1412
|
|
464
454
|
classiq/model_expansions/quantum_operations/variable_decleration.py,sha256=rfYQ5CQFn6W2S3e6pj8nXxjf-h35cbpNKchkmLBDZBQ,2839
|
|
465
|
-
classiq/model_expansions/scope.py,sha256=
|
|
455
|
+
classiq/model_expansions/scope.py,sha256=k_m-eM67E9TXyT5zujP1whsPdwwVg5TIvckzIZJPM0U,11061
|
|
466
456
|
classiq/model_expansions/scope_initialization.py,sha256=MvQ2RE0Ie8xRHgK2Fo2ZQHzYG2SIkdKDlZMXZXtv4BA,5407
|
|
467
|
-
classiq/model_expansions/sympy_conversion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
468
|
-
classiq/model_expansions/sympy_conversion/expression_to_sympy.py,sha256=Qhi-vvUSOiqnHqwJzMxp9Qev9kgLL2FQ1l3ilpuZ6Ho,5933
|
|
469
|
-
classiq/model_expansions/sympy_conversion/sympy_to_python.py,sha256=Po7JNljJKCDpGEatRLpuqONu16et-WvwtXQPWuI3RpY,4539
|
|
470
457
|
classiq/model_expansions/transformers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
471
458
|
classiq/model_expansions/transformers/model_renamer.py,sha256=COdvjJlcYtSZ8RWlCGyl499vlv7Q47DdGg_H-GuAa-s,4922
|
|
472
459
|
classiq/model_expansions/transformers/type_modifier_inference.py,sha256=kRpg-9lI2rn6vzizK17lEVsUxSh2K1F8fQktB3H2Prk,15696
|
|
473
460
|
classiq/model_expansions/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
474
461
|
classiq/model_expansions/utils/counted_name_allocator.py,sha256=9LPLBm-4ZrpC_0r1rbogyF11FnLaGCUyzwWpcBJoSmA,297
|
|
475
|
-
classiq/model_expansions/utils/handles_collector.py,sha256=
|
|
476
|
-
classiq/model_expansions/utils/sympy_utils.py,sha256=nfmAj2r5NawLlANA5M2IkN3PmQoxNAYYPdaxz79uoEE,682
|
|
462
|
+
classiq/model_expansions/utils/handles_collector.py,sha256=AdbNN0yXaLRRvqIPSvexR033x_M0GWa4dhfT9LXEM_k,1578
|
|
477
463
|
classiq/model_expansions/visitors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
478
464
|
classiq/model_expansions/visitors/boolean_expression_transformers.py,sha256=ReVGX16m-lYEt6oQWe52oBd_seyp2J3-mJfQqPPqVjk,7137
|
|
479
465
|
classiq/model_expansions/visitors/symbolic_param_inference.py,sha256=d_JiEHHP-Bvw8eEAi3QG3pyAufwzpweCgjCStOs8fLI,8395
|
|
@@ -514,7 +500,7 @@ classiq/qmod/builtins/functions/mid_circuit_measurement.py,sha256=UYtVbsl1vZSBU7
|
|
|
514
500
|
classiq/qmod/builtins/functions/operators.py,sha256=3IWFjUFhljY5CEe2ZU9Z8m33FzwM9E80IADcDcxVuNI,270
|
|
515
501
|
classiq/qmod/builtins/functions/qsvm.py,sha256=Db7mW8Do2OuM7MjoMAtBgIFgKrcp49J34EetI2Pu5d8,572
|
|
516
502
|
classiq/qmod/builtins/functions/standard_gates.py,sha256=mhIA7z8YTX-IY4hkwIklAEMmXB9oZ2YH7GSh2saGdqY,15936
|
|
517
|
-
classiq/qmod/builtins/operations.py,sha256=
|
|
503
|
+
classiq/qmod/builtins/operations.py,sha256=Pqt2fQilC_jPU_oDCCqitBAfqg-W4D81hFS8yv7aTFQ,27435
|
|
518
504
|
classiq/qmod/builtins/structs.py,sha256=LkHvDjyNt-33QLmKyzslI6ZMqICI7vHrIYXFK8V1j6U,6646
|
|
519
505
|
classiq/qmod/cfunc.py,sha256=e3zWNEloBBPy-wJaGI1K5cdNFbd3oq0o4TUY2YDr6ks,1087
|
|
520
506
|
classiq/qmod/classical_function.py,sha256=iHm6T719PUZQPwuNSkouaMA8J9yHrrHUpP-2AQjsA5g,1088
|
|
@@ -535,7 +521,7 @@ classiq/qmod/python_classical_type.py,sha256=y4ow8MhaYzktzB4z461fsBrn9CfrRNASgPl
|
|
|
535
521
|
classiq/qmod/qfunc.py,sha256=DtrSlVurHzjyyD-_tC99t_EResF5GIG9kan0uVDyqH4,2593
|
|
536
522
|
classiq/qmod/qmod_constant.py,sha256=GgwSFWiXnOH8HKQGgA_AWR3TcP9CS-v7jt6qAO5fraA,5143
|
|
537
523
|
classiq/qmod/qmod_parameter.py,sha256=200NaEWife2_IzJUAwHMwuBJTKM0qpXm8nz6vvtNchI,6461
|
|
538
|
-
classiq/qmod/qmod_variable.py,sha256=
|
|
524
|
+
classiq/qmod/qmod_variable.py,sha256=jHHbhX3HUVNdZlEzteks0u_wnUru0vo7lPbI4RSqWgU,32595
|
|
539
525
|
classiq/qmod/quantum_callable.py,sha256=RifbkZEmZ4COOHfluPD2jfd-qYSda2ytW173diR3tI4,2501
|
|
540
526
|
classiq/qmod/quantum_expandable.py,sha256=cwvSjH31udbBE9iU2fxdct6M0ziX7eKQtwHya0g6R6g,18860
|
|
541
527
|
classiq/qmod/quantum_function.py,sha256=wFMti9chpV2wdA9Xrc92zqKsKSmkhfZO4LTwaBWorbU,15383
|
|
@@ -544,7 +530,7 @@ classiq/qmod/semantics/annotation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
|
|
|
544
530
|
classiq/qmod/semantics/annotation/call_annotation.py,sha256=TRjt4qSKPGtJJ94jTPfDHzJLSpQHZS0BGDwfsffQ3ys,3872
|
|
545
531
|
classiq/qmod/semantics/annotation/model_annotation.py,sha256=gzsX3RrcaTPYBxxplbXaE3pBlQQvVkLGrK-xewzdVMA,329
|
|
546
532
|
classiq/qmod/semantics/annotation/qstruct_annotator.py,sha256=z4W_-i806XCU-58R-Er_oX7EZo5QwusFsC0eIbGtJTU,2599
|
|
547
|
-
classiq/qmod/semantics/error_manager.py,sha256=
|
|
533
|
+
classiq/qmod/semantics/error_manager.py,sha256=iP8UXFYjYJzxsy9ePxyma29_hIEXGER2HEw32jv0Yv0,3730
|
|
548
534
|
classiq/qmod/semantics/lambdas.py,sha256=vtJ37ZRHHI_ieGU2A0JvMst6mwkC2FdOgfT_UkerDN0,1266
|
|
549
535
|
classiq/qmod/semantics/static_semantics_visitor.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
550
536
|
classiq/qmod/semantics/validation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -555,15 +541,15 @@ classiq/qmod/semantics/validation/model_validation.py,sha256=BMeleBpQ7WkEi2LNh4j
|
|
|
555
541
|
classiq/qmod/semantics/validation/signature_validation.py,sha256=WZerCfEwgbCPmXD34iHhXGVATMhJ86sg-dfdOHFZNGg,922
|
|
556
542
|
classiq/qmod/semantics/validation/type_hints.py,sha256=OsArqgU7I_W4nbGEQ7OGODkrxi57CnZGhwy5hyJr_Ow,1340
|
|
557
543
|
classiq/qmod/semantics/validation/types_validation.py,sha256=uVyW1WlDvUQU7emzHT75QTS0huIlFZr9DgUXLQ7s7vQ,4856
|
|
558
|
-
classiq/qmod/symbolic.py,sha256=
|
|
544
|
+
classiq/qmod/symbolic.py,sha256=B_54ogYIjzFltD_r75-Z4-AdlJD0HkQHpqMbZSBGIoE,8211
|
|
559
545
|
classiq/qmod/symbolic_expr.py,sha256=RZkqJqaydahlOW4Qcf5Zvj9FrxPpwxT-YCZUonYA-mI,7424
|
|
560
546
|
classiq/qmod/symbolic_type.py,sha256=27tY6pJMFt3EmXIKDJPrNFIUuanIlEu4OueseARbk10,260
|
|
561
547
|
classiq/qmod/type_attribute_remover.py,sha256=NZmTXAsngWqthXjE8n-n6yE72fiWTFM12-TXXJ1kJ-Q,1242
|
|
562
|
-
classiq/qmod/utilities.py,sha256=
|
|
548
|
+
classiq/qmod/utilities.py,sha256=QAhvaBzNfbCdqmBgxTnPaP6m5PO264N_7I5ygsUjebY,5611
|
|
563
549
|
classiq/qmod/write_qmod.py,sha256=rG0EFDpq13wjIuBVLocPQWyZMx8aM64eOn2k3D7Jq0g,3543
|
|
564
550
|
classiq/quantum_program.py,sha256=q4vTnRqNr4VWjrZPJVreX3L_C3s60Nnb1GOp3Wv3SJ0,2088
|
|
565
|
-
classiq/synthesis.py,sha256=
|
|
551
|
+
classiq/synthesis.py,sha256=PWMeE1feUHhG7iKLN06zzgMnZx7Cgc4JqGo-T6O7MdE,9670
|
|
566
552
|
classiq/visualization.py,sha256=SvLkPNN-RFd74wnH83eBNANjX11phBTo0wedTazr7VQ,975
|
|
567
|
-
classiq-0.
|
|
568
|
-
classiq-0.
|
|
569
|
-
classiq-0.
|
|
553
|
+
classiq-0.91.1.dist-info/METADATA,sha256=xhqiP486BhNgIWPd-hW4Oz6Zn7kl9Q1d3VrXdpHW_E4,3505
|
|
554
|
+
classiq-0.91.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
555
|
+
classiq-0.91.1.dist-info/RECORD,,
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import inspect
|
|
2
|
-
from typing import Any, NoReturn
|
|
3
|
-
|
|
4
|
-
import sympy
|
|
5
|
-
|
|
6
|
-
_SYMPY_MEMBERS = [name for name, _ in inspect.getmembers(sympy.Symbol)] + ["precedence"]
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def subscript_to_str(index: Any) -> str:
|
|
10
|
-
if not isinstance(index, slice):
|
|
11
|
-
return str(index)
|
|
12
|
-
expr = ""
|
|
13
|
-
if index.start is not None:
|
|
14
|
-
expr += str(index.start)
|
|
15
|
-
expr += ":"
|
|
16
|
-
if index.stop is not None:
|
|
17
|
-
expr += str(index.stop)
|
|
18
|
-
if index.step is not None:
|
|
19
|
-
expr += f":{index.step}"
|
|
20
|
-
return expr
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class AnyClassicalValue(sympy.Symbol):
|
|
24
|
-
def __getitem__(self, item: Any) -> "AnyClassicalValue":
|
|
25
|
-
if isinstance(item, slice):
|
|
26
|
-
return AnyClassicalValue(f"{self}[{subscript_to_str(item)}]")
|
|
27
|
-
return AnyClassicalValue(f"do_subscript({self}, {item})")
|
|
28
|
-
|
|
29
|
-
def __getattribute__(self, attr: str) -> Any:
|
|
30
|
-
if attr.startswith("_") or attr in _SYMPY_MEMBERS:
|
|
31
|
-
return super().__getattribute__(attr)
|
|
32
|
-
return AnyClassicalValue(f"get_field({self}, '{attr}')")
|
|
33
|
-
|
|
34
|
-
def __len__(self) -> NoReturn:
|
|
35
|
-
raise TypeError("object of type 'AnyClassicalValue' has no len()")
|
|
36
|
-
|
|
37
|
-
def __iter__(self) -> NoReturn:
|
|
38
|
-
raise TypeError("'AnyClassicalValue' object is not iterable")
|
|
39
|
-
|
|
40
|
-
def __bool__(self) -> bool:
|
|
41
|
-
return True
|
|
File without changes
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
from collections.abc import Mapping
|
|
2
|
-
from typing import TYPE_CHECKING, Any, Union
|
|
3
|
-
|
|
4
|
-
import sympy
|
|
5
|
-
|
|
6
|
-
from classiq.interface.exceptions import ClassiqValueError
|
|
7
|
-
from classiq.interface.generator.expressions.expression import Expression
|
|
8
|
-
from classiq.interface.generator.expressions.non_symbolic_expr import NonSymbolicExpr
|
|
9
|
-
from classiq.interface.generator.expressions.proxies.quantum.qmod_sized_proxy import (
|
|
10
|
-
QmodSizedProxy,
|
|
11
|
-
)
|
|
12
|
-
from classiq.interface.model.handle_binding import (
|
|
13
|
-
HandleBinding,
|
|
14
|
-
SlicedHandleBinding,
|
|
15
|
-
SubscriptHandleBinding,
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
if TYPE_CHECKING:
|
|
19
|
-
from classiq.interface.model.quantum_type import QuantumType
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
ILLEGAL_SLICING_STEP_MSG = "Slicing with a step of a quantum variable is not supported"
|
|
23
|
-
ILLEGAL_SLICE_MSG = "Quantum array slice must be of the form [<int-value>:<int-value>]."
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
class QmodQArrayProxy(NonSymbolicExpr, QmodSizedProxy):
|
|
27
|
-
def __init__(
|
|
28
|
-
self,
|
|
29
|
-
handle: HandleBinding,
|
|
30
|
-
element_type: "QuantumType",
|
|
31
|
-
element_size: Union[int, sympy.Basic],
|
|
32
|
-
length: Union[int, sympy.Basic],
|
|
33
|
-
) -> None:
|
|
34
|
-
super().__init__(handle, element_size * length)
|
|
35
|
-
self._length = length
|
|
36
|
-
self._element_type = element_type
|
|
37
|
-
self._element_size = element_size
|
|
38
|
-
|
|
39
|
-
def __getitem__(self, key: Any) -> "QmodSizedProxy":
|
|
40
|
-
return (
|
|
41
|
-
self._get_slice(key) if isinstance(key, slice) else self._get_subscript(key)
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
def _get_subscript(self, index: Any) -> "QmodSizedProxy":
|
|
45
|
-
return self._element_type.get_proxy(
|
|
46
|
-
SubscriptHandleBinding(
|
|
47
|
-
base_handle=self.handle,
|
|
48
|
-
index=Expression(expr=str(index)),
|
|
49
|
-
)
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
def _get_slice(self, slice_: slice) -> "QmodSizedProxy":
|
|
53
|
-
if slice_.step is not None:
|
|
54
|
-
raise ClassiqValueError(ILLEGAL_SLICING_STEP_MSG)
|
|
55
|
-
return QmodQArrayProxy(
|
|
56
|
-
SlicedHandleBinding(
|
|
57
|
-
base_handle=self.handle,
|
|
58
|
-
start=Expression(expr=str(slice_.start)),
|
|
59
|
-
end=Expression(expr=str(slice_.stop)),
|
|
60
|
-
),
|
|
61
|
-
self._element_type,
|
|
62
|
-
self._element_size,
|
|
63
|
-
slice_.stop - slice_.start,
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
@property
|
|
67
|
-
def type_name(self) -> str:
|
|
68
|
-
return "Quantum array"
|
|
69
|
-
|
|
70
|
-
@property
|
|
71
|
-
def len(self) -> Union[int, sympy.Basic]:
|
|
72
|
-
return self._length
|
|
73
|
-
|
|
74
|
-
@property
|
|
75
|
-
def fields(self) -> Mapping[str, Any]:
|
|
76
|
-
return {**super().fields, "len": self.len}
|
|
77
|
-
|
|
78
|
-
@property
|
|
79
|
-
def size(self) -> int:
|
|
80
|
-
return self.len * self._element_size
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
from collections.abc import Mapping
|
|
2
|
-
from typing import Any, Optional, Union
|
|
3
|
-
|
|
4
|
-
import sympy
|
|
5
|
-
from sympy import Symbol
|
|
6
|
-
from typing_extensions import Self
|
|
7
|
-
|
|
8
|
-
from classiq.interface.exceptions import ClassiqValueError
|
|
9
|
-
from classiq.interface.generator.expressions.proxies.quantum.qmod_sized_proxy import (
|
|
10
|
-
QmodSizedProxy,
|
|
11
|
-
)
|
|
12
|
-
from classiq.interface.model.handle_binding import HandleBinding
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class QmodQScalarProxy(Symbol, QmodSizedProxy):
|
|
16
|
-
def __new__(cls, handle: HandleBinding, **assumptions: bool) -> "QmodQScalarProxy":
|
|
17
|
-
return super().__new__(cls, handle.qmod_expr, **assumptions)
|
|
18
|
-
|
|
19
|
-
def __init__(self, handle: HandleBinding, size: int) -> None:
|
|
20
|
-
super().__init__(handle, size)
|
|
21
|
-
|
|
22
|
-
def __copy__(self) -> Self:
|
|
23
|
-
return self
|
|
24
|
-
|
|
25
|
-
def __deepcopy__(self, memo: Optional[dict]) -> Self:
|
|
26
|
-
return self
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class QmodQBitProxy(QmodQScalarProxy):
|
|
30
|
-
def __init__(self, handle: HandleBinding) -> None:
|
|
31
|
-
super().__init__(handle, 1)
|
|
32
|
-
|
|
33
|
-
@property
|
|
34
|
-
def type_name(self) -> str:
|
|
35
|
-
return "Quantum bit"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
class QmodQNumProxy(QmodQScalarProxy):
|
|
39
|
-
def __init__(
|
|
40
|
-
self,
|
|
41
|
-
handle: HandleBinding,
|
|
42
|
-
size: Union[int, sympy.Basic],
|
|
43
|
-
fraction_digits: Union[int, sympy.Basic],
|
|
44
|
-
is_signed: Union[bool, sympy.Basic],
|
|
45
|
-
) -> None:
|
|
46
|
-
super().__init__(handle, size)
|
|
47
|
-
if (
|
|
48
|
-
isinstance(fraction_digits, int)
|
|
49
|
-
and isinstance(size, int)
|
|
50
|
-
and fraction_digits > size
|
|
51
|
-
):
|
|
52
|
-
raise ClassiqValueError(
|
|
53
|
-
f"Quantum numeric of size {size} cannot have {fraction_digits} "
|
|
54
|
-
f"fraction digits"
|
|
55
|
-
)
|
|
56
|
-
self._fraction_digits = fraction_digits
|
|
57
|
-
self._is_signed = is_signed
|
|
58
|
-
|
|
59
|
-
@property
|
|
60
|
-
def type_name(self) -> str:
|
|
61
|
-
return "Quantum numeric"
|
|
62
|
-
|
|
63
|
-
@property
|
|
64
|
-
def fraction_digits(self) -> Union[int, sympy.Basic]:
|
|
65
|
-
return self._fraction_digits
|
|
66
|
-
|
|
67
|
-
@property
|
|
68
|
-
def is_signed(self) -> Union[bool, sympy.Basic]:
|
|
69
|
-
return self._is_signed
|
|
70
|
-
|
|
71
|
-
@property
|
|
72
|
-
def fields(self) -> Mapping[str, Any]:
|
|
73
|
-
return {
|
|
74
|
-
**super().fields,
|
|
75
|
-
"is_signed": self.is_signed,
|
|
76
|
-
"fraction_digits": self.fraction_digits,
|
|
77
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
from collections.abc import Mapping
|
|
2
|
-
from typing import TYPE_CHECKING
|
|
3
|
-
|
|
4
|
-
from classiq.interface.generator.expressions.non_symbolic_expr import NonSymbolicExpr
|
|
5
|
-
from classiq.interface.generator.expressions.proxies.quantum.qmod_sized_proxy import (
|
|
6
|
-
QmodSizedProxy,
|
|
7
|
-
)
|
|
8
|
-
from classiq.interface.model.handle_binding import (
|
|
9
|
-
FieldHandleBinding,
|
|
10
|
-
HandleBinding,
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
if TYPE_CHECKING:
|
|
14
|
-
from classiq.interface.model.quantum_type import QuantumType
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class QmodQStructProxy(NonSymbolicExpr, QmodSizedProxy):
|
|
18
|
-
def __init__(
|
|
19
|
-
self,
|
|
20
|
-
handle: HandleBinding,
|
|
21
|
-
struct_name: str,
|
|
22
|
-
fields: Mapping[str, "QuantumType"],
|
|
23
|
-
) -> None:
|
|
24
|
-
self._fields = {
|
|
25
|
-
name: type_.get_proxy(FieldHandleBinding(base_handle=handle, field=name))
|
|
26
|
-
for name, type_ in fields.items()
|
|
27
|
-
}
|
|
28
|
-
size = sum(proxy.size for proxy in self._fields.values())
|
|
29
|
-
super().__init__(handle, size)
|
|
30
|
-
self._struct_name = struct_name
|
|
31
|
-
|
|
32
|
-
@property
|
|
33
|
-
def type_name(self) -> str:
|
|
34
|
-
return self._struct_name
|
|
35
|
-
|
|
36
|
-
@property
|
|
37
|
-
def fields(self) -> Mapping[str, QmodSizedProxy]:
|
|
38
|
-
return {**super().fields, **self._fields}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
from collections.abc import Mapping
|
|
2
|
-
from typing import TYPE_CHECKING, Any, Union
|
|
3
|
-
|
|
4
|
-
import sympy
|
|
5
|
-
|
|
6
|
-
if TYPE_CHECKING:
|
|
7
|
-
from classiq.interface.model.handle_binding import HandleBinding
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class QmodSizedProxy:
|
|
11
|
-
def __init__(self, handle: "HandleBinding", size: Union[int, sympy.Basic]) -> None:
|
|
12
|
-
self._handle = handle
|
|
13
|
-
self._size = size
|
|
14
|
-
|
|
15
|
-
@property
|
|
16
|
-
def size(self) -> Union[int, sympy.Basic]:
|
|
17
|
-
return self._size
|
|
18
|
-
|
|
19
|
-
def __str__(self) -> str:
|
|
20
|
-
return self.handle.qmod_expr
|
|
21
|
-
|
|
22
|
-
def __repr__(self) -> str:
|
|
23
|
-
return str(self)
|
|
24
|
-
|
|
25
|
-
@property
|
|
26
|
-
def type_name(self) -> str:
|
|
27
|
-
raise NotImplementedError
|
|
28
|
-
|
|
29
|
-
@property
|
|
30
|
-
def handle(self) -> "HandleBinding":
|
|
31
|
-
return self._handle
|
|
32
|
-
|
|
33
|
-
@property
|
|
34
|
-
def len(self) -> int:
|
|
35
|
-
return self._size
|
|
36
|
-
|
|
37
|
-
@property
|
|
38
|
-
def fields(self) -> Mapping[str, Any]:
|
|
39
|
-
return {"size": self._size}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
from typing import TYPE_CHECKING
|
|
2
|
-
|
|
3
|
-
if TYPE_CHECKING:
|
|
4
|
-
from classiq.interface.generator.types.struct_declaration import StructDeclaration
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class TypeProxy:
|
|
8
|
-
def __init__(self, struct_declaration: "StructDeclaration") -> None:
|
|
9
|
-
super().__init__()
|
|
10
|
-
self.struct_declaration = struct_declaration
|