SemideterministicRounding#

class SemideterministicRounding(*, atol=1e-08, seed=None)[source]#

Bases: RoundingScheme

Semi-deterministic rounding scheme

This is referred to as “Pauli rounding” in https://arxiv.org/abs/2111.03167.

Parameters:
  • seed (int | None) – Seed for random number generator, which is used to resolve expectation values near zero to either +1 or -1.

  • atol (float) – Absolute tolerance for determining whether an expectation value is zero.

Methods

round(rounding_context)[source]#

Perform semi-deterministic rounding

Parameters:

rounding_context (RoundingContext) – Rounding context containing information about the problem and solution.

Returns:

Result containing the rounded solution.

Raises:

QiskitOptimizationError – If the expectation values are not available in the context.

Return type:

RoundingResult