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

PauliTerms can only be constructed on one qubit #977

Closed
karalekas opened this issue Aug 25, 2019 · 1 comment · Fixed by #984
Closed

PauliTerms can only be constructed on one qubit #977

karalekas opened this issue Aug 25, 2019 · 1 comment · Fixed by #984
Labels
discussion 🤔 For design discussions. enhancement ✨ A request for a new feature.
Milestone

Comments

@karalekas
Copy link
Contributor

karalekas commented Aug 25, 2019

In PR #867, @jlbosse noted that although PauliTerm objects can only be constructed with a single op (on a single qubit), they can be multiplied together to produce a multi-qubit PauliTerm. This has come up before (a while ago) in #120. In that issue and in the previously mentioned PR, the solution was to create a new class method to allow for this functionality, but we might want to consider changing the constructor itself. This issue is for discussing that idea.

@jlbosse
Copy link
Contributor

jlbosse commented Aug 27, 2019

Somewhat related: The PauliTerm.from_compact_str() method also supports only one qubit operators and PauliSum.from_compact_str() is missing altogether. In PR #867 I had some code remedying this. If you want me to, I can create another PR with just that code. It would be the exact complement to PauliTerm.__str__() or PauliSum.__str__() respectively, but not work with Qubit Placeholders.

About the constructor: How about making something akin to PauliTerm.from_list() the default constructor? Or (not very pythonic) make the constructor choose between its current implementation and PauliTerm.from_list() depending on the argument types?

@karalekas karalekas added the enhancement ✨ A request for a new feature. label Sep 20, 2019
@karalekas karalekas added this to the v2.12 milestone Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion 🤔 For design discussions. enhancement ✨ A request for a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants