Skip to content

Quantum Annealing

Quantum Annealing

Quantum Annealing uses D-Wave's purpose build Quantum Processing Units (QPU) to solve QUBO optimization problems with the help of the adiabatic theorem of quantum mechanics. This implementation first applies D-Wave's minor embedding to map the provided problem onto the hardware graph of the desired sampler.

Compatible Backends

Backend Default
DWaveQpu

Initialization

Python
from luna_quantum.solve.parameters.algorithms.quantum_annealing.quantum_annealing import QuantumAnnealing

algorithm = QuantumAnnealing(
    backend=None,
    anneal_offsets=None,
    anneal_schedule=None,
    annealing_time=None,
    auto_scale=None,
    fast_anneal=False,
    flux_biases=None,
    flux_drift_compensation=True,
    h_gain_schedule=None,
    initial_state=None,
    max_answers=None,
    num_reads=1,
    programming_thermalization=None,
    readout_thermalization=None,
    reduce_intersample_correlation=False,
    reinitialize_state=None
)

Usage

Python
from luna_quantum.algorithms import QuantumAnnealing

algorithm = QuantumAnnealing()
solve_job = algorithm.run(model, name="my-solve-job")

Population Annealing QPU

Population Annealing uses a sequential Monte Carlo method to minimize the energy of a population. The population consists of walkers that can explore their neighborhood during the cooling process. Afterwards, walkers are removed and duplicated using bias to lower energy. Eventually, a population collapse occurs where all walkers are in the lowest energy state.

Note

This solver is only available for commercial and academic licenses.

Compatible Backends

Backend Default
DWaveQpu

Initialization

Python
from luna_quantum.solve.parameters.algorithms.base_params.decomposer import Decomposer
from luna_quantum.solve.parameters.algorithms.base_params.quantum_annealing_params import QuantumAnnealingParams
from luna_quantum.solve.parameters.algorithms.quantum_annealing.population_annealing_qpu import PopulationAnnealingQpu

algorithm = PopulationAnnealingQpu(
    backend=None,
    num_reads=100,
    num_retries=0,
    max_iter=20,
    max_time=2,
    fixed_temp_sampler_num_sweeps=10000,
    fixed_temp_sampler_num_reads=None,
    decomposer=Decomposer(
        size=10,
        min_gain=None,
        rolling=True,
        rolling_history=1.0,
        silent_rewind=True,
        traversal='energy'
    ),
    quantum_annealing_params=QuantumAnnealingParams(
        anneal_offsets=None,
        anneal_schedule=None,
        annealing_time=None,
        auto_scale=None,
        fast_anneal=False,
        flux_biases=None,
        flux_drift_compensation=True,
        h_gain_schedule=None,
        initial_state=None,
        max_answers=None,
        num_reads=1,
        programming_thermalization=None,
        readout_thermalization=None,
        reduce_intersample_correlation=False,
        reinitialize_state=None
    )
)

Usage

Python
from luna_quantum.algorithms import PopulationAnnealingQpu

algorithm = PopulationAnnealingQpu()
solve_job = algorithm.run(model, name="my-solve-job")

Repeated Reverse Quantum Annealing

Repeated Reverse Quantum Annealing begins the annealing process from a previously initialized state and increases the temperature from there. Afterwards, the temperature is decreased again until the solution is found. This procedure is repeated several times with this particular solver.

Note

This solver is only available for commercial and academic licenses.

Compatible Backends

Backend Default
DWaveQpu

Initialization

Python
from luna_quantum.solve.parameters.algorithms.quantum_annealing.repeated_reverse_quantum_annealing import RepeatedReverseQuantumAnnealing

algorithm = RepeatedReverseQuantumAnnealing(
    backend=None,
    anneal_offsets=None,
    annealing_time=None,
    auto_scale=None,
    flux_biases=None,
    flux_drift_compensation=True,
    h_gain_schedule=None,
    max_answers=None,
    programming_thermalization=None,
    readout_thermalization=None,
    reduce_intersample_correlation=False,
    initial_states=None,
    n_initial_states=1,
    samples_per_state=1,
    beta_schedule=[0.5, 3],
    timeout=300,
    max_iter=10,
    target=None,
    check_trivial=True
)

