luna-quantum 1.0.0__cp311-cp311-musllinux_1_2_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 +96 -0
- luna_quantum/__init__.pyi +68 -0
- luna_quantum/_core.cpython-311-x86_64-linux-musl.so +0 -0
- luna_quantum/_core.pyi +3017 -0
- luna_quantum/aqm_overwrites/__init__.py +3 -0
- luna_quantum/aqm_overwrites/model.py +184 -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 +153 -0
- luna_quantum/client/controllers/luna_q.py +62 -0
- luna_quantum/client/controllers/luna_solve.py +125 -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 +36 -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 +76 -0
- luna_quantum/client/rest_client/model_rest_client.py +216 -0
- luna_quantum/client/rest_client/qpu_token_rest_client.py +504 -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 +49 -0
- luna_quantum/client/schemas/create/__init__.py +6 -0
- luna_quantum/client/schemas/create/circuit.py +31 -0
- luna_quantum/client/schemas/create/optimization.py +39 -0
- luna_quantum/client/schemas/create/qpu_token.py +25 -0
- luna_quantum/client/schemas/create/qpu_token_time_quota.py +29 -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 +161 -0
- luna_quantum/client/schemas/qpu_token/qpu_token_source.py +19 -0
- luna_quantum/client/schemas/qpu_token/qpu_token_time_quota.py +28 -0
- luna_quantum/client/schemas/qpu_token/token_provider.py +135 -0
- luna_quantum/client/schemas/representation.py +19 -0
- luna_quantum/client/schemas/solution.py +106 -0
- luna_quantum/client/schemas/solve_job.py +47 -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/errors.py +1 -0
- luna_quantum/errors.pyi +202 -0
- luna_quantum/exceptions/__init__.py +0 -0
- luna_quantum/exceptions/base_luna_quantum_error.py +2 -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 +75 -0
- luna_quantum/factories/usecase_factory.py +457 -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 +203 -0
- luna_quantum/solve/domain/abstract/qpu_token_backend.py +34 -0
- luna_quantum/solve/domain/model_metadata.py +54 -0
- luna_quantum/solve/domain/solve_job.py +187 -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 +47 -0
- luna_quantum/solve/interfaces/backend_i.py +28 -0
- luna_quantum/solve/interfaces/usecases/__init__.py +55 -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_result_usecase_i.py +63 -0
- luna_quantum/solve/parameters/__init__.py +0 -0
- luna_quantum/solve/parameters/algorithms/__init__.py +49 -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 +78 -0
- luna_quantum/solve/parameters/algorithms/base_params/scipy_optimizer.py +120 -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/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 +105 -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 +26 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/flex_qaoa/config.py +80 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/flex_qaoa/flex_qaoa.py +226 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/flex_qaoa/optimizers.py +97 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/flex_qaoa/pipeline.py +87 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/qaoa.py +104 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/qaoa_fo.py +69 -0
- luna_quantum/solve/parameters/algorithms/quantum_gate/vqe.py +109 -0
- luna_quantum/solve/parameters/algorithms/search_algorithms/__init__.py +5 -0
- luna_quantum/solve/parameters/algorithms/search_algorithms/dialectic_search.py +152 -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 +20 -0
- luna_quantum/solve/parameters/backends/aqarios.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/dwave.py +17 -0
- luna_quantum/solve/parameters/backends/dwave_qpu.py +164 -0
- luna_quantum/solve/parameters/backends/ibm.py +132 -0
- luna_quantum/solve/parameters/backends/qctrl.py +130 -0
- luna_quantum/solve/parameters/backends/zib.py +17 -0
- luna_quantum/solve/parameters/constants.py +11 -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 +56 -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_result_usecase.py +97 -0
- luna_quantum/translator.py +1 -0
- luna_quantum/translator.pyi +833 -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/log_utils.py +167 -0
- luna_quantum/util/pretty_base.py +67 -0
- luna_quantum/util/pydantic_utils.py +38 -0
- luna_quantum/utils.py +54 -0
- luna_quantum/utils.pyi +35 -0
- luna_quantum-1.0.0.dist-info/METADATA +37 -0
- luna_quantum-1.0.0.dist-info/RECORD +253 -0
- luna_quantum-1.0.0.dist-info/WHEEL +4 -0
- luna_quantum-1.0.0.dist-info/licenses/LICENSE +176 -0
- luna_quantum-1.0.0.dist-info/licenses/NOTICE +13 -0
- luna_quantum.libs/libgcc_s-02f3f192.so.1 +0 -0
luna_quantum/solve/parameters/algorithms/simulated_annealing/repeated_reverse_simulated_annealing.py
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from pydantic import Field
|
|
6
|
+
|
|
7
|
+
from luna_quantum.solve.domain.abstract import LunaAlgorithm
|
|
8
|
+
from luna_quantum.solve.parameters.algorithms.base_params import (
|
|
9
|
+
SimulatedAnnealingParams,
|
|
10
|
+
)
|
|
11
|
+
from luna_quantum.solve.parameters.backends import DWave
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class RepeatedReverseSimulatedAnnealing(SimulatedAnnealingParams, LunaAlgorithm[DWave]):
|
|
15
|
+
"""
|
|
16
|
+
Parameters for the Repeated Reverse Simulated Annealing solver.
|
|
17
|
+
|
|
18
|
+
This algorithm applies principles similar to quantum reverse annealing but in a
|
|
19
|
+
classical context. It starts from specified states, partially "reverses" the
|
|
20
|
+
annealing by increasing temperature to explore nearby states, then re-anneals to
|
|
21
|
+
find improved solutions. This process repeats for multiple iterations, refining
|
|
22
|
+
solutions progressively.
|
|
23
|
+
|
|
24
|
+
The approach is particularly effective for problems with complex energy landscapes
|
|
25
|
+
where standard simulated annealing might get trapped in local optima.
|
|
26
|
+
|
|
27
|
+
Attributes
|
|
28
|
+
----------
|
|
29
|
+
num_reads_per_iter: list[int] | None
|
|
30
|
+
Number of reads (independent runs) to perform in each iteration.
|
|
31
|
+
Uses num_reads_per_iter[i] in iteration i, and num_reads_per_iter[-1] once
|
|
32
|
+
the list is exhausted. If None, uses the num_reads value inherited from
|
|
33
|
+
SimulatedAnnealingParams. This allows dynamic control of sampling intensity
|
|
34
|
+
across iterations, typically starting with broader exploration and focusing
|
|
35
|
+
on refinement in later iterations. Minimum list length: 1.
|
|
36
|
+
Default is None.
|
|
37
|
+
initial_states: Any | None
|
|
38
|
+
Starting states for the first iteration. Each state defines values for all
|
|
39
|
+
problem variables and serves as a starting point for the reverse annealing
|
|
40
|
+
process. If fewer states than reads are provided, additional states are
|
|
41
|
+
generated according to the initial_states_generator setting inherited from
|
|
42
|
+
SimulatedAnnealingParams. Providing good initial states (e.g., from classical
|
|
43
|
+
heuristics) can significantly improve solution quality.
|
|
44
|
+
Default is None, which generates random initial states.
|
|
45
|
+
timeout: float
|
|
46
|
+
Maximum runtime in seconds before termination, regardless of other stopping
|
|
47
|
+
criteria. Provides a hard time limit for time-constrained applications.
|
|
48
|
+
Default is 5.0 seconds, which is suitable for small to medium-sized problems.
|
|
49
|
+
For larger or more complex problems, consider increasing this value.
|
|
50
|
+
max_iter: int
|
|
51
|
+
Maximum number of reverse annealing iterations to perform. Each iteration
|
|
52
|
+
involves: starting from the best states found so far, raising temperature to
|
|
53
|
+
explore nearby configurations, then gradually cooling to refine solutions.
|
|
54
|
+
More iterations generally improve solution quality but increase runtime.
|
|
55
|
+
Default is 10, providing a good balance for most problems.
|
|
56
|
+
target: Any | None
|
|
57
|
+
Target energy value that triggers early termination if reached. Allows the
|
|
58
|
+
algorithm to stop when a solution of sufficient quality is found, even before
|
|
59
|
+
reaching max_iter or timeout. Default is None, which means the algorithm will
|
|
60
|
+
run until other stopping criteria are met.
|
|
61
|
+
|
|
62
|
+
num_sweeps_per_beta: int
|
|
63
|
+
Number of sweeps to perform at each temperature before cooling. More sweeps
|
|
64
|
+
per temperature allow better exploration at each temperature level.
|
|
65
|
+
Default is 1, which works well for many problems.
|
|
66
|
+
seed: Optional[int]
|
|
67
|
+
Random seed for reproducible results. Using the same seed with identical
|
|
68
|
+
parameters produces identical results. Default is None (random seed).
|
|
69
|
+
beta_schedule: Sequence[float] | None
|
|
70
|
+
Explicit sequence of beta (inverse temperature) values to use. Provides
|
|
71
|
+
complete control over the cooling schedule. Format must be compatible
|
|
72
|
+
with numpy.array.
|
|
73
|
+
Default is None, which generates a schedule based on beta_range and
|
|
74
|
+
beta_schedule_type.
|
|
75
|
+
initial_states: Optional[Any]
|
|
76
|
+
One or more starting states, each defining values for all problem variables.
|
|
77
|
+
This allows the algorithm to start from promising regions rather than random
|
|
78
|
+
points.
|
|
79
|
+
Default is None (random starting states).
|
|
80
|
+
randomize_order: bool
|
|
81
|
+
When True, variables are updated in random order during each sweep.
|
|
82
|
+
When False, variables are updated sequentially. Random updates preserve
|
|
83
|
+
symmetry of the model but are slightly slower. Default is False for
|
|
84
|
+
efficiency.
|
|
85
|
+
proposal_acceptance_criteria: Literal["Gibbs", "Metropolis"]
|
|
86
|
+
Method for accepting or rejecting proposed moves:
|
|
87
|
+
- "Gibbs": Samples directly from conditional probability distribution
|
|
88
|
+
- "Metropolis": Uses Metropolis-Hastings rule (accept if improving,
|
|
89
|
+
otherwise accept with probability based on energy difference and
|
|
90
|
+
temperature)
|
|
91
|
+
Default is "Metropolis", which is typically faster and works well for most
|
|
92
|
+
problems.
|
|
93
|
+
num_reads : Union[int, None]
|
|
94
|
+
Number of independent runs of the algorithm, each producing one solution
|
|
95
|
+
sample. Multiple reads with different random starting points increase the
|
|
96
|
+
chance of finding the global optimum. Default is None, which matches the
|
|
97
|
+
number of initial
|
|
98
|
+
states (or just one read if no initial states are provided).
|
|
99
|
+
num_sweeps : Union[int, None]
|
|
100
|
+
Number of iterations/sweeps per run, where each sweep updates all variables
|
|
101
|
+
once. More sweeps allow more thorough exploration but increase runtime.
|
|
102
|
+
Default is 1,000, suitable for small to medium problems.
|
|
103
|
+
beta_range : Union[List[float], Tuple[float, float], None]
|
|
104
|
+
The inverse temperature (β=1/T) schedule endpoints, specified as [start,
|
|
105
|
+
end]. A wider range allows more exploration. Default is calculated based
|
|
106
|
+
on the
|
|
107
|
+
problem's energy scale to ensure appropriate acceptance probabilities.
|
|
108
|
+
beta_schedule_type : Literal["linear", "geometric"]
|
|
109
|
+
How beta values change between endpoints:
|
|
110
|
+
- "linear": Equal steps (β₁, β₂, ...) - smoother transitions
|
|
111
|
+
- "geometric": Multiplicative steps (β₁, r·β₁, r²·β₁, ...) - spends more
|
|
112
|
+
time at lower temperatures for fine-tuning
|
|
113
|
+
Default is "geometric", which often performs better for optimization
|
|
114
|
+
problems.
|
|
115
|
+
initial_states_generator : Literal["none", "tile", "random"]
|
|
116
|
+
How to handle cases with fewer initial states than num_reads:
|
|
117
|
+
- "none": Raises error if insufficient initial states
|
|
118
|
+
- "tile": Reuses provided states by cycling through them
|
|
119
|
+
- "random": Generates additional random states as needed
|
|
120
|
+
Default is "random", which maximizes exploration.
|
|
121
|
+
"""
|
|
122
|
+
|
|
123
|
+
num_reads_per_iter: list[int] | None = Field(default=None, min_length=1)
|
|
124
|
+
initial_states: Any | None = None
|
|
125
|
+
timeout: float = 5.0
|
|
126
|
+
max_iter: int = 10
|
|
127
|
+
target: Any | None = None
|
|
128
|
+
|
|
129
|
+
@property
|
|
130
|
+
def algorithm_name(self) -> str:
|
|
131
|
+
"""
|
|
132
|
+
Returns the name of the algorithm.
|
|
133
|
+
|
|
134
|
+
This abstract property method is intended to be overridden by subclasses.
|
|
135
|
+
It should provide the name of the algorithm being implemented.
|
|
136
|
+
|
|
137
|
+
Returns
|
|
138
|
+
-------
|
|
139
|
+
str
|
|
140
|
+
The name of the algorithm.
|
|
141
|
+
"""
|
|
142
|
+
return "RRSA"
|
|
143
|
+
|
|
144
|
+
@classmethod
|
|
145
|
+
def get_default_backend(cls) -> DWave:
|
|
146
|
+
"""
|
|
147
|
+
Return the default backend implementation.
|
|
148
|
+
|
|
149
|
+
This property must be implemented by subclasses to provide
|
|
150
|
+
the default backend instance to use when no specific backend
|
|
151
|
+
is specified.
|
|
152
|
+
|
|
153
|
+
Returns
|
|
154
|
+
-------
|
|
155
|
+
IBackend
|
|
156
|
+
An instance of a class implementing the IBackend interface that serves
|
|
157
|
+
as the default backend.
|
|
158
|
+
"""
|
|
159
|
+
return DWave()
|
|
160
|
+
|
|
161
|
+
@classmethod
|
|
162
|
+
def get_compatible_backends(cls) -> tuple[type[DWave], ...]:
|
|
163
|
+
"""
|
|
164
|
+
Check at runtime if the used backend is compatible with the solver.
|
|
165
|
+
|
|
166
|
+
Returns
|
|
167
|
+
-------
|
|
168
|
+
tuple[type[IBackend], ...]
|
|
169
|
+
True if the backend is compatible with the solver, False otherwise.
|
|
170
|
+
|
|
171
|
+
"""
|
|
172
|
+
return (DWave,)
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
from luna_quantum.solve.domain.abstract import LunaAlgorithm
|
|
2
|
+
from luna_quantum.solve.parameters.algorithms.base_params import (
|
|
3
|
+
SimulatedAnnealingParams,
|
|
4
|
+
)
|
|
5
|
+
from luna_quantum.solve.parameters.backends import DWave
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class SimulatedAnnealing(SimulatedAnnealingParams, LunaAlgorithm[DWave]):
|
|
9
|
+
"""
|
|
10
|
+
Simulated Annealing optimization algorithm.
|
|
11
|
+
|
|
12
|
+
Simulated Annealing mimics the physical annealing process where a material is heated
|
|
13
|
+
and then slowly cooled to remove defects. In optimization, this translates to
|
|
14
|
+
initially accepting many non-improving moves (high temperature) and gradually
|
|
15
|
+
becoming more selective (cooling) to converge to an optimum.
|
|
16
|
+
|
|
17
|
+
This class inherits all parameters from SimulatedAnnealingParams, providing a
|
|
18
|
+
complete set of controls for fine-grained customization of the annealing process.
|
|
19
|
+
|
|
20
|
+
Attributes
|
|
21
|
+
----------
|
|
22
|
+
num_sweeps_per_beta: int
|
|
23
|
+
Number of sweeps to perform at each temperature before cooling. More sweeps
|
|
24
|
+
per temperature allow better exploration at each temperature level.
|
|
25
|
+
Default is 1, which works well for many problems.
|
|
26
|
+
seed: Optional[int]
|
|
27
|
+
Random seed for reproducible results. Using the same seed with identical
|
|
28
|
+
parameters produces identical results. Default is None (random seed).
|
|
29
|
+
beta_schedule: Sequence[float] | None
|
|
30
|
+
Explicit sequence of beta (inverse temperature) values to use. Provides
|
|
31
|
+
complete control over the cooling schedule. Format must be compatible
|
|
32
|
+
with numpy.array. Default is None, which generates a schedule based on
|
|
33
|
+
beta_range and
|
|
34
|
+
beta_schedule_type.
|
|
35
|
+
initial_states: Optional[Any]
|
|
36
|
+
One or more starting states, each defining values for all problem variables.
|
|
37
|
+
This allows the algorithm to start from promising regions rather than random
|
|
38
|
+
points.
|
|
39
|
+
Default is None (random starting states).
|
|
40
|
+
randomize_order: bool
|
|
41
|
+
When True, variables are updated in random order during each sweep.
|
|
42
|
+
When False, variables are updated sequentially. Random updates preserve
|
|
43
|
+
symmetry of the model but are slightly slower. Default is False for
|
|
44
|
+
efficiency.
|
|
45
|
+
proposal_acceptance_criteria: Literal["Gibbs", "Metropolis"]
|
|
46
|
+
Method for accepting or rejecting proposed moves:
|
|
47
|
+
- "Gibbs": Samples directly from conditional probability distribution
|
|
48
|
+
- "Metropolis": Uses Metropolis-Hastings rule (accept if improving,
|
|
49
|
+
otherwise accept with probability based on energy difference and
|
|
50
|
+
temperature)
|
|
51
|
+
Default is "Metropolis", which is typically faster and works well for most
|
|
52
|
+
problems.
|
|
53
|
+
num_reads : Union[int, None]
|
|
54
|
+
Number of independent runs of the algorithm, each producing one solution
|
|
55
|
+
sample. Multiple reads with different random starting points increase the
|
|
56
|
+
chance of finding the global optimum. Default is None, which matches the
|
|
57
|
+
number of initial states (or just one read if no initial states are
|
|
58
|
+
provided).
|
|
59
|
+
num_sweeps : Union[int, None]
|
|
60
|
+
Number of iterations/sweeps per run, where each sweep updates all variables
|
|
61
|
+
once. More sweeps allow more thorough exploration but increase runtime.
|
|
62
|
+
Default is 1,000, suitable for small to medium problems.
|
|
63
|
+
beta_range : Union[List[float], Tuple[float, float], None]
|
|
64
|
+
The inverse temperature (β=1/T) schedule endpoints, specified as [start,
|
|
65
|
+
end]. A wider range allows more exploration. Default is calculated based
|
|
66
|
+
on the
|
|
67
|
+
problem's energy scale to ensure appropriate acceptance probabilities.
|
|
68
|
+
beta_schedule_type : Literal["linear", "geometric"]
|
|
69
|
+
How beta values change between endpoints:
|
|
70
|
+
- "linear": Equal steps (β₁, β₂, ...) - smoother transitions
|
|
71
|
+
- "geometric": Multiplicative steps (β₁, r·β₁, r²·β₁, ...) - spends more
|
|
72
|
+
time at lower temperatures for fine-tuning
|
|
73
|
+
Default is "geometric", which often performs better for optimization
|
|
74
|
+
problems.
|
|
75
|
+
initial_states_generator : Literal["none", "tile", "random"]
|
|
76
|
+
How to handle cases with fewer initial states than num_reads:
|
|
77
|
+
- "none": Raises error if insufficient initial states
|
|
78
|
+
- "tile": Reuses provided states by cycling through them
|
|
79
|
+
- "random": Generates additional random states as needed
|
|
80
|
+
Default is "random", which maximizes exploration.
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def algorithm_name(self) -> str:
|
|
85
|
+
"""
|
|
86
|
+
Returns the name of the algorithm.
|
|
87
|
+
|
|
88
|
+
This abstract property method is intended to be overridden by subclasses.
|
|
89
|
+
It should provide the name of the algorithm being implemented.
|
|
90
|
+
|
|
91
|
+
Returns
|
|
92
|
+
-------
|
|
93
|
+
str
|
|
94
|
+
The name of the algorithm.
|
|
95
|
+
"""
|
|
96
|
+
return "SA"
|
|
97
|
+
|
|
98
|
+
@classmethod
|
|
99
|
+
def get_default_backend(cls) -> DWave:
|
|
100
|
+
"""
|
|
101
|
+
Return the default backend implementation.
|
|
102
|
+
|
|
103
|
+
This property must be implemented by subclasses to provide
|
|
104
|
+
the default backend instance to use when no specific backend
|
|
105
|
+
is specified.
|
|
106
|
+
|
|
107
|
+
Returns
|
|
108
|
+
-------
|
|
109
|
+
IBackend
|
|
110
|
+
An instance of a class implementing the IBackend interface that serves
|
|
111
|
+
as the default backend.
|
|
112
|
+
"""
|
|
113
|
+
return DWave()
|
|
114
|
+
|
|
115
|
+
@classmethod
|
|
116
|
+
def get_compatible_backends(cls) -> tuple[type[DWave], ...]:
|
|
117
|
+
"""
|
|
118
|
+
Check at runtime if the used backend is compatible with the solver.
|
|
119
|
+
|
|
120
|
+
Returns
|
|
121
|
+
-------
|
|
122
|
+
tuple[type[IBackend], ...]
|
|
123
|
+
True if the backend is compatible with the solver, False otherwise.
|
|
124
|
+
|
|
125
|
+
"""
|
|
126
|
+
return (DWave,)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from .aqarios import Aqarios
|
|
2
|
+
from .aws import AWS, IQM, IonQ, Rigetti
|
|
3
|
+
from .dwave import DWave
|
|
4
|
+
from .dwave_qpu import DWaveQpu
|
|
5
|
+
from .ibm import IBM
|
|
6
|
+
from .qctrl import Qctrl
|
|
7
|
+
from .zib import ZIB
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"AWS",
|
|
11
|
+
"IBM",
|
|
12
|
+
"IQM",
|
|
13
|
+
"ZIB",
|
|
14
|
+
"Aqarios",
|
|
15
|
+
"DWave",
|
|
16
|
+
"DWaveQpu",
|
|
17
|
+
"IonQ",
|
|
18
|
+
"Qctrl",
|
|
19
|
+
"Rigetti",
|
|
20
|
+
]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from luna_quantum.solve.interfaces.backend_i import IBackend
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Aqarios(IBackend):
|
|
5
|
+
"""Configuration class for the Aqarios backend."""
|
|
6
|
+
|
|
7
|
+
@property
|
|
8
|
+
def provider(self) -> str:
|
|
9
|
+
"""
|
|
10
|
+
Retrieve the name of the provider.
|
|
11
|
+
|
|
12
|
+
Returns
|
|
13
|
+
-------
|
|
14
|
+
str
|
|
15
|
+
The name of the provider.
|
|
16
|
+
"""
|
|
17
|
+
return "aqarios"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
from pydantic import computed_field
|
|
4
|
+
|
|
5
|
+
from .aws_backend_base import AWSBackendBase
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AWS(AWSBackendBase):
|
|
9
|
+
"""
|
|
10
|
+
Configuration parameters for AWS simulator backends.
|
|
11
|
+
|
|
12
|
+
Attributes
|
|
13
|
+
----------
|
|
14
|
+
device: Literal["SV1", "DM1", "TN1"], default="SV1"
|
|
15
|
+
The specific AWS simulator to use for computations. Options are:
|
|
16
|
+
|
|
17
|
+
- "SV1": State vector simulator for smaller quantum circuits
|
|
18
|
+
- "DM1": Density matrix simulator for noisy quantum circuits
|
|
19
|
+
- "TN1": Tensor network simulator for larger quantum circuits
|
|
20
|
+
|
|
21
|
+
See the [AWS Braket
|
|
22
|
+
docs](https://docs.aws.amazon.com/braket/latest/developerguide/choose-a-simulator.html)
|
|
23
|
+
aws_access_key: str | QpuToken | None
|
|
24
|
+
The AWS access key
|
|
25
|
+
aws_secret_access_key: str | QpuToken | None
|
|
26
|
+
The AWS secret access key
|
|
27
|
+
aws_session_token: str | QpuToken | None
|
|
28
|
+
The AWS session token
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
@computed_field
|
|
32
|
+
def device_provider(self) -> str:
|
|
33
|
+
"""Return the device provider identifier."""
|
|
34
|
+
return "Amazon"
|
|
35
|
+
|
|
36
|
+
device: Literal["SV1", "DM1", "TN1"] = "SV1"
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
from pydantic import Field
|
|
2
|
+
|
|
3
|
+
from luna_quantum.client.schemas.qpu_token.qpu_token import (
|
|
4
|
+
QpuToken,
|
|
5
|
+
QpuTokenSource,
|
|
6
|
+
TokenProvider,
|
|
7
|
+
)
|
|
8
|
+
from luna_quantum.solve.domain.abstract.qpu_token_backend import QpuTokenBackend
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AWSBackendBase(QpuTokenBackend):
|
|
12
|
+
"""AWS Backend Mixin.
|
|
13
|
+
|
|
14
|
+
Attributes
|
|
15
|
+
----------
|
|
16
|
+
aws_access_key: str | QpuToken | None
|
|
17
|
+
The AWS access key
|
|
18
|
+
aws_secret_access_key: str | QpuToken | None
|
|
19
|
+
The AWS secret access key
|
|
20
|
+
aws_session_token: str | QpuToken | None
|
|
21
|
+
The AWS session token
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
aws_access_key: str | QpuToken | None = Field(
|
|
25
|
+
repr=False, exclude=True, default=None
|
|
26
|
+
)
|
|
27
|
+
aws_secret_access_key: str | QpuToken | None = Field(
|
|
28
|
+
repr=False, exclude=True, default=None
|
|
29
|
+
)
|
|
30
|
+
aws_session_token: str | QpuToken | None = Field(
|
|
31
|
+
repr=False, exclude=True, default=None
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def provider(self) -> str:
|
|
36
|
+
"""
|
|
37
|
+
Retrieve the name of the provider.
|
|
38
|
+
|
|
39
|
+
Returns
|
|
40
|
+
-------
|
|
41
|
+
str
|
|
42
|
+
The name of the provider.
|
|
43
|
+
"""
|
|
44
|
+
return "aws"
|
|
45
|
+
|
|
46
|
+
def _get_token(self) -> TokenProvider | None:
|
|
47
|
+
if self.aws_access_key is None and self.aws_secret_access_key is None:
|
|
48
|
+
return None
|
|
49
|
+
|
|
50
|
+
token_provider = TokenProvider()
|
|
51
|
+
if isinstance(self.aws_access_key, QpuToken):
|
|
52
|
+
token_provider.aws_access_key = self.aws_access_key
|
|
53
|
+
elif isinstance(self.aws_access_key, str):
|
|
54
|
+
token_provider.aws_access_key = QpuToken(
|
|
55
|
+
source=QpuTokenSource.INLINE,
|
|
56
|
+
token=self.aws_access_key,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
if isinstance(self.aws_secret_access_key, QpuToken):
|
|
60
|
+
token_provider.aws_secret_access_key = self.aws_secret_access_key
|
|
61
|
+
elif isinstance(self.aws_secret_access_key, str):
|
|
62
|
+
token_provider.aws_secret_access_key = QpuToken(
|
|
63
|
+
source=QpuTokenSource.INLINE,
|
|
64
|
+
token=self.aws_secret_access_key,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
if isinstance(self.aws_session_token, QpuToken):
|
|
68
|
+
token_provider.aws_session_token = self.aws_session_token
|
|
69
|
+
elif isinstance(self.aws_session_token, str):
|
|
70
|
+
token_provider.aws_session_token = QpuToken(
|
|
71
|
+
source=QpuTokenSource.INLINE,
|
|
72
|
+
token=self.aws_session_token,
|
|
73
|
+
)
|
|
74
|
+
return token_provider
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
from pydantic import computed_field
|
|
4
|
+
|
|
5
|
+
from .aws_backend_base import AWSBackendBase
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class IonQ(AWSBackendBase):
|
|
9
|
+
"""
|
|
10
|
+
Configuration parameters for IonQ quantum backends, accessed via AWS.
|
|
11
|
+
|
|
12
|
+
Attributes
|
|
13
|
+
----------
|
|
14
|
+
device: Literal["Aria1", "Aria2", "Forte1", "ForteEnterprise1"], \
|
|
15
|
+
default="Aria1"
|
|
16
|
+
The specific IonQ quantum device to use for computations. Options are:
|
|
17
|
+
|
|
18
|
+
- "Aria1": IonQ's flagship trapped-ion quantum computer
|
|
19
|
+
- "Aria2": Next-generation IonQ system with improved connectivity
|
|
20
|
+
- "Forte1": IonQ's enterprise-grade quantum system
|
|
21
|
+
- "ForteEnterprise1": Enhanced enterprise version with dedicated access
|
|
22
|
+
|
|
23
|
+
Different devices have varying characteristics such as qubit count,
|
|
24
|
+
connectivity, and error rates.
|
|
25
|
+
aws_access_key: str | QpuToken | None
|
|
26
|
+
The AWS access key
|
|
27
|
+
aws_secret_access_key: str | QpuToken | None
|
|
28
|
+
The AWS secret access key
|
|
29
|
+
aws_session_token: str | QpuToken | None
|
|
30
|
+
The AWS session token
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
device: Literal[
|
|
34
|
+
"Aria1",
|
|
35
|
+
"Aria2",
|
|
36
|
+
"Forte1",
|
|
37
|
+
"ForteEnterprise1",
|
|
38
|
+
] = "Aria1"
|
|
39
|
+
|
|
40
|
+
@computed_field
|
|
41
|
+
def device_provider(self) -> str:
|
|
42
|
+
"""Return the device provider identifier."""
|
|
43
|
+
return "IonQ"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
from pydantic import computed_field
|
|
4
|
+
|
|
5
|
+
from .aws_backend_base import AWSBackendBase
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class IQM(AWSBackendBase):
|
|
9
|
+
"""
|
|
10
|
+
Configuration parameters for IQM quantum backends, accessed via AWS.
|
|
11
|
+
|
|
12
|
+
Attributes
|
|
13
|
+
----------
|
|
14
|
+
device: Literal["Garnet"], default="Garnet"
|
|
15
|
+
The specific IQM quantum device to use for computations. Currently only
|
|
16
|
+
"Garnet" is available - IQM's superconducting quantum processor with
|
|
17
|
+
native two-qubit gates and optimized for near-term algorithms.
|
|
18
|
+
aws_access_key: str | QpuToken | None
|
|
19
|
+
The AWS access key
|
|
20
|
+
aws_secret_access_key: str | QpuToken | None
|
|
21
|
+
The AWS secret access key
|
|
22
|
+
aws_session_token: str | QpuToken | None
|
|
23
|
+
The AWS session token
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
device: Literal["Garnet"] = "Garnet"
|
|
27
|
+
|
|
28
|
+
@computed_field
|
|
29
|
+
def device_provider(self) -> str:
|
|
30
|
+
"""Return the device provider identifier."""
|
|
31
|
+
return "IQM"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
from pydantic import computed_field
|
|
4
|
+
|
|
5
|
+
from .aws_backend_base import AWSBackendBase
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Rigetti(AWSBackendBase):
|
|
9
|
+
"""
|
|
10
|
+
Configuration parameters for Rigetti quantum backends, accessed via AWS.
|
|
11
|
+
|
|
12
|
+
Attributes
|
|
13
|
+
----------
|
|
14
|
+
device: Literal["Ankaa3"], default="Ankaa3"
|
|
15
|
+
The specific Rigetti quantum device to use for computations. Currently only
|
|
16
|
+
"Ankaa-3" is available - Rigetti's latest superconducting quantum processor
|
|
17
|
+
featuring improved coherence times and gate fidelities.
|
|
18
|
+
aws_access_key: str | QpuToken | None
|
|
19
|
+
The AWS access key
|
|
20
|
+
aws_secret_access_key: str | QpuToken | None
|
|
21
|
+
The AWS secret access key
|
|
22
|
+
aws_session_token: str | QpuToken | None
|
|
23
|
+
The AWS session token
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
device: Literal["Ankaa3"] = "Ankaa3"
|
|
27
|
+
|
|
28
|
+
@computed_field
|
|
29
|
+
def device_provider(self) -> str:
|
|
30
|
+
"""Return the device provider identifier."""
|
|
31
|
+
return "Rigetti"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from luna_quantum.solve.interfaces.backend_i import IBackend
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class DWave(IBackend):
|
|
5
|
+
"""Configuration class for the DWave backend."""
|
|
6
|
+
|
|
7
|
+
@property
|
|
8
|
+
def provider(self) -> str:
|
|
9
|
+
"""
|
|
10
|
+
Retrieve the name of the provider.
|
|
11
|
+
|
|
12
|
+
Returns
|
|
13
|
+
-------
|
|
14
|
+
str
|
|
15
|
+
The name of the provider.
|
|
16
|
+
"""
|
|
17
|
+
return "dwave"
|