Genetic Algorithms
- Quantum Assisted Genetic Algorithm Plus
- Quantum Assisted Genetic Algorithm Parallel
- Quantum Assisted Genetic Algorithm Pairwise
- Simulated Annealing Genetic Algorithm Plus
- Simulated Annealing Genetic Algorithm Parallel
- Simulated Annealing Genetic Algorithm Pairwise
Quantum Assisted Genetic Algorithm Plus
- Short Name:
QAGA+
- Algorithm Type:
Hybrid
- Category:
Hybrid-Internal
- Native Input Format:
QUBO
Usage via LunaSolve
# Example of using QAGA+ using the D-Wave backend in LunaSolve
solution = ls.solution.create(
optimization_id=optimization.id,
solver_name="QAGA+",
provider="dwave",
solver_parameters={
"p_size": 20,
"p_inc_num": 5,
"p_max": 160,
"pct_random_states": 0.25,
"mut_rate": 0.5,
"rec_rate": 1,
"rec_method": "random_crossover",
"select_method": "simple",
"target": None,
"atol": 0.0,
"rtol": 0.0,
"timeout": 60.0,
"max_iter": 100,
"use_qpu": True,
},
qpu_tokens=TokenProvider(
dwave=QpuToken(
source="inline",
name="<dwave token>",
),
),
)
Usage via LunaBench
# Example of adding QAGA+ using the D-Wave backend as an algorithm to LunaBench
algorithms = {
"QAGA+": {
"location": "cloud",
"provider": "dwave",
# Provide your token (see user guide on QPU tokens for more details)
"qpu_tokens": {
"dwave": {
"source": "inline",
"token": "<dwave token>",
},
},
},
}
Backends
This algorithm can be run on the following backends:
D-Wave
Parameters
- Name
p_size
- Type
- int
- Description
Size of the population.
Default:20
- Name
p_inc_num
- Type
- int
- Description
Number of individuals that are added to the population size after each iteration.
Default:5
- Name
p_max
- Type
- int | None
- Description
Maximum size of the population.
Default:160
- Name
pct_random_states
- Type
- float
- Description
Percentage of random states that are added to the population after each iteration.
Default:0.25
- Name
mut_rate
- Type
- float
- Description
Mutation rate, i.e., probability to mutate an individual. Min: 0.0, Max: 1.0
Default:0.5
- Name
rec_rate
- Type
- int
- Description
Recombination rate, i.e. number of mates each individual is recombined with after each iteration
Default:1
- Name
rec_method
- Type
- Literal["cluster_moves", "one_point_crossover", "random_crossover"]
- Description
The recombination method for the genetic algorithm.
Default:"random_crossover"
- Name
select_method
- Type
- Literal["simple", "shared_energy"]
- Description
Method used for the selection phase in the genetic algorithm.
Default:"simple"
- Name
target
- Type
- float | None
- Description
Energy level that the algorithm tries to reach. If
None
, the algorithm will run until any other stopping criterion is reached.
Default:None
- Name
atol
- Type
- float
- Description
Absolute tolerance used to compare the energies of the target and the individuals.
Default:0.0
- Name
rtol
- Type
- float
- Description
Relative tolerance used to compare the energies of the target and the individuals.
Default:0.0
- Name
timeout
- Type
- float
- Description
The total solving time after which the solver should be stopped. This total solving time includes preprocessing, network overhead when communicating with DWave's API, as well as the actual annealing time.
Default:60.0
- Name
max_iter
- Type
- int | None
- Description
Maximum number of iterations after which the algorithm will stop.
Default:100
- Name
use_qpu
- Type
- Literal["True"]
- Description
Whether to use the QPU for the optimization problem.
Default:True
Quantum Assisted Genetic Algorithm Parallel
- Short Name:
QAGA_PL
- Algorithm Type:
Hybrid
- Category:
Hybrid-Internal
- Native Input Format:
QUBO
Usage via LunaSolve
# Example of using QAGA_PL using the D-Wave backend in LunaSolve
solution = ls.solution.create(
optimization_id=optimization.id,
solver_name="QAGA_PL",
provider="dwave",
solver_parameters={
"p_size": 20,
"p_inc_num": 5,
"p_max": 160,
"pct_random_states": 0.25,
"mut_rate": 0.5,
"rec_rate": 1,
"rec_method": "random_crossover",
"select_method": "simple",
"target": None,
"atol": 0.0,
"rtol": 0.0,
"timeout": 60.0,
"max_iter": 100,
},
qpu_tokens=TokenProvider(
dwave=QpuToken(
source="inline",
name="<dwave token>",
),
),
)
Usage via LunaBench
# Example of adding QAGA_PL using the D-Wave backend as an algorithm to LunaBench
algorithms = {
"QAGA_PL": {
"location": "cloud",
"provider": "dwave",
# Provide your token (see user guide on QPU tokens for more details)
"qpu_tokens": {
"dwave": {
"source": "inline",
"token": "<dwave token>",
},
},
},
}
Backends
This algorithm can be run on the following backends:
D-Wave
Parameters
- Name
p_size
- Type
- int
- Description
Size of the population.
Default:20
- Name
p_inc_num
- Type
- int
- Description
Number of individuals that are added to the population size after each iteration.
Default:5
- Name
p_max
- Type
- int | None
- Description
Maximum size of the population.
Default:160
- Name
pct_random_states
- Type
- float
- Description
Percentage of random states that are added to the population after each iteration.
Default:0.25
- Name
mut_rate
- Type
- float
- Description
Mutation rate, i.e., probability to mutate an individual. Min: 0.0, Max: 1.0
Default:0.5
- Name
rec_rate
- Type
- int
- Description
Recombination rate, i.e. number of mates each individual is recombined with after each iteration
Default:1
- Name
rec_method
- Type
- Literal["cluster_moves", "one_point_crossover", "random_crossover"]
- Description
The recombination method for the genetic algorithm.
Default:"random_crossover"
- Name
select_method
- Type
- Literal["simple", "shared_energy"]
- Description
Method used for the selection phase in the genetic algorithm.
Default:"simple"
- Name
target
- Type
- float | None
- Description
Energy level that the algorithm tries to reach. If
None
, the algorithm will run until any other stopping criterion is reached.
Default:None
- Name
atol
- Type
- float
- Description
Absolute tolerance used to compare the energies of the target and the individuals.
Default:0.0
- Name
rtol
- Type
- float
- Description
Relative tolerance used to compare the energies of the target and the individuals.
Default:0.0
- Name
timeout
- Type
- float
- Description
The total solving time after which the solver should be stopped. This total solving time includes preprocessing, network overhead when communicating with DWave's API, as well as the actual annealing time.
Default:60.0
- Name
max_iter
- Type
- int | None
- Description
Maximum number of iterations after which the algorithm will stop.
Default:100
Quantum Assisted Genetic Algorithm Pairwise
- Short Name:
QAGA_PW
- Algorithm Type:
Hybrid
- Category:
Hybrid-Internal
- Native Input Format:
QUBO
Usage via LunaSolve
# Example of using QAGA_PW using the D-Wave backend in LunaSolve
solution = ls.solution.create(
optimization_id=optimization.id,
solver_name="QAGA_PW",
provider="dwave",
solver_parameters={
"p_size": 20,
"p_inc_num": 5,
"p_max": 160,
"pct_random_states": 0.25,
"mut_rate": 0.5,
"rec_rate": 1,
"rec_method": "random_crossover",
"select_method": "simple",
"target": None,
"atol": 0.0,
"rtol": 0.0,
"timeout": 60.0,
"max_iter": 100,
},
qpu_tokens=TokenProvider(
dwave=QpuToken(
source="inline",
name="<dwave token>",
),
),
)
Usage via LunaBench
# Example of adding QAGA_PW using the D-Wave backend as an algorithm to LunaBench
algorithms = {
"QAGA_PW": {
"location": "cloud",
"provider": "dwave",
# Provide your token (see user guide on QPU tokens for more details)
"qpu_tokens": {
"dwave": {
"source": "inline",
"token": "<dwave token>",
},
},
},
}
Backends
This algorithm can be run on the following backends:
D-Wave
Parameters
- Name
p_size
- Type
- int
- Description
Size of the population.
Default:20
- Name
p_inc_num
- Type
- int
- Description
Number of individuals that are added to the population size after each iteration.
Default:5
- Name
p_max
- Type
- int | None
- Description
Maximum size of the population.
Default:160
- Name
pct_random_states
- Type
- float
- Description
Percentage of random states that are added to the population after each iteration.
Default:0.25
- Name
mut_rate
- Type
- float
- Description
Mutation rate, i.e., probability to mutate an individual. Min: 0.0, Max: 1.0
Default:0.5
- Name
rec_rate
- Type
- int
- Description
Recombination rate, i.e. number of mates each individual is recombined with after each iteration
Default:1
- Name
rec_method
- Type
- Literal["cluster_moves", "one_point_crossover", "random_crossover"]
- Description
The recombination method for the genetic algorithm.
Default:"random_crossover"
- Name
select_method
- Type
- Literal["simple", "shared_energy"]
- Description
Method used for the selection phase in the genetic algorithm.
Default:"simple"
- Name
target
- Type
- float | None
- Description
Energy level that the algorithm tries to reach. If
None
, the algorithm will run until any other stopping criterion is reached.
Default:None
- Name
atol
- Type
- float
- Description
Absolute tolerance used to compare the energies of the target and the individuals.
Default:0.0
- Name
rtol
- Type
- float
- Description
Relative tolerance used to compare the energies of the target and the individuals.
Default:0.0
- Name
timeout
- Type
- float
- Description
The total solving time after which the solver should be stopped. This total solving time includes preprocessing, network overhead when communicating with DWave's API, as well as the actual annealing time.
Default:60.0
- Name
max_iter
- Type
- int | None
- Description
Maximum number of iterations after which the algorithm will stop.
Default:100
Simulated Annealing Genetic Algorithm Plus
- Short Name:
SAGA+
- Algorithm Type:
Classical
- Category:
Classical
- Native Input Format:
QUBO
Usage via LunaSolve
# Example of using SAGA+ using the Luna backend in LunaSolve
solution = ls.solution.create(
optimization_id=optimization.id,
solver_name="SAGA+",
provider="dwave",
solver_parameters={
"p_size": 20,
"p_inc_num": 5,
"p_max": 160,
"pct_random_states": 0.25,
"mut_rate": 0.5,
"rec_rate": 1,
"rec_method": "random_crossover",
"select_method": "simple",
"target": None,
"atol": 0.0,
"rtol": 0.0,
"timeout": 60.0,
"max_iter": 100,
"num_sweeps": 10,
"num_sweeps_inc_factor": 1.2,
"num_sweeps_inc_max": 7000,
"beta_range_type": "default",
"beta_range": None,
},
qpu_tokens=None,
)
Usage via LunaBench
# Example of adding SAGA+ using the Luna backend as an algorithm to LunaBench
algorithms = {
"SAGA+": {
"location": "cloud",
"provider": "dwave",
},
}
Backends
This algorithm can be run on the following backends:
Luna
Parameters
- Name
p_size
- Type
- int
- Description
Size of the population.
Default:20
- Name
p_inc_num
- Type
- int
- Description
Number of individuals that are added to the population size after each iteration.
Default:5
- Name
p_max
- Type
- int | None
- Description
Maximum size of the population.
Default:160
- Name
pct_random_states
- Type
- float
- Description
Percentage of random states that are added to the population after each iteration.
Default:0.25
- Name
mut_rate
- Type
- float
- Description
Mutation rate, i.e., probability to mutate an individual. Min: 0.0, Max: 1.0
Default:0.5
- Name
rec_rate
- Type
- int
- Description
Recombination rate, i.e. number of mates each individual is recombined with after each iteration
Default:1
- Name
rec_method
- Type
- Literal["cluster_moves", "one_point_crossover", "random_crossover"]
- Description
The recombination method for the genetic algorithm.
Default:"random_crossover"
- Name
select_method
- Type
- Literal["simple", "shared_energy"]
- Description
Method used for the selection phase in the genetic algorithm.
Default:"simple"
- Name
target
- Type
- float | None
- Description
Energy level that the algorithm tries to reach. If
None
, the algorithm will run until any other stopping criterion is reached.
Default:None
- Name
atol
- Type
- float
- Description
Absolute tolerance used to compare the energies of the target and the individuals.
Default:0.0
- Name
rtol
- Type
- float
- Description
Relative tolerance used to compare the energies of the target and the individuals.
Default:0.0
- Name
timeout
- Type
- float
- Description
The total solving time after which the solver should be stopped. This total solving time includes preprocessing, network overhead when communicating with DWave's API, as well as the actual annealing time.
Default:60.0
- Name
max_iter
- Type
- int | None
- Description
Maximum number of iterations after which the algorithm will stop.
Default:100
- Name
num_sweeps
- Type
- int
- Description
The number of sweeps for simulated annealing.
Default:10
- Name
num_sweeps_inc_factor
- Type
- float
- Description
factor of increasement for
num_sweeps
after each iteration
Default:1.2
- Name
num_sweeps_inc_max
- Type
- int | None
- Description
Maximum number of num_sweeps that may be reached when increasing the
num_sweeps
value.
Default:7000
- Name
beta_range_type
- Type
- Literal["default", "percent", "fixed", "inc"]
- Description
Method that is used to compute the beta range. default': the same as percent with values [50, 1] 'percent': the percentage chance of flipping qubits from hot to cold temperature 'fixed': a fixed temperature as a value 'inc': the default or percentage beta range but with decreasing percentages from iteration to iteration
Default:"default"
- Name
beta_range
- Type
- tuple[float, float] | None
- Description
Explicit beta range that is used for beta_range_type 'fixed' and 'percent'.
Default:None
Simulated Annealing Genetic Algorithm Parallel
- Short Name:
SAGA_PL
- Algorithm Type:
Classical
- Category:
Classical
- Native Input Format:
QUBO
Usage via LunaSolve
# Example of using SAGA_PL using the Luna backend in LunaSolve
solution = ls.solution.create(
optimization_id=optimization.id,
solver_name="SAGA_PL",
provider="dwave",
solver_parameters={
"p_size": 20,
"p_inc_num": 5,
"p_max": 160,
"pct_random_states": 0.25,
"mut_rate": 0.5,
"rec_rate": 1,
"rec_method": "random_crossover",
"select_method": "simple",
"target": None,
"atol": 0.0,
"rtol": 0.0,
"timeout": 60.0,
"max_iter": 100,
"num_sweeps": 10,
"num_sweeps_inc_factor": 1.2,
"num_sweeps_inc_max": 7000,
"beta_range_type": "default",
"beta_range": None,
},
qpu_tokens=None,
)
Usage via LunaBench
# Example of adding SAGA_PL using the Luna backend as an algorithm to LunaBench
algorithms = {
"SAGA_PL": {
"location": "cloud",
"provider": "dwave",
},
}
Backends
This algorithm can be run on the following backends:
Luna
Parameters
- Name
p_size
- Type
- int
- Description
Size of the population.
Default:20
- Name
p_inc_num
- Type
- int
- Description
Number of individuals that are added to the population size after each iteration.
Default:5
- Name
p_max
- Type
- int | None
- Description
Maximum size of the population.
Default:160
- Name
pct_random_states
- Type
- float
- Description
Percentage of random states that are added to the population after each iteration.
Default:0.25
- Name
mut_rate
- Type
- float
- Description
Mutation rate, i.e., probability to mutate an individual. Min: 0.0, Max: 1.0
Default:0.5
- Name
rec_rate
- Type
- int
- Description
Recombination rate, i.e. number of mates each individual is recombined with after each iteration
Default:1
- Name
rec_method
- Type
- Literal["cluster_moves", "one_point_crossover", "random_crossover"]
- Description
The recombination method for the genetic algorithm.
Default:"random_crossover"
- Name
select_method
- Type
- Literal["simple", "shared_energy"]
- Description
Method used for the selection phase in the genetic algorithm.
Default:"simple"
- Name
target
- Type
- float | None
- Description
Energy level that the algorithm tries to reach. If
None
, the algorithm will run until any other stopping criterion is reached.
Default:None
- Name
atol
- Type
- float
- Description
Absolute tolerance used to compare the energies of the target and the individuals.
Default:0.0
- Name
rtol
- Type
- float
- Description
Relative tolerance used to compare the energies of the target and the individuals.
Default:0.0
- Name
timeout
- Type
- float
- Description
The total solving time after which the solver should be stopped. This total solving time includes preprocessing, network overhead when communicating with DWave's API, as well as the actual annealing time.
Default:60.0
- Name
max_iter
- Type
- int | None
- Description
Maximum number of iterations after which the algorithm will stop.
Default:100
- Name
num_sweeps
- Type
- int
- Description
The number of sweeps for simulated annealing.
Default:10
- Name
num_sweeps_inc_factor
- Type
- float
- Description
factor of increasement for
num_sweeps
after each iteration
Default:1.2
- Name
num_sweeps_inc_max
- Type
- int | None
- Description
Maximum number of num_sweeps that may be reached when increasing the
num_sweeps
value.
Default:7000
- Name
beta_range_type
- Type
- Literal["default", "percent", "fixed", "inc"]
- Description
Method that is used to compute the beta range. default': the same as percent with values [50, 1] 'percent': the percentage chance of flipping qubits from hot to cold temperature 'fixed': a fixed temperature as a value 'inc': the default or percentage beta range but with decreasing percentages from iteration to iteration
Default:"default"
- Name
beta_range
- Type
- tuple[float, float] | None
- Description
Explicit beta range that is used for beta_range_type 'fixed' and 'percent'.
Default:None
Simulated Annealing Genetic Algorithm Pairwise
- Short Name:
SAGA_PW
- Algorithm Type:
Classical
- Category:
Classical
- Native Input Format:
QUBO
Usage via LunaSolve
# Example of using SAGA_PW using the Luna backend in LunaSolve
solution = ls.solution.create(
optimization_id=optimization.id,
solver_name="SAGA_PW",
provider="dwave",
solver_parameters={
"p_size": 20,
"p_inc_num": 5,
"p_max": 160,
"pct_random_states": 0.25,
"mut_rate": 0.5,
"rec_rate": 1,
"rec_method": "random_crossover",
"select_method": "simple",
"target": None,
"atol": 0.0,
"rtol": 0.0,
"timeout": 60.0,
"max_iter": 100,
"num_sweeps": 10,
"num_sweeps_inc_factor": 1.2,
"num_sweeps_inc_max": 7000,
"beta_range_type": "default",
"beta_range": None,
},
qpu_tokens=None,
)
Usage via LunaBench
# Example of adding SAGA_PW using the Luna backend as an algorithm to LunaBench
algorithms = {
"SAGA_PW": {
"location": "cloud",
"provider": "dwave",
},
}
Backends
This algorithm can be run on the following backends:
Luna
Parameters
- Name
p_size
- Type
- int
- Description
Size of the population.
Default:20
- Name
p_inc_num
- Type
- int
- Description
Number of individuals that are added to the population size after each iteration.
Default:5
- Name
p_max
- Type
- int | None
- Description
Maximum size of the population.
Default:160
- Name
pct_random_states
- Type
- float
- Description
Percentage of random states that are added to the population after each iteration.
Default:0.25
- Name
mut_rate
- Type
- float
- Description
Mutation rate, i.e., probability to mutate an individual. Min: 0.0, Max: 1.0
Default:0.5
- Name
rec_rate
- Type
- int
- Description
Recombination rate, i.e. number of mates each individual is recombined with after each iteration
Default:1
- Name
rec_method
- Type
- Literal["cluster_moves", "one_point_crossover", "random_crossover"]
- Description
The recombination method for the genetic algorithm.
Default:"random_crossover"
- Name
select_method
- Type
- Literal["simple", "shared_energy"]
- Description
Method used for the selection phase in the genetic algorithm.
Default:"simple"
- Name
target
- Type
- float | None
- Description
Energy level that the algorithm tries to reach. If
None
, the algorithm will run until any other stopping criterion is reached.
Default:None
- Name
atol
- Type
- float
- Description
Absolute tolerance used to compare the energies of the target and the individuals.
Default:0.0
- Name
rtol
- Type
- float
- Description
Relative tolerance used to compare the energies of the target and the individuals.
Default:0.0
- Name
timeout
- Type
- float
- Description
The total solving time after which the solver should be stopped. This total solving time includes preprocessing, network overhead when communicating with DWave's API, as well as the actual annealing time.
Default:60.0
- Name
max_iter
- Type
- int | None
- Description
Maximum number of iterations after which the algorithm will stop.
Default:100
- Name
num_sweeps
- Type
- int
- Description
The number of sweeps for simulated annealing.
Default:10
- Name
num_sweeps_inc_factor
- Type
- float
- Description
factor of increasement for
num_sweeps
after each iteration
Default:1.2
- Name
num_sweeps_inc_max
- Type
- int | None
- Description
Maximum number of num_sweeps that may be reached when increasing the
num_sweeps
value.
Default:7000
- Name
beta_range_type
- Type
- Literal["default", "percent", "fixed", "inc"]
- Description
Method that is used to compute the beta range. default': the same as percent with values [50, 1] 'percent': the percentage chance of flipping qubits from hot to cold temperature 'fixed': a fixed temperature as a value 'inc': the default or percentage beta range but with decreasing percentages from iteration to iteration
Default:"default"
- Name
beta_range
- Type
- tuple[float, float] | None
- Description
Explicit beta range that is used for beta_range_type 'fixed' and 'percent'.
Default:None