Usage

Python
from luna_quantum.algorithms import RepeatedReverseQuantumAnnealing

algorithm = RepeatedReverseQuantumAnnealing()
solve_job = algorithm.run(model, name="my-solve-job")

QBSolv-like QPU

The QBSolv-like QPU is a specialized solver designed to tackle complex problems by decomposing them into smaller, manageable subproblems. It then solves these individual parts using a Quantum Processing Unit (QPU).

This particular implementation achieves its QBSolv-like behavior by utilizing the hybrid.QPUSubproblemAutoEmbeddingSampler from the D-Wave Ocean SDK as the core sampler for these subproblems. This approach allows for efficient handling of large-scale problems by breaking them down and leveraging the strengths of quantum computation for the subcomponents.

Note

This solver is only available for commercial and academic licenses.

Compatible Backends

Backend Default
DWaveQpu

Initialization

Python
from luna_quantum.solve.parameters.algorithms.base_params.decomposer import Decomposer
from luna_quantum.solve.parameters.algorithms.base_params.quantum_annealing_params import QuantumAnnealingParams
from luna_quantum.solve.parameters.algorithms.quantum_annealing.qbsolv_like_qpu import QBSolvLikeQpu

algorithm = QBSolvLikeQpu(
    backend=None,
    decomposer_size=50,
    rolling=True,
    rolling_history=0.15,
    max_iter=100,
    max_time=5,
    convergence=3,
    target=None,
    rtol=1e-05,
    atol=1e-08,
    num_reads=100,
    num_retries=0,
    quantum_annealing_params=QuantumAnnealingParams(
        anneal_offsets=None,
        anneal_schedule=None,
        annealing_time=None,
        auto_scale=None,
        fast_anneal=False,
        flux_biases=None,
        flux_drift_compensation=True,
        h_gain_schedule=None,
        initial_state=None,
        max_answers=None,
        num_reads=1,
        programming_thermalization=None,
        readout_thermalization=None,
        reduce_intersample_correlation=False,
        reinitialize_state=None
    ),
    decomposer=Decomposer(
        size=10,
        min_gain=None,
        rolling=True,
        rolling_history=1.0,
        silent_rewind=True,
        traversal='energy'
    )
)

Usage

Python
from luna_quantum.algorithms import QBSolvLikeQpu

algorithm = QBSolvLikeQpu()
solve_job = algorithm.run(model, name="my-solve-job")

Parallel Tempering QPU

Parallel Tempering uses multiple optimization procedures per temperature. During the cooling process, an exchange of replicas can take place between the parallel procedures, thus enabling higher energy mountains to be overcome.

Note

This solver is only available for commercial and academic licenses.

Compatible Backends

Backend Default
DWaveQpu

Initialization

Python
from luna_quantum.solve.parameters.algorithms.base_params.decomposer import Decomposer
from luna_quantum.solve.parameters.algorithms.base_params.quantum_annealing_params import QuantumAnnealingParams
from luna_quantum.solve.parameters.algorithms.quantum_annealing.parallel_tempering_qpu import ParallelTemperingQpu

algorithm = ParallelTemperingQpu(
    backend=None,
    n_replicas=2,
    random_swaps_factor=1,
    max_iter=100,
    max_time=5,
    convergence=3,
    target=None,
    rtol=1e-05,
    atol=1e-08,
    num_reads=100,
    num_retries=0,
    fixed_temp_sampler_num_sweeps=10000,
    fixed_temp_sampler_num_reads=None,
    quantum_annealing_params=QuantumAnnealingParams(
        anneal_offsets=None,
        anneal_schedule=None,
        annealing_time=None,
        auto_scale=None,
        fast_anneal=False,
        flux_biases=None,
        flux_drift_compensation=True,
        h_gain_schedule=None,
        initial_state=None,
        max_answers=None,
        num_reads=1,
        programming_thermalization=None,
        readout_thermalization=None,
        reduce_intersample_correlation=False,
        reinitialize_state=None
    ),
    decomposer=Decomposer(
        size=10,
        min_gain=None,
        rolling=True,
        rolling_history=1.0,
        silent_rewind=True,
        traversal='energy'
    )
)

