luna-quantum 1.1.0__cp312-cp312-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- luna_quantum/__init__.py +139 -0
- luna_quantum/__init__.pyi +98 -0
- luna_quantum/_core.cp312-win_amd64.pyd +0 -0
- luna_quantum/_core.pyi +4286 -0
- luna_quantum/_utility.py +148 -0
- luna_quantum/_utility.pyi +20 -0
- luna_quantum/algorithms/__init__.py +1 -0
- luna_quantum/aqm_overwrites/__init__.py +3 -0
- luna_quantum/aqm_overwrites/model.py +184 -0
- luna_quantum/backends/__init__.py +1 -0
- luna_quantum/client/__init__.py +0 -0
- luna_quantum/client/controllers/__init__.py +4 -0
- luna_quantum/client/controllers/luna_http_client.py +37 -0
- luna_quantum/client/controllers/luna_platform_client.py +256 -0
- luna_quantum/client/controllers/luna_q.py +67 -0
- luna_quantum/client/controllers/luna_solve.py +129 -0
- luna_quantum/client/error/__init__.py +0 -0
- luna_quantum/client/error/luna_api_key_invalid_error.py +10 -0
- luna_quantum/client/error/luna_api_key_missing_error.py +10 -0
- luna_quantum/client/error/luna_error.py +2 -0
- luna_quantum/client/error/luna_server_error.py +20 -0
- luna_quantum/client/error/timeout_error.py +12 -0
- luna_quantum/client/error/transformation_error.py +18 -0
- luna_quantum/client/error/utils/__init__.py +0 -0
- luna_quantum/client/error/utils/http_error_utils.py +112 -0
- luna_quantum/client/interfaces/__init__.py +4 -0
- luna_quantum/client/interfaces/clients/__init__.py +25 -0
- luna_quantum/client/interfaces/clients/circuit_rest_client_i.py +68 -0
- luna_quantum/client/interfaces/clients/info_rest_client_i.py +53 -0
- luna_quantum/client/interfaces/clients/model_rest_client_i.py +139 -0
- luna_quantum/client/interfaces/clients/qpu_token_rest_client_i.py +364 -0
- luna_quantum/client/interfaces/clients/rest_client_i.py +21 -0
- luna_quantum/client/interfaces/clients/solve_job_rest_client_i.py +201 -0
- luna_quantum/client/interfaces/clients/users_rest_client_i.py +29 -0
- luna_quantum/client/interfaces/services/__init__.py +0 -0
- luna_quantum/client/interfaces/services/luna_q_i.py +34 -0
- luna_quantum/client/interfaces/services/luna_solve_i.py +72 -0
- luna_quantum/client/interfaces/services/service_i.py +56 -0
- luna_quantum/client/rest_client/__init__.py +15 -0
- luna_quantum/client/rest_client/circuit_rest_client.py +107 -0
- luna_quantum/client/rest_client/info_rest_client.py +74 -0
- luna_quantum/client/rest_client/model_rest_client.py +216 -0
- luna_quantum/client/rest_client/qpu_token_rest_client.py +508 -0
- luna_quantum/client/rest_client/solve_job_rest_client.py +286 -0
- luna_quantum/client/rest_client/users_rest_client.py +35 -0
- luna_quantum/client/schemas/__init__.py +26 -0
- luna_quantum/client/schemas/circuit.py +48 -0
- luna_quantum/client/schemas/create/__init__.py +15 -0
- luna_quantum/client/schemas/create/circuit.py +30 -0
- luna_quantum/client/schemas/create/optimization.py +39 -0
- luna_quantum/client/schemas/create/qpu_token.py +22 -0
- luna_quantum/client/schemas/create/qpu_token_time_quota.py +35 -0
- luna_quantum/client/schemas/create/qpu_token_time_quota_update.py +24 -0
- luna_quantum/client/schemas/create/qubo.py +19 -0
- luna_quantum/client/schemas/create/solve_job_create.py +43 -0
- luna_quantum/client/schemas/enums/__init__.py +0 -0
- luna_quantum/client/schemas/enums/call_style.py +13 -0
- luna_quantum/client/schemas/enums/circuit.py +42 -0
- luna_quantum/client/schemas/enums/model_format.py +11 -0
- luna_quantum/client/schemas/enums/problem.py +50 -0
- luna_quantum/client/schemas/enums/qpu_token_type.py +20 -0
- luna_quantum/client/schemas/enums/sense.py +8 -0
- luna_quantum/client/schemas/enums/status.py +40 -0
- luna_quantum/client/schemas/enums/timeframe.py +11 -0
- luna_quantum/client/schemas/error_message.py +14 -0
- luna_quantum/client/schemas/model_metadata.py +35 -0
- luna_quantum/client/schemas/qpu_token/__init__.py +0 -0
- luna_quantum/client/schemas/qpu_token/qpu_token.py +154 -0
- luna_quantum/client/schemas/qpu_token/qpu_token_source.py +19 -0
- luna_quantum/client/schemas/qpu_token/qpu_token_time_quota.py +30 -0
- luna_quantum/client/schemas/qpu_token/token_provider.py +132 -0
- luna_quantum/client/schemas/representation.py +19 -0
- luna_quantum/client/schemas/solution.py +106 -0
- luna_quantum/client/schemas/solve_job.py +50 -0
- luna_quantum/client/schemas/solver_info.py +11 -0
- luna_quantum/client/schemas/user.py +11 -0
- luna_quantum/client/schemas/wrappers/__init__.py +5 -0
- luna_quantum/client/schemas/wrappers/datetime_wrapper.py +32 -0
- luna_quantum/client/utils/__init__.py +0 -0
- luna_quantum/client/utils/qpu_token_utils.py +147 -0
- luna_quantum/config.py +11 -0
- luna_quantum/decorators.py +248 -0
- luna_quantum/errors.py +34 -0
- luna_quantum/errors.pyi +287 -0
- luna_quantum/exceptions/__init__.py +0 -0
- luna_quantum/exceptions/base_luna_quantum_error.py +2 -0
- luna_quantum/exceptions/luna_quantum_call_type_error.py +9 -0
- luna_quantum/exceptions/patch_class_field_exists_error.py +10 -0
- luna_quantum/factories/__init__.py +4 -0
- luna_quantum/factories/luna_solve_client_factory.py +100 -0
- luna_quantum/factories/usecase_factory.py +489 -0
- luna_quantum/py.typed +0 -0
- luna_quantum/solve/__init__.py +13 -0
- luna_quantum/solve/default_token.py +304 -0
- luna_quantum/solve/domain/__init__.py +0 -0
- luna_quantum/solve/domain/abstract/__init__.py +4 -0
- luna_quantum/solve/domain/abstract/luna_algorithm.py +205 -0
- luna_quantum/solve/domain/abstract/qpu_token_backend.py +34 -0
- luna_quantum/solve/domain/model_metadata.py +56 -0
- luna_quantum/solve/domain/solve_job.py +230 -0
- luna_quantum/solve/errors/__init__.py +0 -0
- luna_quantum/solve/errors/incompatible_backend_error.py +15 -0
- luna_quantum/solve/errors/model_metadata_missing_error.py +11 -0
- luna_quantum/solve/errors/solve_base_error.py +5 -0
- luna_quantum/solve/errors/token_missing_error.py +11 -0
- luna_quantum/solve/interfaces/__init__.py +0 -0
- luna_quantum/solve/interfaces/algorithm_i.py +49 -0
- luna_quantum/solve/interfaces/backend_i.py +28 -0
- luna_quantum/solve/interfaces/usecases/__init__.py +59 -0
- luna_quantum/solve/interfaces/usecases/model_delete_usecase_i.py +27 -0
- luna_quantum/solve/interfaces/usecases/model_fetch_metadata_usecase_i.py +33 -0
- luna_quantum/solve/interfaces/usecases/model_get_solutions_usecase_i.py +33 -0
- luna_quantum/solve/interfaces/usecases/model_get_solve_jobs_usecase_i.py +33 -0
- luna_quantum/solve/interfaces/usecases/model_load_by_id_usecase_i.py +32 -0
- luna_quantum/solve/interfaces/usecases/model_load_by_metadata_usecase_i.py +37 -0
- luna_quantum/solve/interfaces/usecases/model_load_metadata_by_hash_usecase_i.py +38 -0
- luna_quantum/solve/interfaces/usecases/model_save_usecase_i.py +36 -0
- luna_quantum/solve/interfaces/usecases/solve_job_cancel_usecase_i.py +33 -0
- luna_quantum/solve/interfaces/usecases/solve_job_create_usecase_i.py +44 -0
- luna_quantum/solve/interfaces/usecases/solve_job_delete_usecase_i.py +32 -0
- luna_quantum/solve/interfaces/usecases/solve_job_fetch_updates_usecase_i.py +38 -0
- luna_quantum/solve/interfaces/usecases/solve_job_get_by_id_usecase_i.py +27 -0
- luna_quantum/solve/interfaces/usecases/solve_job_get_result_usecase_i.py +63 -0
- luna_quantum/solve/parameters/__init__.py +0 -0
- luna_quantum/solve/parameters/algorithms/__init__.py +51 -0
- luna_quantum/solve/parameters/algorithms/base_params/__init__.py +24 -0
- luna_quantum/solve/parameters/algorithms/base_params/decomposer.py +57 -0
- luna_quantum/solve/parameters/algorithms/base_params/qaoa_circuit_params.py +95 -0
- luna_quantum/solve/parameters/algorithms/base_params/quantum_annealing_params.py +79 -0
- luna_quantum/solve/parameters/algorithms/base_params/scipy_optimizer.py +122 -0
- luna_quantum/solve/parameters/algorithms/base_params/simulated_annealing_params.py +106 -0
- luna_quantum/solve/parameters/algorithms/base_params/tabu_kerberos_params.py +39 -0
- luna_quantum/solve/parameters/algorithms/base_params/tabu_search_params.py +129 -0
- luna_quantum/solve/parameters/algorithms/flexible_parameter_algorithm.py +59 -0
- luna_quantum/solve/parameters/algorithms/genetic_algorithms/__init__.py +4 -0
- luna_quantum/solve/parameters/algorithms/genetic_algorithms/qaga.py +131 -0
- luna_quantum/solve/parameters/algorithms/genetic_algorithms/saga.py +139 -0
- luna_quantum/solve/parameters/algorithms/lq_fda/__init__.py +3 -0
- luna_quantum/solve/parameters/algorithms/lq_fda/fujits_da_base.py +85 -0
- luna_quantum/solve/parameters/algorithms/lq_fda/fujitsu_da_v3c.py +155 -0
- luna_quantum/solve/parameters/algorithms/optimization_solvers/__init__.py +3 -0
- luna_quantum/solve/parameters/algorithms/optimization_solvers/scip.py +51 -0
- luna_quantum/solve/parameters/algorithms/quantum_annealing/__init__.py +19 -0
- luna_quantum/solve/parameters/algorithms/quantum_annealing/kerberos.py +149 -0
- luna_quantum/solve/parameters/algorithms/quantum_annealing/leap_hybrid_bqm.py +75 -0
- luna_quantum/solve/parameters/algorithms/quantum_annealing/leap_hybrid_cqm.py +75 -0
- luna_quantum/solve/parameters/algorithms/quantum_annealing/parallel_tempering_qpu.py +139 -0
- luna_quantum/solve/parameters/algorithms/quantum_annealing/population_annealing_qpu.py +109 -0
- luna_quantum/solve/parameters/algorithms/quantum_annealing/qbsolv_like_qpu.py +111 -0
- luna_quantum/solve/parameters/algorithms/quantum_annealing/quantum_annealing.py +121 -0
- luna_quantum/solve/parameters/algorithms/quantum_annealing/repeated_reverse_quantum_annealing.py +174 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/__init__.py +6 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/flex_qaoa/__init__.py +10 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/flexqaoa/__init__.py +29 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/flexqaoa/config.py +58 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/flexqaoa/flexqaoa.py +188 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/flexqaoa/optimizers.py +53 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/flexqaoa/pipeline.py +164 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/qaoa.py +112 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/qaoa_fo.py +69 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/vqe.py +108 -0
- luna_quantum/solve/parameters/algorithms/search_algorithms/__init__.py +5 -0
- luna_quantum/solve/parameters/algorithms/search_algorithms/dialectic_search.py +136 -0
- luna_quantum/solve/parameters/algorithms/search_algorithms/qbsolv_like_tabu_search.py +117 -0
- luna_quantum/solve/parameters/algorithms/search_algorithms/tabu_search.py +126 -0
- luna_quantum/solve/parameters/algorithms/simulated_annealing/__init__.py +13 -0
- luna_quantum/solve/parameters/algorithms/simulated_annealing/parallel_tempering.py +131 -0
- luna_quantum/solve/parameters/algorithms/simulated_annealing/population_annealing.py +95 -0
- luna_quantum/solve/parameters/algorithms/simulated_annealing/qbsolv_like_simulated_annealing.py +141 -0
- luna_quantum/solve/parameters/algorithms/simulated_annealing/repeated_reverse_simulated_annealing.py +172 -0
- luna_quantum/solve/parameters/algorithms/simulated_annealing/simulated_annealing.py +126 -0
- luna_quantum/solve/parameters/backends/__init__.py +27 -0
- luna_quantum/solve/parameters/backends/aqarios.py +17 -0
- luna_quantum/solve/parameters/backends/aqarios_gpu.py +17 -0
- luna_quantum/solve/parameters/backends/aws/__init__.py +11 -0
- luna_quantum/solve/parameters/backends/aws/aws.py +36 -0
- luna_quantum/solve/parameters/backends/aws/aws_backend_base.py +74 -0
- luna_quantum/solve/parameters/backends/aws/ionq.py +43 -0
- luna_quantum/solve/parameters/backends/aws/iqm.py +31 -0
- luna_quantum/solve/parameters/backends/aws/rigetti.py +31 -0
- luna_quantum/solve/parameters/backends/cudaq/__init__.py +5 -0
- luna_quantum/solve/parameters/backends/cudaq/cudaq_base.py +16 -0
- luna_quantum/solve/parameters/backends/cudaq/cudaq_cpu.py +30 -0
- luna_quantum/solve/parameters/backends/cudaq/cudaq_gpu.py +32 -0
- luna_quantum/solve/parameters/backends/dwave.py +17 -0
- luna_quantum/solve/parameters/backends/dwave_qpu.py +166 -0
- luna_quantum/solve/parameters/backends/fda.py +17 -0
- luna_quantum/solve/parameters/backends/ibm.py +138 -0
- luna_quantum/solve/parameters/backends/qctrl.py +103 -0
- luna_quantum/solve/parameters/backends/zib.py +17 -0
- luna_quantum/solve/parameters/constants.py +11 -0
- luna_quantum/solve/parameters/errors.py +30 -0
- luna_quantum/solve/parameters/mixins/__init__.py +0 -0
- luna_quantum/solve/parameters/mixins/fujitsu_common_params_mixin.py +239 -0
- luna_quantum/solve/parameters/mixins/fujitsu_v2_mixin.py +70 -0
- luna_quantum/solve/parameters/mixins/qbsolv_like_mixin.py +60 -0
- luna_quantum/solve/use_cases/__init__.py +119 -0
- luna_quantum/solve/use_cases/arbitrage_edge_based.py +50 -0
- luna_quantum/solve/use_cases/arbitrage_node_based.py +55 -0
- luna_quantum/solve/use_cases/base.py +7 -0
- luna_quantum/solve/use_cases/binary_integer_linear_programming.py +54 -0
- luna_quantum/solve/use_cases/binary_paint_shop_problem.py +37 -0
- luna_quantum/solve/use_cases/credit_scoring_feature_selection.py +40 -0
- luna_quantum/solve/use_cases/dynamic_portfolio_optimization.py +64 -0
- luna_quantum/solve/use_cases/exact_cover.py +51 -0
- luna_quantum/solve/use_cases/flight_gate_assignment.py +79 -0
- luna_quantum/solve/use_cases/graph_coloring.py +42 -0
- luna_quantum/solve/use_cases/graph_isomorphism.py +52 -0
- luna_quantum/solve/use_cases/graph_partitioning.py +46 -0
- luna_quantum/solve/use_cases/hamiltonian_cycle.py +49 -0
- luna_quantum/solve/use_cases/induced_subgraph_isomorphism.py +50 -0
- luna_quantum/solve/use_cases/job_shop_scheduling.py +44 -0
- luna_quantum/solve/use_cases/k_medoids_clustering.py +49 -0
- luna_quantum/solve/use_cases/knapsack_integer_weights.py +56 -0
- luna_quantum/solve/use_cases/linear_regression.py +60 -0
- luna_quantum/solve/use_cases/lmwcs.py +84 -0
- luna_quantum/solve/use_cases/longest_path.py +50 -0
- luna_quantum/solve/use_cases/market_graph_clustering.py +61 -0
- luna_quantum/solve/use_cases/max2sat.py +54 -0
- luna_quantum/solve/use_cases/max3sat.py +55 -0
- luna_quantum/solve/use_cases/max_clique.py +60 -0
- luna_quantum/solve/use_cases/max_cut.py +48 -0
- luna_quantum/solve/use_cases/max_independent_set.py +37 -0
- luna_quantum/solve/use_cases/minimal_maximal_matching.py +54 -0
- luna_quantum/solve/use_cases/minimal_spanning_tree.py +90 -0
- luna_quantum/solve/use_cases/minimum_vertex_cover.py +45 -0
- luna_quantum/solve/use_cases/number_partitioning.py +32 -0
- luna_quantum/solve/use_cases/portfolio_optimization.py +46 -0
- luna_quantum/solve/use_cases/portfolio_optimization_ib_tv.py +63 -0
- luna_quantum/solve/use_cases/quadratic_assignment.py +49 -0
- luna_quantum/solve/use_cases/quadratic_knapsack.py +48 -0
- luna_quantum/solve/use_cases/satellite_scheduling.py +73 -0
- luna_quantum/solve/use_cases/sensor_placement.py +58 -0
- luna_quantum/solve/use_cases/set_cover.py +56 -0
- luna_quantum/solve/use_cases/set_packing.py +54 -0
- luna_quantum/solve/use_cases/set_partitioning.py +52 -0
- luna_quantum/solve/use_cases/subgraph_isomorphism.py +55 -0
- luna_quantum/solve/use_cases/subset_sum.py +37 -0
- luna_quantum/solve/use_cases/support_vector_machine.py +64 -0
- luna_quantum/solve/use_cases/traffic_flow.py +35 -0
- luna_quantum/solve/use_cases/travelling_salesman_problem.py +53 -0
- luna_quantum/solve/use_cases/type_aliases.py +9 -0
- luna_quantum/solve/use_cases/weighted_max_cut.py +37 -0
- luna_quantum/solve/usecases/__init__.py +45 -0
- luna_quantum/solve/usecases/model_delete_usecase.py +49 -0
- luna_quantum/solve/usecases/model_fetch_metadata_usecase.py +50 -0
- luna_quantum/solve/usecases/model_get_solution_usecase.py +59 -0
- luna_quantum/solve/usecases/model_get_solve_jobs_usecase.py +62 -0
- luna_quantum/solve/usecases/model_load_by_id_usecase.py +47 -0
- luna_quantum/solve/usecases/model_load_by_metadata_usecase.py +52 -0
- luna_quantum/solve/usecases/model_load_metadata_by_hash_usecase.py +51 -0
- luna_quantum/solve/usecases/model_save_usecase.py +63 -0
- luna_quantum/solve/usecases/solve_job_cancel_usecase.py +51 -0
- luna_quantum/solve/usecases/solve_job_create_usecase.py +112 -0
- luna_quantum/solve/usecases/solve_job_delete_usecase.py +38 -0
- luna_quantum/solve/usecases/solve_job_fetch_updates_usecase.py +49 -0
- luna_quantum/solve/usecases/solve_job_get_by_id_usecase.py +44 -0
- luna_quantum/solve/usecases/solve_job_get_result_usecase.py +105 -0
- luna_quantum/transformations.py +18 -0
- luna_quantum/transformations.pyi +371 -0
- luna_quantum/translator.py +23 -0
- luna_quantum/translator.pyi +869 -0
- luna_quantum/util/__init__.py +0 -0
- luna_quantum/util/active_waiting.py +79 -0
- luna_quantum/util/class_patcher.py +164 -0
- luna_quantum/util/debug_info.py +52 -0
- luna_quantum/util/log_utils.py +187 -0
- luna_quantum/util/pretty_base.py +67 -0
- luna_quantum/util/pydantic_utils.py +38 -0
- luna_quantum/utils.py +3 -0
- luna_quantum/utils.pyi +67 -0
- luna_quantum-1.1.0.dist-info/METADATA +36 -0
- luna_quantum-1.1.0.dist-info/RECORD +276 -0
- luna_quantum-1.1.0.dist-info/WHEEL +4 -0
- luna_quantum-1.1.0.dist-info/licenses/LICENSE +176 -0
- luna_quantum-1.1.0.dist-info/licenses/NOTICE +13 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from abc import ABC, abstractmethod
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from luna_quantum.aqm_overwrites import Model
|
|
8
|
+
from luna_quantum.client.interfaces.services.luna_solve_i import ILunaSolve
|
|
9
|
+
from luna_quantum.solve.domain.model_metadata import ModelMetadata
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class IModelSaveUseCase(ABC):
|
|
13
|
+
"""Define an interface for handling Model saving use cases."""
|
|
14
|
+
|
|
15
|
+
@abstractmethod
|
|
16
|
+
def __init__(self, client: ILunaSolve) -> None:
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
@abstractmethod
|
|
20
|
+
def __call__(self, model: Model) -> ModelMetadata:
|
|
21
|
+
"""
|
|
22
|
+
Evaluate and retrieve metadata from an acquisition model.
|
|
23
|
+
|
|
24
|
+
This abstract method is intended to be implemented to process a given
|
|
25
|
+
acquisition model and derive specific metadata from it.
|
|
26
|
+
|
|
27
|
+
Parameters
|
|
28
|
+
----------
|
|
29
|
+
model : Model
|
|
30
|
+
The acquisition model to be processed.
|
|
31
|
+
|
|
32
|
+
Returns
|
|
33
|
+
-------
|
|
34
|
+
ModelMetadata
|
|
35
|
+
The metadata derived from the acquisition model.
|
|
36
|
+
"""
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from abc import ABC, abstractmethod
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from luna_quantum.client.interfaces.services.luna_solve_i import ILunaSolve
|
|
8
|
+
from luna_quantum.solve.domain.solve_job import SolveJob
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ISolveJobCancelUseCase(ABC):
|
|
12
|
+
"""
|
|
13
|
+
Represent an abstract base for solving job cancellation use case.
|
|
14
|
+
|
|
15
|
+
This class defines the structure for a use case that allows canceling of solve
|
|
16
|
+
jobs. It acts as an interface specifying methods to be implemented by
|
|
17
|
+
concrete subclasses.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
@abstractmethod
|
|
21
|
+
def __init__(self, client: ILunaSolve) -> None:
|
|
22
|
+
pass
|
|
23
|
+
|
|
24
|
+
@abstractmethod
|
|
25
|
+
def __call__(self, solve_job: SolveJob) -> None:
|
|
26
|
+
"""
|
|
27
|
+
Represent an abstract base for callable objects handling solve jobs.
|
|
28
|
+
|
|
29
|
+
Parameters
|
|
30
|
+
----------
|
|
31
|
+
solve_job : SolveJob
|
|
32
|
+
The input job to process or solve.
|
|
33
|
+
"""
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from abc import ABC, abstractmethod
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from luna_quantum.aqm_overwrites.model import Model
|
|
8
|
+
from luna_quantum.client.interfaces.services.luna_solve_i import ILunaSolve
|
|
9
|
+
from luna_quantum.solve.domain.abstract import LunaAlgorithm
|
|
10
|
+
from luna_quantum.solve.domain.solve_job import SolveJob
|
|
11
|
+
from luna_quantum.solve.interfaces.algorithm_i import BACKEND_TYPE
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ISolveJobCreateUseCase(ABC):
|
|
15
|
+
"""
|
|
16
|
+
Abstract base class for a Solve Job Create use case.
|
|
17
|
+
|
|
18
|
+
Defines the abstract methods to initialize the use case with a client and
|
|
19
|
+
handle the execution of the use case, which involves processing a model.
|
|
20
|
+
|
|
21
|
+
Attributes
|
|
22
|
+
----------
|
|
23
|
+
client : ILunaSolve
|
|
24
|
+
Instance of the solving client.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
@abstractmethod
|
|
28
|
+
def __init__(self, client: ILunaSolve) -> None:
|
|
29
|
+
pass
|
|
30
|
+
|
|
31
|
+
@abstractmethod
|
|
32
|
+
def __call__(
|
|
33
|
+
self,
|
|
34
|
+
model: Model | str,
|
|
35
|
+
luna_solver: LunaAlgorithm[BACKEND_TYPE],
|
|
36
|
+
backend: BACKEND_TYPE,
|
|
37
|
+
name: str | None,
|
|
38
|
+
) -> SolveJob:
|
|
39
|
+
"""
|
|
40
|
+
Abstract base class for objects that are callable and return a Model.
|
|
41
|
+
|
|
42
|
+
Classes implementing this interface are designed to be called with a
|
|
43
|
+
Model instance and return a Model.
|
|
44
|
+
"""
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from abc import ABC, abstractmethod
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from luna_quantum.client.interfaces.services.luna_solve_i import ILunaSolve
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ISolveJobDeleteUseCase(ABC):
|
|
11
|
+
"""Defines an abstract interface for deleting a Solve Job."""
|
|
12
|
+
|
|
13
|
+
@abstractmethod
|
|
14
|
+
def __init__(self, client: ILunaSolve) -> None:
|
|
15
|
+
pass
|
|
16
|
+
|
|
17
|
+
@abstractmethod
|
|
18
|
+
def __call__(self, solve_job_id: str) -> None:
|
|
19
|
+
"""
|
|
20
|
+
Abstract method for deleting a Solve Job.
|
|
21
|
+
|
|
22
|
+
Parameters
|
|
23
|
+
----------
|
|
24
|
+
solve_job_id : str
|
|
25
|
+
Unique identifier for the solve job to process.
|
|
26
|
+
|
|
27
|
+
Returns
|
|
28
|
+
-------
|
|
29
|
+
Model
|
|
30
|
+
The Model instance that corresponds to the processed job.
|
|
31
|
+
|
|
32
|
+
"""
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from abc import ABC, abstractmethod
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from luna_quantum.client.interfaces.services.luna_solve_i import ILunaSolve
|
|
8
|
+
from luna_quantum.solve.domain.solve_job import SolveJob
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ISolveJobFetchUpdatesUseCase(ABC):
|
|
12
|
+
"""Interface for fetching updates for a solve job.
|
|
13
|
+
|
|
14
|
+
Implementations of this interface must provide the logic for
|
|
15
|
+
initializing with a client and fetching updates when called.
|
|
16
|
+
|
|
17
|
+
Attributes
|
|
18
|
+
----------
|
|
19
|
+
client : ILunaSolve
|
|
20
|
+
The client used for interacting with the solve job update service.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
@abstractmethod
|
|
24
|
+
def __init__(self, client: ILunaSolve) -> None:
|
|
25
|
+
pass
|
|
26
|
+
|
|
27
|
+
@abstractmethod
|
|
28
|
+
def __call__(self, solve_job: SolveJob) -> None:
|
|
29
|
+
"""
|
|
30
|
+
Abstract method for fetching updates for a solve job.
|
|
31
|
+
|
|
32
|
+
The fetched data will update the provided solve job object.
|
|
33
|
+
|
|
34
|
+
Parameters
|
|
35
|
+
----------
|
|
36
|
+
solve_job : SolveJob
|
|
37
|
+
The solve job for which updates are to be fetched.
|
|
38
|
+
"""
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from abc import ABC, abstractmethod
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from luna_quantum.client.interfaces.services.luna_solve_i import ILunaSolve
|
|
8
|
+
from luna_quantum.solve.domain.solve_job import SolveJob
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ISolveJobGetByIdUseCase(ABC):
|
|
12
|
+
"""Represent an abstract base to retrieve a solve-job by its id."""
|
|
13
|
+
|
|
14
|
+
@abstractmethod
|
|
15
|
+
def __init__(self, client: ILunaSolve) -> None:
|
|
16
|
+
pass
|
|
17
|
+
|
|
18
|
+
@abstractmethod
|
|
19
|
+
def __call__(self, solve_job_id: str) -> SolveJob:
|
|
20
|
+
"""
|
|
21
|
+
Represent an abstract base for callable objects to retrieve solve jobs.
|
|
22
|
+
|
|
23
|
+
Parameters
|
|
24
|
+
----------
|
|
25
|
+
solve_job_id : str
|
|
26
|
+
The id of the solve-job to retrieve.
|
|
27
|
+
"""
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from abc import ABC, abstractmethod
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from luna_quantum import Solution
|
|
8
|
+
from luna_quantum.client.interfaces.services.luna_solve_i import ILunaSolve
|
|
9
|
+
from luna_quantum.client.schemas.enums.call_style import CallStyle
|
|
10
|
+
from luna_quantum.solve.domain.solve_job import SolveJob
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ISolveJobGetResultUseCase(ABC):
|
|
14
|
+
"""
|
|
15
|
+
Abstract base class for retrieving the solve job results.
|
|
16
|
+
|
|
17
|
+
This class defines an interface for operations related to solve job result
|
|
18
|
+
processing with specific parameters and behavior.
|
|
19
|
+
|
|
20
|
+
Attributes
|
|
21
|
+
----------
|
|
22
|
+
client : ILunaSolve
|
|
23
|
+
The client responsible for interacting with the solve service.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
@abstractmethod
|
|
27
|
+
def __init__(self, client: ILunaSolve) -> None:
|
|
28
|
+
pass
|
|
29
|
+
|
|
30
|
+
@abstractmethod
|
|
31
|
+
def __call__(
|
|
32
|
+
self,
|
|
33
|
+
solve_job: SolveJob,
|
|
34
|
+
sleep_time_max: float,
|
|
35
|
+
sleep_time_increment: float,
|
|
36
|
+
sleep_time_initial: float,
|
|
37
|
+
call_style: CallStyle,
|
|
38
|
+
) -> Solution | None:
|
|
39
|
+
"""
|
|
40
|
+
Callable method for retrieving the solve job results.
|
|
41
|
+
|
|
42
|
+
Abstract method for solving a given job with customizable retry settings,
|
|
43
|
+
including maximum sleep time, incremental sleep time adjustments, and
|
|
44
|
+
initial sleep time. The call style can also be specified.
|
|
45
|
+
|
|
46
|
+
Parameters
|
|
47
|
+
----------
|
|
48
|
+
solve_job : SolveJob
|
|
49
|
+
The job to be solved.
|
|
50
|
+
sleep_time_max : float
|
|
51
|
+
Maximum sleep time allowed between retries in seconds.
|
|
52
|
+
sleep_time_increment : float
|
|
53
|
+
Incremental value added to sleep time after each retry in seconds.
|
|
54
|
+
sleep_time_initial : float
|
|
55
|
+
Initial sleep time before the first retry in seconds.
|
|
56
|
+
call_style : CallStyle
|
|
57
|
+
The style in which the job solving is conducted.
|
|
58
|
+
|
|
59
|
+
Returns
|
|
60
|
+
-------
|
|
61
|
+
Optional[Solution]
|
|
62
|
+
The solution to the job if solving is successful, otherwise None.
|
|
63
|
+
"""
|
|
File without changes
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from .flexible_parameter_algorithm import FlexibleParameterAlgorithm
|
|
2
|
+
from .genetic_algorithms import QAGA, SAGA
|
|
3
|
+
from .lq_fda import FujitsuDA
|
|
4
|
+
from .optimization_solvers import SCIP
|
|
5
|
+
from .quantum_annealing import (
|
|
6
|
+
Kerberos,
|
|
7
|
+
LeapHybridBqm,
|
|
8
|
+
LeapHybridCqm,
|
|
9
|
+
ParallelTemperingQpu,
|
|
10
|
+
PopulationAnnealingQpu,
|
|
11
|
+
QBSolvLikeQpu,
|
|
12
|
+
QuantumAnnealing,
|
|
13
|
+
RepeatedReverseQuantumAnnealing,
|
|
14
|
+
)
|
|
15
|
+
from .quantum_gate import QAOA, QAOA_FO, VQE, FlexQAOA
|
|
16
|
+
from .search_algorithms import DialecticSearch, QBSolvLikeTabuSearch, TabuSearch
|
|
17
|
+
from .simulated_annealing import (
|
|
18
|
+
ParallelTempering,
|
|
19
|
+
PopulationAnnealing,
|
|
20
|
+
QBSolvLikeSimulatedAnnealing,
|
|
21
|
+
RepeatedReverseSimulatedAnnealing,
|
|
22
|
+
SimulatedAnnealing,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
__all__ = [
|
|
26
|
+
"QAGA",
|
|
27
|
+
"QAOA",
|
|
28
|
+
"QAOA_FO",
|
|
29
|
+
"SAGA",
|
|
30
|
+
"SCIP",
|
|
31
|
+
"VQE",
|
|
32
|
+
"DialecticSearch",
|
|
33
|
+
"FlexQAOA",
|
|
34
|
+
"FlexibleParameterAlgorithm",
|
|
35
|
+
"FujitsuDA",
|
|
36
|
+
"Kerberos",
|
|
37
|
+
"LeapHybridBqm",
|
|
38
|
+
"LeapHybridCqm",
|
|
39
|
+
"ParallelTempering",
|
|
40
|
+
"ParallelTemperingQpu",
|
|
41
|
+
"PopulationAnnealing",
|
|
42
|
+
"PopulationAnnealingQpu",
|
|
43
|
+
"QBSolvLikeQpu",
|
|
44
|
+
"QBSolvLikeSimulatedAnnealing",
|
|
45
|
+
"QBSolvLikeTabuSearch",
|
|
46
|
+
"QuantumAnnealing",
|
|
47
|
+
"RepeatedReverseQuantumAnnealing",
|
|
48
|
+
"RepeatedReverseSimulatedAnnealing",
|
|
49
|
+
"SimulatedAnnealing",
|
|
50
|
+
"TabuSearch",
|
|
51
|
+
]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from .decomposer import Decomposer
|
|
2
|
+
from .qaoa_circuit_params import BasicQAOAParams, LinearQAOAParams, RandomQAOAParams
|
|
3
|
+
from .quantum_annealing_params import QuantumAnnealingParams
|
|
4
|
+
from .scipy_optimizer import ScipyOptimizerParams
|
|
5
|
+
from .simulated_annealing_params import (
|
|
6
|
+
SimulatedAnnealingBaseParams,
|
|
7
|
+
SimulatedAnnealingParams,
|
|
8
|
+
)
|
|
9
|
+
from .tabu_kerberos_params import TabuKerberosParams
|
|
10
|
+
from .tabu_search_params import TabuSearchBaseParams, TabuSearchParams
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"BasicQAOAParams",
|
|
14
|
+
"Decomposer",
|
|
15
|
+
"LinearQAOAParams",
|
|
16
|
+
"QuantumAnnealingParams",
|
|
17
|
+
"RandomQAOAParams",
|
|
18
|
+
"ScipyOptimizerParams",
|
|
19
|
+
"SimulatedAnnealingBaseParams",
|
|
20
|
+
"SimulatedAnnealingParams",
|
|
21
|
+
"TabuKerberosParams",
|
|
22
|
+
"TabuSearchBaseParams",
|
|
23
|
+
"TabuSearchParams",
|
|
24
|
+
]
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Decomposer(BaseModel):
|
|
7
|
+
"""
|
|
8
|
+
Configuration for breaking down larger problems into subproblems for DWave QPUs.
|
|
9
|
+
|
|
10
|
+
Attributes
|
|
11
|
+
----------
|
|
12
|
+
size: int, default=10
|
|
13
|
+
Nominal number of variables in each subproblem. The actual subproblem can be
|
|
14
|
+
smaller depending on other parameters (e.g., `min_gain`).
|
|
15
|
+
|
|
16
|
+
min_gain: Optional[float], default=None
|
|
17
|
+
Minimum required energy reduction threshold for including a variable in the
|
|
18
|
+
subproblem. A variable is included only if flipping its value reduces the
|
|
19
|
+
BQM energy by at least this amount. If None, no minimum gain is required.
|
|
20
|
+
|
|
21
|
+
rolling: bool, default=True
|
|
22
|
+
Controls variable selection strategy for successive calls on the same
|
|
23
|
+
problem:
|
|
24
|
+
|
|
25
|
+
- True: Produces subproblems on different variables by rolling down the list
|
|
26
|
+
of all variables sorted by decreasing impact
|
|
27
|
+
- False: Always selects variables with the highest impact
|
|
28
|
+
|
|
29
|
+
rolling_history: float, default=1.0
|
|
30
|
+
Fraction of the problem size (range 0.0 to 1.0) that participates in the
|
|
31
|
+
rolling selection. Once this fraction of variables has been processed,
|
|
32
|
+
subproblem unrolling is reset. Min: 0.0, Max: 1.0
|
|
33
|
+
|
|
34
|
+
silent_rewind: bool, default=True
|
|
35
|
+
Controls behavior when resetting/rewinding the subproblem generator:
|
|
36
|
+
|
|
37
|
+
- True: Silently rewind when the reset condition is met
|
|
38
|
+
- False: Raises EndOfStream exception when rewinding
|
|
39
|
+
|
|
40
|
+
traversal: Literal["energy", "bfs", "pfs"], default="energy"
|
|
41
|
+
Algorithm used to select a subproblem of `size` variables:
|
|
42
|
+
|
|
43
|
+
- "energy": Selects the next `size` variables ordered by descending energy
|
|
44
|
+
impact
|
|
45
|
+
- "bfs": Uses breadth-first traversal seeded by the next variable in the
|
|
46
|
+
energy impact list
|
|
47
|
+
- "pfs": Uses priority-first traversal seeded by variables from the energy
|
|
48
|
+
impact list, proceeding with the variable on the search boundary having
|
|
49
|
+
the highest energy impact
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
size: int = 10
|
|
53
|
+
min_gain: float | None = None
|
|
54
|
+
rolling: bool = True
|
|
55
|
+
rolling_history: float = Field(default=1.0, ge=0.0, le=1.0)
|
|
56
|
+
silent_rewind: bool = True
|
|
57
|
+
traversal: Literal["energy", "bfs", "pfs"] = "energy"
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
from pydantic import BaseModel, Field, model_validator
|
|
5
|
+
|
|
6
|
+
from luna_quantum.solve.errors.solve_base_error import SolveBaseError
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class QAOAParamsMismatchError(SolveBaseError):
|
|
10
|
+
"""QAOA Parameters mismatch in length."""
|
|
11
|
+
|
|
12
|
+
def __init__(self, num_betas: int, num_gammas: int) -> None:
|
|
13
|
+
super().__init__(f"Parameter length must match: {num_betas=} {num_gammas=}")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class BasicQAOAParams(BaseModel):
|
|
17
|
+
"""Individual QAOA Parameters.
|
|
18
|
+
|
|
19
|
+
Parameters `betas` and `gammas` need to be of same size.
|
|
20
|
+
|
|
21
|
+
Attributes
|
|
22
|
+
----------
|
|
23
|
+
betas: list[float]
|
|
24
|
+
List of beta parameters for the mixer layers in QAOA.
|
|
25
|
+
gammas: list[float]
|
|
26
|
+
List of gamma parameters for the cost layers in QAOA.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
betas: list[float] = Field(
|
|
30
|
+
description="List of beta parameters for the mixer layers in QAOA."
|
|
31
|
+
)
|
|
32
|
+
gammas: list[float] = Field(
|
|
33
|
+
description="List of gamma parameters for the cost layers in QAOA."
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def reps(self) -> int:
|
|
38
|
+
"""Returns the number of layers."""
|
|
39
|
+
return len(self.betas)
|
|
40
|
+
|
|
41
|
+
@model_validator(mode="after")
|
|
42
|
+
def _check_matching(self) -> BasicQAOAParams:
|
|
43
|
+
if len(self.betas) != len(self.gammas):
|
|
44
|
+
raise QAOAParamsMismatchError(len(self.betas), len(self.gammas))
|
|
45
|
+
return self
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class LinearQAOAParams(BaseModel):
|
|
49
|
+
"""Linear QAOA Parameters.
|
|
50
|
+
|
|
51
|
+
Linearly decreasing beta parameters from `delta_beta` to zero. Linearly growing
|
|
52
|
+
paramters from zero to `delta_gamma`.
|
|
53
|
+
|
|
54
|
+
Attributes
|
|
55
|
+
----------
|
|
56
|
+
delta_beta: float
|
|
57
|
+
Parameter scaling for the beta paramters for the mixer layers in QAOA.
|
|
58
|
+
delta_gamma: float
|
|
59
|
+
Parameters scaling for the gamma parameters for the cost layers in QAOA.
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
delta_beta: float = Field(
|
|
63
|
+
description="Parameter scaling for the beta paramters for the mixer layers in "
|
|
64
|
+
"QAOA."
|
|
65
|
+
)
|
|
66
|
+
delta_gamma: float = Field(
|
|
67
|
+
description="Parameters scaling for the gamma parameters for the cost layers "
|
|
68
|
+
"in QAOA."
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class RandomQAOAParams(BaseModel):
|
|
73
|
+
"""Uniform random QAOA Parameter within predefined value ranges.
|
|
74
|
+
|
|
75
|
+
Attributes
|
|
76
|
+
----------
|
|
77
|
+
seed: int | None
|
|
78
|
+
Seed for random number generator.
|
|
79
|
+
beta_range: tuple[float, float]
|
|
80
|
+
Value range for uniform random beta parameters (mixer layer).
|
|
81
|
+
gamma_range: tuple[float, float]
|
|
82
|
+
Value range for uniform random gamma parameters (cost layer).
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
seed: int | None = Field(
|
|
86
|
+
default=None, description="Seed for random number generator."
|
|
87
|
+
)
|
|
88
|
+
beta_range: tuple[float, float] = Field(
|
|
89
|
+
default=(0, 2 * np.pi),
|
|
90
|
+
description="Value range for uniform random beta parameters (mixer layer).",
|
|
91
|
+
)
|
|
92
|
+
gamma_range: tuple[float, float] = Field(
|
|
93
|
+
default=(0, 2 * np.pi),
|
|
94
|
+
description="Value range for uniform random gamma parameters (cost layer).",
|
|
95
|
+
)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class QuantumAnnealingParams(BaseModel):
|
|
5
|
+
"""
|
|
6
|
+
Parameters for quantum annealing sampling on physical quantum processors (QPUs).
|
|
7
|
+
|
|
8
|
+
These parameters control the quantum annealing process on hardware devices like
|
|
9
|
+
D-Wave quantum annealers, specifying how the annealing is performed, how many
|
|
10
|
+
samples to collect, and various hardware-specific settings that affect solution
|
|
11
|
+
quality and runtime.
|
|
12
|
+
|
|
13
|
+
Attributes
|
|
14
|
+
----------
|
|
15
|
+
anneal_offsets: list[float] | None
|
|
16
|
+
Per-qubit time offsets for the annealing path in normalized annealing time
|
|
17
|
+
units. List of floats with length equal to the number of qubits. Default is
|
|
18
|
+
None.
|
|
19
|
+
anneal_schedule: list[tuple[float, float]] | None
|
|
20
|
+
Custom schedule for the annealing process as a list of (time, s) pairs.
|
|
21
|
+
Time is in normalized units [0, 1] and s is the annealing parameter [0, 1].
|
|
22
|
+
Default is None.
|
|
23
|
+
annealing_time: float | None
|
|
24
|
+
Duration of the annealing process in microseconds. Must be within the range
|
|
25
|
+
supported by the QPU hardware. Default is None.
|
|
26
|
+
auto_scale: bool | None
|
|
27
|
+
Whether to automatically normalize the problem energy range to use the full
|
|
28
|
+
range of h and J values supported by the hardware. Default is None.
|
|
29
|
+
fast_anneal: bool
|
|
30
|
+
Use accelerated annealing protocol for shorter annealing times. Default is
|
|
31
|
+
False.
|
|
32
|
+
flux_biases: list[float] | None
|
|
33
|
+
Custom flux bias offsets for each qubit in units of Φ₀ (flux quantum).
|
|
34
|
+
List length must equal the number of qubits. Default is None.
|
|
35
|
+
flux_drift_compensation: bool
|
|
36
|
+
Whether to compensate for drift in qubit flux over time using real-time
|
|
37
|
+
calibration data. Default is True.
|
|
38
|
+
h_gain_schedule: list[tuple[float, float]] | None
|
|
39
|
+
Schedule for h-gain during annealing as a list of (time, gain) pairs.
|
|
40
|
+
Time is in normalized units [0, 1]. Default is None.
|
|
41
|
+
initial_state: list[int] | None
|
|
42
|
+
Starting state for the annealing process. List of {-1, +1} values with
|
|
43
|
+
length equal to the number of qubits. Default is None.
|
|
44
|
+
max_answers: int | None
|
|
45
|
+
Maximum number of unique answer states to return. Must be ≤ num_reads.
|
|
46
|
+
Default is None.
|
|
47
|
+
num_reads: int
|
|
48
|
+
Number of annealing cycles to perform. Must be positive integer.
|
|
49
|
+
Default is 1.
|
|
50
|
+
programming_thermalization: float | None
|
|
51
|
+
Wait time after programming the QPU in microseconds to allow the system
|
|
52
|
+
to thermalize. Default is None.
|
|
53
|
+
readout_thermalization: float | None
|
|
54
|
+
Wait time after each anneal before reading results in microseconds.
|
|
55
|
+
Default is None.
|
|
56
|
+
reduce_intersample_correlation: bool
|
|
57
|
+
Whether to add delay between samples to reduce correlation between
|
|
58
|
+
consecutive measurements. Default is False.
|
|
59
|
+
reinitialize_state: bool | None
|
|
60
|
+
Whether to reset to a new initial state between reads to reduce correlation.
|
|
61
|
+
Default is None.
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
anneal_offsets: list[float] | None = None
|
|
65
|
+
anneal_schedule: list[tuple[float, float]] | None = None
|
|
66
|
+
annealing_time: float | None = Field(default=None, gt=0)
|
|
67
|
+
auto_scale: bool | None = None
|
|
68
|
+
fast_anneal: bool = False
|
|
69
|
+
flux_biases: list[float] | None = None
|
|
70
|
+
flux_drift_compensation: bool = True
|
|
71
|
+
h_gain_schedule: list[tuple[float, float]] | None = None
|
|
72
|
+
|
|
73
|
+
initial_state: list[int] | None = None
|
|
74
|
+
max_answers: int | None = Field(default=None, ge=1)
|
|
75
|
+
num_reads: int = Field(default=1, ge=1)
|
|
76
|
+
programming_thermalization: float | None = Field(default=None, gt=0)
|
|
77
|
+
readout_thermalization: float | None = Field(default=None, gt=0)
|
|
78
|
+
reduce_intersample_correlation: bool = False
|
|
79
|
+
reinitialize_state: bool | None = None
|