Skip to content

PauliSum.to_list() remove signed Pauli expression #1309

Description

@sesmart

Describe the bug

Creating a PauliSum preserves the sign in the coefficient as well as in the PauliString. For conversion to a list format, we should remove the sign, as the CircuitBinding list format expects a simple string, i.e. "X", not "+X". Maybe add a flag?

To reproduce

test= PauliSum([(0.5, "XX"), (0.3, "YY")])
test.to_list()
# returns 
# [(0.5, "+XX"), (0.3, "+YY")]

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots or logs
If applicable, add screenshots or logs to help explain your problem.

System information
A description of your system. Please provide:

  • Amazon Braket Python SDK version:
  • Amazon Braket Python Schemas version:
  • Amazon Braket Python Default Simulator version:
  • Python version:

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions