Skip to content

Separate from_ising and to_ising out from QuadraticProgram#166

Merged
t-imamichi merged 12 commits intoqiskit-community:mainfrom
t-imamichi:ising
Jun 18, 2021
Merged

Separate from_ising and to_ising out from QuadraticProgram#166
t-imamichi merged 12 commits intoqiskit-community:mainfrom
t-imamichi:ising

Conversation

@t-imamichi
Copy link
Copy Markdown
Collaborator

@t-imamichi t-imamichi commented Jun 16, 2021

Summary

Separated from_ising and to_ising out from QuadraticProgram by adding them as translators.

Details and comments

Copy link
Copy Markdown
Contributor

@stefan-woerner stefan-woerner left a comment

Choose a reason for hiding this comment

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

lgtm, let's discuss the type hints in the call later today

@t-imamichi t-imamichi added the on hold Can not fix yet label Jun 16, 2021
# Conflicts:
#	qiskit_optimization/translators/docplex_mp.py
#	qiskit_optimization/translators/gurobipy.py
@t-imamichi t-imamichi removed the on hold Can not fix yet label Jun 16, 2021
@t-imamichi
Copy link
Copy Markdown
Collaborator Author

Thanks to #170, I simplified this PR to remove TYPE_CHECKING.

@t-imamichi t-imamichi added the Changelog: New feature Include in the Added section of the changelog label Jun 16, 2021
Comment thread qiskit_optimization/translators/ising.py Outdated
Comment thread qiskit_optimization/translators/ising.py Outdated
Comment thread qiskit_optimization/translators/ising.py Outdated
Comment thread qiskit_optimization/translators/ising.py Outdated
Comment thread qiskit_optimization/problems/quadratic_program.py
woodsp-ibm
woodsp-ibm previously approved these changes Jun 17, 2021
@t-imamichi
Copy link
Copy Markdown
Collaborator Author

t-imamichi commented Jun 17, 2021

I'm afraid I didn't notice @woodsp-ibm's approval. I notice that we need to raise an error in from_ising if any Pauli term has an imaginary coefficients. In the previous implementation, coefficients were just converted to real values. So, I added an error check and a unit test.

Comment thread qiskit_optimization/translators/ising.py Outdated
@t-imamichi t-imamichi requested a review from woodsp-ibm June 17, 2021 16:06
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.

3 participants