Skip to content

Special patterns of constraint to penalty converters#98

Closed
knamba-jp wants to merge 22 commits intoqiskit-community:mainfrom
knamba-jp:mentorship-24
Closed

Special patterns of constraint to penalty converters#98
knamba-jp wants to merge 22 commits intoqiskit-community:mainfrom
knamba-jp:mentorship-24

Conversation

@knamba-jp
Copy link
Copy Markdown
Contributor

@knamba-jp knamba-jp commented Apr 23, 2021

Summary

Resolves #40

TODO

  • Implementation of the converter
  • Intuitive converter name
  • Docstring
  • Unit test

Details and comments

Owned by Amano-san and me

A Tutorial on Formulating and Using QUBO Models introduces examples of the special patterns in page 10 as follows.
image

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 23, 2021

CLA assistant check
All committers have signed the CLA.

@t-imamichi
Copy link
Copy Markdown
Collaborator

We need a more intuitive name than SpecialConstraintToPenalty because there might be other types of inequality to equality converters in the future.

@mtreinish mtreinish changed the base branch from master to main April 23, 2021 15:38
@t-imamichi
Copy link
Copy Markdown
Collaborator

t-imamichi commented May 6, 2021

Could you apply black code formatter by black -l 100 qiskit_optimization.
We recently apply black to the entire code base. See #117 #118 for details.

@knamba-jp knamba-jp changed the title [WIP] Special patterns of inequality to equality converters [WIP] Special patterns of constraint to penalty converters May 14, 2021
@ibmamnt
Copy link
Copy Markdown
Contributor

ibmamnt commented May 14, 2021

We will run black command as suggested. As for the name of the class.
@t-imamichi How about this name ?

KnownConstraintConverter

@t-imamichi
Copy link
Copy Markdown
Collaborator

t-imamichi commented May 18, 2021

Thanks. The code format looks good. The naming is a bit difficult. What is the best name for this converter...? Maybe we can leave it later.

@t-imamichi
Copy link
Copy Markdown
Collaborator

LinearInequalityToPenalty may work.

FYI, you don't have to implement patterns x+y=1 and x=y because LinearEqualityToPenalty can handle them.

@t-imamichi t-imamichi self-requested a review May 18, 2021 02:54
@t-imamichi t-imamichi added the Changelog: New feature Include in the Added section of the changelog label May 18, 2021

logger = logging.getLogger(__name__)

QUBIT_OP_MAXIMIZE_SAMPLE = (
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed and concluded it should be done in another PR.

@knamba-jp knamba-jp changed the title [WIP] Special patterns of constraint to penalty converters Special patterns of constraint to penalty converters Jun 7, 2021
@knamba-jp knamba-jp marked this pull request as ready for review June 8, 2021 06:15
@knamba-jp
Copy link
Copy Markdown
Contributor Author

Since some errors can't be fixed, we'll open another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: New feature Include in the Added section of the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Special patterns of inequality to penalty converters

7 participants