classiq 0.60.1__py3-none-any.whl → 0.62.0__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/__init__.py +2 -0
- classiq/_internals/client.py +6 -1
- classiq/applications/__init__.py +1 -1
- classiq/applications/chemistry/__init__.py +7 -7
- classiq/applications/chemistry/chemistry_model_constructor.py +17 -6
- classiq/applications/combinatorial_helpers/optimization_model.py +9 -2
- classiq/applications/combinatorial_helpers/pyomo_utils.py +60 -9
- classiq/applications/combinatorial_optimization/__init__.py +7 -1
- classiq/applications/combinatorial_optimization/combinatorial_optimization_model_constructor.py +2 -0
- classiq/applications/combinatorial_optimization/combinatorial_problem.py +230 -0
- classiq/applications/finance/finance_model_constructor.py +6 -6
- classiq/applications/grover/grover_model_constructor.py +3 -0
- classiq/applications/libraries/qmci_library.py +1 -10
- classiq/applications/qnn/__init__.py +1 -1
- classiq/applications/qnn/datasets/__init__.py +8 -8
- classiq/applications/qsvm/qsvm.py +1 -1
- classiq/execution/__init__.py +0 -2
- classiq/execution/execution_session.py +6 -0
- classiq/execution/jobs.py +9 -1
- classiq/executor.py +1 -1
- classiq/interface/_version.py +1 -1
- classiq/interface/backend/backend_preferences.py +33 -15
- classiq/interface/backend/quantum_backend_providers.py +3 -1
- classiq/interface/executor/execution_preferences.py +1 -1
- classiq/interface/generator/application_apis/chemistry_declarations.py +1 -1
- classiq/interface/generator/application_apis/finance_declarations.py +2 -2
- classiq/interface/generator/arith/arithmetic.py +16 -1
- classiq/interface/generator/arith/arithmetic_expression_validator.py +4 -3
- classiq/interface/generator/copy.py +47 -0
- classiq/interface/generator/expressions/expression_constants.py +3 -0
- classiq/interface/generator/function_param_list_without_self_reference.py +2 -0
- classiq/interface/generator/generated_circuit_data.py +58 -20
- classiq/interface/generator/model/__init__.py +1 -1
- classiq/interface/generator/model/preferences/preferences.py +1 -1
- classiq/interface/generator/model/quantum_register.py +3 -3
- classiq/interface/generator/standard_gates/controlled_standard_gates.py +20 -32
- classiq/interface/generator/types/compilation_metadata.py +2 -1
- classiq/interface/ide/visual_model.py +1 -0
- classiq/interface/interface_version.py +1 -1
- classiq/interface/model/model.py +2 -3
- classiq/interface/model/quantum_function_call.py +4 -7
- classiq/interface/model/quantum_function_declaration.py +7 -0
- classiq/interface/model/quantum_lambda_function.py +10 -1
- classiq/interface/model/quantum_type.py +3 -1
- classiq/model_expansions/atomic_expression_functions_defs.py +3 -1
- classiq/model_expansions/capturing/captured_vars.py +36 -17
- classiq/model_expansions/capturing/mangling_utils.py +23 -15
- classiq/model_expansions/closure.py +6 -9
- classiq/model_expansions/evaluators/arg_type_match.py +7 -7
- classiq/model_expansions/expression_evaluator.py +5 -2
- classiq/model_expansions/function_builder.py +26 -4
- classiq/model_expansions/generative_functions.py +13 -91
- classiq/model_expansions/interpreter.py +75 -46
- classiq/model_expansions/quantum_operations/call_emitter.py +42 -29
- classiq/model_expansions/quantum_operations/classicalif.py +1 -1
- classiq/model_expansions/quantum_operations/control.py +5 -31
- classiq/model_expansions/quantum_operations/emitter.py +29 -17
- classiq/model_expansions/quantum_operations/expression_operation.py +3 -5
- classiq/model_expansions/quantum_operations/inplace_binary_operation.py +57 -15
- classiq/model_expansions/quantum_operations/invert.py +1 -6
- classiq/model_expansions/quantum_operations/phase.py +2 -5
- classiq/model_expansions/quantum_operations/power.py +0 -4
- classiq/model_expansions/quantum_operations/quantum_assignment_operation.py +19 -30
- classiq/model_expansions/quantum_operations/quantum_function_call.py +4 -2
- classiq/model_expansions/quantum_operations/shallow_emitter.py +161 -0
- classiq/model_expansions/quantum_operations/within_apply.py +0 -14
- classiq/model_expansions/scope.py +12 -16
- classiq/model_expansions/scope_initialization.py +0 -11
- classiq/model_expansions/sympy_conversion/expression_to_sympy.py +7 -0
- classiq/model_expansions/sympy_conversion/sympy_to_python.py +12 -2
- classiq/model_expansions/transformers/ast_renamer.py +26 -0
- classiq/model_expansions/transformers/var_splitter.py +11 -12
- classiq/model_expansions/visitors/variable_references.py +20 -12
- classiq/qmod/builtins/classical_execution_primitives.py +6 -6
- classiq/qmod/builtins/classical_functions.py +10 -10
- classiq/qmod/builtins/functions/__init__.py +89 -103
- classiq/qmod/builtins/functions/amplitude_estimation.py +1 -1
- classiq/qmod/builtins/functions/arithmetic.py +1 -1
- classiq/qmod/builtins/functions/discrete_sine_cosine_transform.py +6 -6
- classiq/qmod/builtins/functions/grover.py +5 -5
- classiq/qmod/builtins/functions/hea.py +1 -1
- classiq/qmod/builtins/functions/linear_pauli_rotation.py +2 -2
- classiq/qmod/builtins/functions/modular_exponentiation.py +8 -8
- classiq/qmod/builtins/functions/operators.py +1 -1
- classiq/qmod/builtins/functions/qaoa_penalty.py +5 -5
- classiq/qmod/builtins/functions/qft_functions.py +2 -2
- classiq/qmod/builtins/functions/qpe.py +9 -12
- classiq/qmod/builtins/functions/qsvt.py +177 -15
- classiq/qmod/builtins/functions/state_preparation.py +9 -9
- classiq/qmod/builtins/functions/swap_test.py +1 -1
- classiq/qmod/builtins/functions/utility_functions.py +2 -2
- classiq/qmod/builtins/functions/variational.py +2 -2
- classiq/qmod/builtins/operations.py +22 -83
- classiq/qmod/builtins/structs.py +9 -9
- classiq/qmod/native/pretty_printer.py +17 -19
- classiq/qmod/pretty_print/pretty_printer.py +9 -6
- classiq/qmod/python_classical_type.py +1 -5
- classiq/qmod/qmod_variable.py +2 -5
- classiq/qmod/quantum_expandable.py +20 -5
- classiq/qmod/quantum_function.py +23 -10
- classiq/qmod/semantics/static_semantics_visitor.py +34 -16
- classiq/qmod/semantics/validation/func_call_validation.py +9 -5
- classiq/qmod/semantics/validation/function_name_collisions_validation.py +23 -0
- classiq/qmod/symbolic.py +47 -47
- {classiq-0.60.1.dist-info → classiq-0.62.0.dist-info}/METADATA +2 -1
- {classiq-0.60.1.dist-info → classiq-0.62.0.dist-info}/RECORD +107 -103
- classiq/execution/qaoa.py +0 -86
- {classiq-0.60.1.dist-info → classiq-0.62.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
from typing import Optional
|
2
|
+
|
3
|
+
from classiq.interface.model.model import Model
|
4
|
+
|
5
|
+
from classiq.qmod.builtins.functions import CORE_LIB_DECLS
|
6
|
+
|
7
|
+
|
8
|
+
def _check_function_name_collisions(
|
9
|
+
model: Model, error_type: Optional[type[Exception]]
|
10
|
+
) -> None:
|
11
|
+
if error_type is None:
|
12
|
+
return
|
13
|
+
redefined_functions = [
|
14
|
+
function.name
|
15
|
+
for function in CORE_LIB_DECLS
|
16
|
+
if function.name in model.function_dict
|
17
|
+
]
|
18
|
+
if len(redefined_functions) == 1:
|
19
|
+
raise error_type(
|
20
|
+
f"Cannot redefine built-in function {redefined_functions[0]!r}"
|
21
|
+
)
|
22
|
+
elif len(redefined_functions) > 1:
|
23
|
+
raise error_type(f"Cannot redefine built-in functions: {redefined_functions}")
|
classiq/qmod/symbolic.py
CHANGED
@@ -303,70 +303,70 @@ def subscript(
|
|
303
303
|
|
304
304
|
|
305
305
|
__all__ = [
|
306
|
-
"
|
306
|
+
"Catalan",
|
307
307
|
"E",
|
308
|
-
"I",
|
309
|
-
"GoldenRatio",
|
310
308
|
"EulerGamma",
|
311
|
-
"
|
312
|
-
"
|
313
|
-
"
|
314
|
-
"
|
315
|
-
"cot",
|
316
|
-
"sec",
|
317
|
-
"csc",
|
318
|
-
"asin",
|
309
|
+
"GoldenRatio",
|
310
|
+
"I",
|
311
|
+
"Piecewise",
|
312
|
+
"abs",
|
319
313
|
"acos",
|
320
|
-
"
|
314
|
+
"acosh",
|
321
315
|
"acot",
|
322
|
-
"
|
316
|
+
"acoth",
|
323
317
|
"acsc",
|
324
|
-
"
|
325
|
-
"
|
326
|
-
"
|
327
|
-
"coth",
|
328
|
-
"sech",
|
329
|
-
"csch",
|
318
|
+
"asec",
|
319
|
+
"asech",
|
320
|
+
"asin",
|
330
321
|
"asinh",
|
331
|
-
"
|
322
|
+
"atan",
|
332
323
|
"atanh",
|
333
|
-
"
|
334
|
-
"
|
335
|
-
"
|
336
|
-
"
|
337
|
-
"
|
338
|
-
"
|
339
|
-
"
|
340
|
-
"
|
324
|
+
"bell",
|
325
|
+
"bernoulli",
|
326
|
+
"besseli",
|
327
|
+
"besselj",
|
328
|
+
"besselk",
|
329
|
+
"bessely",
|
330
|
+
"beta",
|
331
|
+
"binomial",
|
332
|
+
"catalan",
|
341
333
|
"ceiling",
|
334
|
+
"cos",
|
335
|
+
"cosh",
|
336
|
+
"cot",
|
337
|
+
"coth",
|
338
|
+
"csc",
|
339
|
+
"csch",
|
340
|
+
"dirichlet_eta",
|
342
341
|
"erf",
|
343
342
|
"erfc",
|
343
|
+
"euler",
|
344
|
+
"exp",
|
345
|
+
"factorial",
|
346
|
+
"floor",
|
344
347
|
"gamma",
|
345
|
-
"
|
346
|
-
"
|
347
|
-
"bessely",
|
348
|
-
"besseli",
|
349
|
-
"besselk",
|
350
|
-
"dirichlet_eta",
|
351
|
-
"polygamma",
|
348
|
+
"ln",
|
349
|
+
"log",
|
352
350
|
"loggamma",
|
353
|
-
"factorial",
|
354
|
-
"binomial",
|
355
|
-
"subfactorial",
|
356
|
-
"primorial",
|
357
|
-
"bell",
|
358
|
-
"bernoulli",
|
359
|
-
"euler",
|
360
|
-
"catalan",
|
361
|
-
"Piecewise",
|
362
|
-
"max",
|
363
|
-
"min",
|
364
351
|
"logical_and",
|
365
|
-
"logical_or",
|
366
352
|
"logical_not",
|
353
|
+
"logical_or",
|
354
|
+
"max",
|
355
|
+
"min",
|
367
356
|
"mod_inverse",
|
357
|
+
"pi",
|
358
|
+
"polygamma",
|
359
|
+
"primorial",
|
360
|
+
"sec",
|
361
|
+
"sech",
|
362
|
+
"sin",
|
363
|
+
"sinh",
|
364
|
+
"sqrt",
|
365
|
+
"subfactorial",
|
368
366
|
"subscript",
|
369
367
|
"sum",
|
368
|
+
"tan",
|
369
|
+
"tanh",
|
370
370
|
]
|
371
371
|
|
372
372
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: classiq
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.62.0
|
4
4
|
Summary: Classiq's Python SDK for quantum computing
|
5
5
|
Home-page: https://classiq.io
|
6
6
|
License: Proprietary
|
@@ -53,6 +53,7 @@ Requires-Dist: sympy (>=1.13.0,<2.0.0)
|
|
53
53
|
Requires-Dist: tabulate (>=0.8.9,<1)
|
54
54
|
Requires-Dist: torch (>=2.0,<3.0) ; extra == "qml"
|
55
55
|
Requires-Dist: torchvision (>=0.15,<1.0) ; extra == "qml"
|
56
|
+
Requires-Dist: tqdm (>=4.67.1,<5.0.0)
|
56
57
|
Project-URL: Documentation, https://docs.classiq.io/
|
57
58
|
Description-Content-Type: text/markdown
|
58
59
|
|