luna-quantum 1.0.7__cp313-cp313-macosx_10_12_x86_64.whl → 1.0.8rc1__cp313-cp313-macosx_10_12_x86_64.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 +2 -0
- luna_quantum/_core.cpython-313-darwin.so +0 -0
- luna_quantum/_core.pyi +114 -3
- luna_quantum/errors.pyi +5 -0
- {luna_quantum-1.0.7.dist-info → luna_quantum-1.0.8rc1.dist-info}/METADATA +2 -2
- {luna_quantum-1.0.7.dist-info → luna_quantum-1.0.8rc1.dist-info}/RECORD +9 -9
- {luna_quantum-1.0.7.dist-info → luna_quantum-1.0.8rc1.dist-info}/WHEEL +1 -1
- {luna_quantum-1.0.7.dist-info → luna_quantum-1.0.8rc1.dist-info}/licenses/LICENSE +0 -0
- {luna_quantum-1.0.7.dist-info → luna_quantum-1.0.8rc1.dist-info}/licenses/NOTICE +0 -0
luna_quantum/__init__.py
CHANGED
|
@@ -48,6 +48,7 @@ from ._core import (
|
|
|
48
48
|
Timer,
|
|
49
49
|
Timing,
|
|
50
50
|
Unbounded,
|
|
51
|
+
ValueSource,
|
|
51
52
|
Variable,
|
|
52
53
|
Vtype,
|
|
53
54
|
errors,
|
|
@@ -103,6 +104,7 @@ __all__ = [
|
|
|
103
104
|
"Timing",
|
|
104
105
|
"Unbounded",
|
|
105
106
|
"UseCaseFactory",
|
|
107
|
+
"ValueSource",
|
|
106
108
|
"Variable",
|
|
107
109
|
"Vtype",
|
|
108
110
|
"__version__",
|
|
Binary file
|
luna_quantum/_core.pyi
CHANGED
|
@@ -783,6 +783,14 @@ class Timer:
|
|
|
783
783
|
"""
|
|
784
784
|
...
|
|
785
785
|
|
|
786
|
+
class ValueSource(Enum):
|
|
787
|
+
"""Toggle enum for choosing the quantity for solution convenience functions."""
|
|
788
|
+
|
|
789
|
+
Obj = ...
|
|
790
|
+
"""Use the `obj_values` field."""
|
|
791
|
+
Raw = ...
|
|
792
|
+
"""Use the `raw_energies` field."""
|
|
793
|
+
|
|
786
794
|
class Solution:
|
|
787
795
|
"""
|
|
788
796
|
The solution object that is obtained by running an algorihtm.
|
|
@@ -926,6 +934,11 @@ class Solution:
|
|
|
926
934
|
"""
|
|
927
935
|
...
|
|
928
936
|
|
|
937
|
+
@obj_values.setter
|
|
938
|
+
def obj_values(self, other: (NDArray | None)) -> None:
|
|
939
|
+
"""Set the objective values of the single samples as a ndarray."""
|
|
940
|
+
...
|
|
941
|
+
|
|
929
942
|
@property
|
|
930
943
|
def raw_energies(self, /) -> NDArray | None:
|
|
931
944
|
"""Get the raw energies.
|
|
@@ -935,6 +948,11 @@ class Solution:
|
|
|
935
948
|
"""
|
|
936
949
|
...
|
|
937
950
|
|
|
951
|
+
@raw_energies.setter
|
|
952
|
+
def raw_energies(self, other: (NDArray | None)) -> None:
|
|
953
|
+
"""Set the raw energies of the single samples as a ndarray."""
|
|
954
|
+
...
|
|
955
|
+
|
|
938
956
|
@property
|
|
939
957
|
def counts(self, /) -> NDArray:
|
|
940
958
|
"""Return how often each sample occurred in the solution."""
|
|
@@ -960,10 +978,15 @@ class Solution:
|
|
|
960
978
|
"""Get the names of all variables in the solution."""
|
|
961
979
|
...
|
|
962
980
|
|
|
963
|
-
def cvar(self, /, alpha: float) -> float:
|
|
981
|
+
def cvar(self, /, alpha: float, value_toggle: ValueSource = ...) -> float:
|
|
964
982
|
"""
|
|
965
983
|
Compute the Conditional Value at Rist (CVaR) of the solution.
|
|
966
984
|
|
|
985
|
+
Parameters
|
|
986
|
+
----------
|
|
987
|
+
float : alpha
|
|
988
|
+
The confidence level.
|
|
989
|
+
|
|
967
990
|
Returns
|
|
968
991
|
-------
|
|
969
992
|
float
|
|
@@ -976,7 +999,30 @@ class Solution:
|
|
|
976
999
|
"""
|
|
977
1000
|
...
|
|
978
1001
|
|
|
979
|
-
def
|
|
1002
|
+
def temperature_weighted(
|
|
1003
|
+
self, /, beta: float, value_toggle: ValueSource = ...
|
|
1004
|
+
) -> float:
|
|
1005
|
+
"""
|
|
1006
|
+
Compute the temperature weighted expectation value of the solution.
|
|
1007
|
+
|
|
1008
|
+
Parameters
|
|
1009
|
+
----------
|
|
1010
|
+
float : beta
|
|
1011
|
+
The inverse temperature for computing Boltzmann weights.
|
|
1012
|
+
|
|
1013
|
+
Returns
|
|
1014
|
+
-------
|
|
1015
|
+
float
|
|
1016
|
+
The temperature weighted expectation value.
|
|
1017
|
+
|
|
1018
|
+
Raises
|
|
1019
|
+
------
|
|
1020
|
+
ComputationError
|
|
1021
|
+
If the computation fails for any reason.
|
|
1022
|
+
"""
|
|
1023
|
+
...
|
|
1024
|
+
|
|
1025
|
+
def expectation_value(self, /, value_toggle: ValueSource = ...) -> float:
|
|
980
1026
|
"""
|
|
981
1027
|
Compute the expectation value of the solution.
|
|
982
1028
|
|
|
@@ -1457,6 +1503,7 @@ class Solution:
|
|
|
1457
1503
|
sense: (Sense | None) = ...,
|
|
1458
1504
|
bit_order: Literal["LTR", "RTL"] = "RTL",
|
|
1459
1505
|
raw_energies: (list[float] | None) = ...,
|
|
1506
|
+
var_order: (list[str] | None) = ...,
|
|
1460
1507
|
) -> Solution:
|
|
1461
1508
|
"""
|
|
1462
1509
|
Create a `Solution` from a dict that maps measured bitstrings to counts.
|
|
@@ -2713,6 +2760,27 @@ class Expression:
|
|
|
2713
2760
|
"""
|
|
2714
2761
|
...
|
|
2715
2762
|
|
|
2763
|
+
@overload
|
|
2764
|
+
@staticmethod
|
|
2765
|
+
def const(val: float, /) -> Expression: ...
|
|
2766
|
+
@overload
|
|
2767
|
+
@staticmethod
|
|
2768
|
+
def const(val: float, /, env: Environment) -> Expression: ...
|
|
2769
|
+
@staticmethod
|
|
2770
|
+
def const(val: float, /, env: (Environment | None) = None) -> Expression:
|
|
2771
|
+
"""Create constant expression.
|
|
2772
|
+
|
|
2773
|
+
Parameters
|
|
2774
|
+
----------
|
|
2775
|
+
val : float
|
|
2776
|
+
The constant
|
|
2777
|
+
|
|
2778
|
+
Returns
|
|
2779
|
+
-------
|
|
2780
|
+
Expression
|
|
2781
|
+
"""
|
|
2782
|
+
...
|
|
2783
|
+
|
|
2716
2784
|
def get_offset(self, /) -> float:
|
|
2717
2785
|
"""
|
|
2718
2786
|
Get the constant (offset) term in the expression.
|
|
@@ -2906,6 +2974,22 @@ class Expression:
|
|
|
2906
2974
|
"""
|
|
2907
2975
|
...
|
|
2908
2976
|
|
|
2977
|
+
def separate(self, variables: list[Variable]) -> tuple[Expression, Expression]:
|
|
2978
|
+
"""
|
|
2979
|
+
Separates expression into two expressions based on presence of variables.
|
|
2980
|
+
|
|
2981
|
+
Parameters
|
|
2982
|
+
----------
|
|
2983
|
+
variables : list[Variable]
|
|
2984
|
+
The variables of which one must at least be present in a left term.
|
|
2985
|
+
|
|
2986
|
+
Returns
|
|
2987
|
+
-------
|
|
2988
|
+
tuple[Expression, Expression]
|
|
2989
|
+
Two expressions, left contains one of the variables right does not, i.e.
|
|
2990
|
+
(contains, does not contain)
|
|
2991
|
+
"""
|
|
2992
|
+
|
|
2909
2993
|
def substitute(
|
|
2910
2994
|
self, /, target: Variable, replacement: (Expression | Variable)
|
|
2911
2995
|
) -> Expression:
|
|
@@ -3034,6 +3118,22 @@ class Expression:
|
|
|
3034
3118
|
"""
|
|
3035
3119
|
...
|
|
3036
3120
|
|
|
3121
|
+
@staticmethod
|
|
3122
|
+
def deep_clone_many(exprs: list[Expression]) -> list[Expression]:
|
|
3123
|
+
"""Deep clones all provided expressions into new environment.
|
|
3124
|
+
|
|
3125
|
+
Parameters
|
|
3126
|
+
----------
|
|
3127
|
+
exprs: list[Expression]
|
|
3128
|
+
The expressions to move to new_environment
|
|
3129
|
+
|
|
3130
|
+
Returns
|
|
3131
|
+
-------
|
|
3132
|
+
list[Expressions]
|
|
3133
|
+
The same expressions but part of a new environment
|
|
3134
|
+
"""
|
|
3135
|
+
...
|
|
3136
|
+
|
|
3037
3137
|
@overload
|
|
3038
3138
|
def __add__(self, other: Expression, /) -> Expression: ...
|
|
3039
3139
|
@overload
|
|
@@ -3388,12 +3488,15 @@ class Expression:
|
|
|
3388
3488
|
...
|
|
3389
3489
|
|
|
3390
3490
|
@property
|
|
3391
|
-
def
|
|
3491
|
+
def environment(self, /) -> Environment:
|
|
3392
3492
|
"""Get this expression's environment."""
|
|
3393
3493
|
...
|
|
3394
3494
|
|
|
3395
3495
|
def __str__(self, /) -> str: ...
|
|
3396
3496
|
def __repr__(self, /) -> str: ...
|
|
3497
|
+
def evaluate(self, solution: Solution, /) -> NDArray:
|
|
3498
|
+
"""Evaluate an expression based on an existing solution."""
|
|
3499
|
+
...
|
|
3397
3500
|
|
|
3398
3501
|
class ExpressionIterator:
|
|
3399
3502
|
"""
|
|
@@ -3611,6 +3714,14 @@ class Environment:
|
|
|
3611
3714
|
def __eq__(self, other: Environment, /) -> bool: ...
|
|
3612
3715
|
def __str__(self, /) -> str: ...
|
|
3613
3716
|
def __repr__(self, /) -> str: ...
|
|
3717
|
+
@property
|
|
3718
|
+
def num_variables(self, /) -> int:
|
|
3719
|
+
"""Get the number of variables in env."""
|
|
3720
|
+
...
|
|
3721
|
+
|
|
3722
|
+
def variables(self, /) -> list[Variable]:
|
|
3723
|
+
"""Get the variables in env."""
|
|
3724
|
+
...
|
|
3614
3725
|
|
|
3615
3726
|
class Comparator(Enum):
|
|
3616
3727
|
"""
|
luna_quantum/errors.pyi
CHANGED
|
@@ -246,6 +246,11 @@ class SampleColCreationError(IndexError):
|
|
|
246
246
|
|
|
247
247
|
def __str__(self, /) -> str: ...
|
|
248
248
|
|
|
249
|
+
class EnvMismatchError(RuntimeError):
|
|
250
|
+
"""Raised when environments of provided expressions mismatch."""
|
|
251
|
+
|
|
252
|
+
def __str__(self, /) -> str: ...
|
|
253
|
+
|
|
249
254
|
class InternalPanicError(RuntimeError):
|
|
250
255
|
"""Raised when an internal and unrecoverable error occurred."""
|
|
251
256
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: luna-quantum
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.8rc1
|
|
4
4
|
Classifier: Programming Language :: Python :: 3
|
|
5
5
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
6
6
|
Classifier: Operating System :: OS Independent
|
|
@@ -17,7 +17,7 @@ Summary: Python SDK for Aqarios' Luna Platform
|
|
|
17
17
|
Keywords: aqarios,luna,quantum computing,quantum optimization,optimization,sdk
|
|
18
18
|
Author-email: Aqarios <pypi@aqarios.com>
|
|
19
19
|
License-Expression: Apache-2.0
|
|
20
|
-
Requires-Python: >=3.11.0, <3.
|
|
20
|
+
Requires-Python: >=3.11.0, <3.15
|
|
21
21
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
22
22
|
Project-URL: Homepage, https://aqarios.com/
|
|
23
23
|
Project-URL: Documentation, https://docs.aqarios.com/
|
|
@@ -1,11 +1,11 @@
|
|
|
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=
|
|
1
|
+
luna_quantum-1.0.8rc1.dist-info/METADATA,sha256=VNgsz3c9MfEiLwTeCTS_Tkri5AaJy7RKatVfL1epL8E,1585
|
|
2
|
+
luna_quantum-1.0.8rc1.dist-info/WHEEL,sha256=73R9gF1Kx45mnq358tC7C3GKhsVvyIHwOBt6LvI35MM,106
|
|
3
|
+
luna_quantum-1.0.8rc1.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
|
4
|
+
luna_quantum-1.0.8rc1.dist-info/licenses/NOTICE,sha256=noPOS8eDj5XoyRO8ZrCxIOh5fSjk0RildIrrqxQlepY,588
|
|
5
|
+
luna_quantum/__init__.py,sha256=8tQBzVi42I_1PuuACQW0wilcJWTt31ln5A4joNcPOSk,3259
|
|
6
6
|
luna_quantum/__init__.pyi,sha256=1Joa1farT1Ey22yWYPMNPgQrGHIKL8bycrdPUgtQqw8,1661
|
|
7
|
-
luna_quantum/_core.cpython-313-darwin.so,sha256=
|
|
8
|
-
luna_quantum/_core.pyi,sha256=
|
|
7
|
+
luna_quantum/_core.cpython-313-darwin.so,sha256=0Us1E_C4GIQ3KAw3MK0PoVbnspqwhr8MvrwywGQf4FE,5914604
|
|
8
|
+
luna_quantum/_core.pyi,sha256=_nJmdvjPtibEZUD4FksyWR3J6ttAPoJhxrWZs_7Nz08,118028
|
|
9
9
|
luna_quantum/algorithms/__init__.py,sha256=IX9ZpzY3Do3mTgKqto5vAWwdYrZrM-RemYSf64yxefg,69
|
|
10
10
|
luna_quantum/aqm_overwrites/__init__.py,sha256=rteObr5JHDnTnRime0Euq9Qy2iDIp6VMpFNHTGVNBe0,46
|
|
11
11
|
luna_quantum/aqm_overwrites/model.py,sha256=La5mh-aS2LNLaQFp_B1EnhrKUXVRRmIqGnIvX66uc8Y,6099
|
|
@@ -83,7 +83,7 @@ luna_quantum/client/utils/qpu_token_utils.py,sha256=xeWIKcBwXGSQ0INfUY3NMTu6H90T
|
|
|
83
83
|
luna_quantum/config.py,sha256=xx7DnjAvOeLUMlXvbXqQ4_EBAy53bjPYU1-QQO6I2lY,217
|
|
84
84
|
luna_quantum/decorators.py,sha256=x0ARypqawJh8VyrgYufaV8DX2vx843kB16_1bUXOqr0,6901
|
|
85
85
|
luna_quantum/errors.py,sha256=yjeXB3i07LlTuuJ18IKgwsC5wmtJElN8cDwlg3JkcEs,1424
|
|
86
|
-
luna_quantum/errors.pyi,sha256=
|
|
86
|
+
luna_quantum/errors.pyi,sha256=PTVWbmHLrlNBMxz3wYni0nbqeMEGlzmIukMwgnF3bMo,9443
|
|
87
87
|
luna_quantum/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
88
88
|
luna_quantum/exceptions/base_luna_quantum_error.py,sha256=qC712QkF04FiY_qwQ5HlIYVhg5P6WzXJ_chJDVTpWXI,89
|
|
89
89
|
luna_quantum/exceptions/patch_class_field_exists_error.py,sha256=3TGKb-MNyjwntrJkbRaBKEvlsj68ROTwCltDt6Zg7Gg,398
|
|
@@ -261,4 +261,4 @@ luna_quantum/util/pretty_base.py,sha256=QUNFiyz5MPsMCZB-wv622oeZ1uLkZ-_0xepNbuzQ
|
|
|
261
261
|
luna_quantum/util/pydantic_utils.py,sha256=nhl_SdLJVAizrtLVHvnbco84g8CdBVdVxN_jlXiv82w,1263
|
|
262
262
|
luna_quantum/utils.py,sha256=pBOkGXNJXlOzxAwTJv8nCj32Q6WNeh3t6Ka3lmTgy9c,134
|
|
263
263
|
luna_quantum/utils.pyi,sha256=yHHPluEJArUltZ2jJ9bPtTugj59E9TOTmYdyH35EHtU,1934
|
|
264
|
-
luna_quantum-1.0.
|
|
264
|
+
luna_quantum-1.0.8rc1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|