Usage

Python
from luna_quantum.algorithms import ParallelTemperingQpu

algorithm = ParallelTemperingQpu()
solve_job = algorithm.run(model, name="my-solve-job")

Leap Hybrid CQM

Leap's quantum-classical hybrid solvers are intended to solve arbitrary application problems formulated as quadratic models. This solver accepts arbitrarily structured problems formulated as CQMs, with any constraints represented natively.

Compatible Backends

Backend Default
DWaveQpu

Initialization

Python
from luna_quantum.solve.parameters.algorithms.quantum_annealing.leap_hybrid_cqm import LeapHybridCqm

algorithm = LeapHybridCqm(
    backend=None,
    time_limit=None,
    spin_variables=None
)

Usage

Python
from luna_quantum.algorithms import LeapHybridCqm

algorithm = LeapHybridCqm()
solve_job = algorithm.run(model, name="my-solve-job")

Leap Hybrid BQM

Leap's quantum-classical hybrid solvers are intended to solve arbitrary application problems formulated as quadratic models. This solver accepts arbitrarily structured, unconstrained problems formulated as BQMs, with any constraints typically represented through penalty models.

Compatible Backends

Backend Default
DWaveQpu

Initialization

Python
from luna_quantum.solve.parameters.algorithms.quantum_annealing.leap_hybrid_bqm import LeapHybridBqm

algorithm = LeapHybridBqm(
    backend=None,
    time_limit=None
)

Usage

Python
from luna_quantum.algorithms import LeapHybridBqm

algorithm = LeapHybridBqm()
solve_job = algorithm.run(model, name="my-solve-job")

Kerberos

Kerberos divides the problem into subproblems and solves them using Tabu Search, Simulated Annealing and QPU Subproblem Sampling. These algorithms are executed in parallel and afterwards the best solutions are combined. This procedure is applied iteratively until the best solution is found or a termination criterion is met.

Compatible Backends

Backend Default
DWaveQpu

Initialization

Python
from luna_quantum.solve.parameters.algorithms.base_params.decomposer import Decomposer
from luna_quantum.solve.parameters.algorithms.base_params.quantum_annealing_params import QuantumAnnealingParams
from luna_quantum.solve.parameters.algorithms.base_params.simulated_annealing_params import SimulatedAnnealingBaseParams
from luna_quantum.solve.parameters.algorithms.base_params.tabu_kerberos_params import TabuKerberosParams
from luna_quantum.solve.parameters.algorithms.quantum_annealing.kerberos import Kerberos

algorithm = Kerberos(
    backend=None,
    num_reads=100,
    num_retries=0,
    max_iter=100,
    max_time=5,
    convergence=3,
    target=None,
    rtol=1e-05,
    atol=1e-08,
    simulated_annealing_params=SimulatedAnnealingBaseParams(
        num_reads=None,
        num_sweeps=1000,
        beta_range=None,
        beta_schedule_type='geometric',
        initial_states_generator='random'
    ),
    quantum_annealing_params=QuantumAnnealingParams(
        anneal_offsets=None,
        anneal_schedule=None,
        annealing_time=None,
        auto_scale=None,
        fast_anneal=False,
        flux_biases=None,
        flux_drift_compensation=True,
        h_gain_schedule=None,
        initial_state=None,
        max_answers=None,
        num_reads=1,
        programming_thermalization=None,
        readout_thermalization=None,
        reduce_intersample_correlation=False,
        reinitialize_state=None
    ),
    tabu_kerberos_params=TabuKerberosParams(
        num_reads=None,
        tenure=None,
        timeout=100,
        initial_states_generator='random',
        max_time=None
    ),
    decomposer=Decomposer(
        size=10,
        min_gain=None,
        rolling=True,
        rolling_history=1.0,
        silent_rewind=True,
        traversal='energy'
    )
)

Usage

Python
from luna_quantum.algorithms import Kerberos

algorithm = Kerberos()
solve_job = algorithm.run(model, name="my-solve-job")