Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds options to control probability type and threshold of QuantumAlgorithm #449

Open
t-imamichi opened this issue Nov 30, 2022 · 0 comments
Labels
type: feature request New feature or request

Comments

@t-imamichi
Copy link
Collaborator

t-imamichi commented Nov 30, 2022

What should we add?

Follow-up #436 (comment) by @woodsp-ibm

If users apply Sampler to QuantumAlgorithm, the result QuasiDistribution is interpreted at the following method.
https://github.com/Qiskit/qiskit-optimization/blob/a752fd9e6af400a427a841952aac9555e454bc30/qiskit_optimization/algorithms/optimization_algorithm.py#L522-L525

QuasiDistribution can return both quasi-probabilities (can be negative values) and nearest probability. We need to think of 1) whether we provide an option to control quasi prob or nearest prob and 2) how to control it.

We also need to think of an option to control min_probability. We currently set 1e-6 and do not allow users control it. But, it might be necessary to control it especially for quasi-probabilities.

One idea is to add options to QuantumAlgorithm.__init__ as follows.

class ProbabilityType(Enum):
    QUASI = 0
    NEAREST = 1

class QuantumAlgorithm(ABC):
    def __init__(*, probability_type: ProbabilityType=ProbabilityType.QUASI, min_probability: float=1e-6):
        self._probability_type = probability_type
        self._min_probability = min_probability

I welcome your feedback and ideas.

@t-imamichi t-imamichi added the type: feature request New feature or request label Nov 30, 2022
@t-imamichi t-imamichi added this to the 0.5.0 milestone Nov 30, 2022
@woodsp-ibm woodsp-ibm removed this from the 0.5.0 milestone Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants