QuantumRandomAccessOptimizer#

class QuantumRandomAccessOptimizer(min_eigen_solver, max_vars_per_qubit=3, rounding_scheme=None, *, penalty=None)[ソース]#

ベースクラス: OptimizationAlgorithm

Quantum Random Access Optimizer class.

パラメータ:
  • min_eigen_solver (MinimumEigensolver) – The minimum eigensolver to use for solving the relaxed problem.

  • max_vars_per_qubit (int) – The maximum number of decision variables per qubit. Integer values 1, 2 and 3 are supported (default to 3).

  • rounding_scheme (RoundingScheme | None) – The rounding scheme. If None is provided, SemideterministicRounding will be used.

  • penalty (float | None) – The penalty factor to use for the QuadraticProgramToQubo converter.

例外:
  • ValueError – If the maximum number of variables per qubit is not 1, 2, or 3.

  • TypeError – If the provided minimum eigensolver does not support auxiliary operators.

Attributes

max_vars_per_qubit#

Return the maximum number of variables per qubit.

min_eigen_solver#

Return the minimum eigensolver.

rounding_scheme#

Return the rounding scheme.

Methods

get_compatibility_msg(problem)[ソース]#

Checks whether a given problem can be solved with this optimizer.

Checks whether the given problem is compatible, i.e., whether the problem can be converted to a QUBO, and otherwise, returns a message explaining the incompatibility.

パラメータ:

problem (QuadraticProgram) – The optimization problem to check compatibility.

戻り値:

A message describing the incompatibility.

戻り値の型:

str

is_compatible(problem)#

Checks whether a given problem can be solved with the optimizer implementing this method.

パラメータ:

problem (QuadraticProgram) – The optimization problem to check compatibility.

戻り値:

Returns True if the problem is compatible, False otherwise.

戻り値の型:

bool

process_result(problem, encoding, relaxed_result, rounding_result)[ソース]#

Process the relaxed result of the minimum eigensolver and rounding scheme.

パラメータ:
戻り値:

The result of the quantum random access optimization.

戻り値の型:

QuantumRandomAccessOptimizationResult

solve(problem)[ソース]#

Solve the relaxed Hamiltonian given by the encoding and round the solution by the given rounding scheme.

パラメータ:

problem (QuadraticProgram) – The QuadraticProgram to be solved.

戻り値:

The result of the quantum random access optimization.

例外:

ValueError – If the encoding has not been encoded with a QuadraticProgram.

戻り値の型:

QuantumRandomAccessOptimizationResult

solve_relaxed(encoding)[ソース]#

Solve the relaxed Hamiltonian given by the encoding.

注釈

This method uses the encoding instance given as encoding and ignores max_vars_per_qubit().

パラメータ:

encoding (QuantumRandomAccessEncoding) – An encoding instance for which encode() has already been called so it has been encoded with a QuadraticProgram.

戻り値:

The result of the minimum eigensolver, and the rounding context.

例外:

ValueError – If the encoding has not been encoded with a QuadraticProgram.

戻り値の型:

tuple[qiskit_algorithms.minimum_eigensolvers.minimum_eigensolver.MinimumEigensolverResult, qiskit_optimization.algorithms.qrao.rounding_common.RoundingContext]