openjij.utils#
Submodules#
Functions#
|
|
|
Calculate redisual energy from measure energy |
|
|
|
Calculate redisual energy's standard error from measure energy |
|
Calculate success probability's standard error from openjij.response |
|
|
|
Calculate 'success probability', 'TTS', 'Residual energy','Standard Error' with computation time |
|
Calculate success probability from openjij.response |
|
|
Package Contents#
- openjij.utils.residual_energy(response, ref_energy)[source]#
Calculate redisual energy from measure energy
- Parameters:
response (
openjij.Response
) – response from solver (or sampler).ref_energy (
float
) – the reference energy (usually use the ground energy)
- Returns:
Residual energy which is defined as ( represents average, is the reference energy (usually use the ground energy)).
- Return type:
- openjij.utils.se_residual_energy(response, ref_energy)[source]#
Calculate redisual energy’s standard error from measure energy
- Parameters:
response (
openjij.Response
) – response from solver (or sampler).ref_energy (
float
) – the reference energy (usually use the ground energy)
- Returns:
redisual energy’s standard error from measure energy
- Return type:
- openjij.utils.se_success_probability(response, solutions, ref_energy=0, measure_with_energy=False)[source]#
Calculate success probability’s standard error from openjij.response
- Parameters:
response (
openjij.Response
) – response from solver (or sampler).solutions (
list[int]
) – true solutions.
- Returns:
Success probability’s standard error.
When measure_with_energy is False, success is defined as getting the same state as solutions.
When measure_with_energy is True, success is defined as getting a state which energy is below reference energy
- Return type:
- openjij.utils.se_upper_tts(tts, success_prob, computation_time, p_r, se_success_prob)[source]#
- Parameters:
- Returens:
float: time to solution ‘s standard error which pr is thereshold probability, ps is success probability and is computation time.
- openjij.utils.solver_benchmark(solver, time_list, solutions=[], args={}, p_r=0.99, ref_energy=0, measure_with_energy=False, time_name='execution_time')[source]#
Calculate ‘success probability’, ‘TTS’, ‘Residual energy’,’Standard Error’ with computation time
- Parameters:
solver (
callable
) – returns openjij.Response, and solver has arguments ‘time’ and ‘**args’time_list (
list
)solutions (
list(list(int)), list(int)
) – true solution or list of solution (if solutions are degenerated).args (
dict
) – Arguments for solver.p_r (
float
) – Thereshold probability for time to solutions.ref_energy (
float
) – The ground (reference to calculate success probability and the residual energy) energy.measure_with_energy (
bool
) – use a energy as measure for success
- Returns:
dictionary which has the following keys:
time: list of compuation time
success_prob list of success probability at each computation time
tts: list of time to solusion at each computation time
residual_energy: list of residual energy at each computation time
se_lower_tts: list of tts’s lower standard error at each computation time
se_upper_tts: list of tts’s upper standard error at each computation time
se_success_prob: list of success probability’s standard error at each computation time
se_residual_energy: list of residual_energy’s standard error at each computation time
info (dict): Parameter information for the benchmark
- Return type:
- openjij.utils.success_probability(response, solutions, ref_energy=0, measure_with_energy=False)[source]#
Calculate success probability from openjij.response
- Parameters:
response (
openjij.Response
) – response from solver (or sampler).solutions (
list[int]
) – true solutions.
- Returns:
Success probability.
When measure_with_energy is False, success is defined as getting the same state as solutions.
When measure_with_energy is True, success is defined as getting a state which energy is below reference energy
- Return type: