Skip to content

Allow for Sums of PauliStrings #1256

@sesmart

Description

@sesmart

This issue is part of unitaryHACK26. You have to be registered to complete this issue.
Learn more about the PR submission process here and about unitaryHACK rules here!

A note about AI Slop: while we are open to collaboration with LLMs for unitaryHACK, fully AI-generated PRs are not acceptable. It is at the maintainers' discretion whether or not LLM-generated PRs are the right fit for the issues, and those that appear fully AI-generated may be immediately rejected. Read unitaryHACK's full AI Policy here


Describe the feature you'd like

The PauliString class contains logic for creating and manipulating PauliStrings, though only exists in single instances. The proposed class is a container for PauliStrings, which allows for:

  1. Addition and subtraction of Pauli Strings, including with weights
  2. Multiplication by floats
  3. Multiplication by PauliStrings
  4. Single-item index-ability & inclusion checks
  5. Conversion to & from Sum & list of tuple[float, str]
  6. [extra] Inter and extra-class operations (i.e. commutes with another operator, self commuting, etc.)
    This may require changes to PauliString as well, depending on how coefficients are treated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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