Skip to content

Add allow_non_hermitian parameter to BitArray.expectation_values (depends on #16443 partially fixes #11933)#16488

Open
Yosef-Bunick wants to merge 6 commits into
Qiskit:mainfrom
Yosef-Bunick:allow-non-hermitian-expectation-values
Open

Add allow_non_hermitian parameter to BitArray.expectation_values (depends on #16443 partially fixes #11933)#16488
Yosef-Bunick wants to merge 6 commits into
Qiskit:mainfrom
Yosef-Bunick:allow-non-hermitian-expectation-values

Conversation

@Yosef-Bunick

@Yosef-Bunick Yosef-Bunick commented Jun 26, 2026

Copy link
Copy Markdown

Allow complex expectation values in BitArray.expectation_values
without a manual loop. Two flags unlock the path:
~ObservablesArray(obs, validate=False) > bypass Hermiticity gate
~expectation_values(obs, allow_non_hermitian=True) > complex return path

follow up to fix #16443
related to fix #11933 and fix #11393

AI/LLM disclosure

  • I used the following tool to help write this PR description: ABE_v4 personal ai engine, All code reviewed, tested, and verified manually, with black formatting, 2 new tests, one for complex128 and one for float64

@Yosef-Bunick Yosef-Bunick requested review from a team as code owners June 26, 2026 04:28
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Jun 26, 2026
@qiskit-bot

Copy link
Copy Markdown
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core
  • @ajavadia
  • @levbishop
  • @t-imamichi

@Yosef-Bunick

Yosef-Bunick commented Jun 26, 2026

Copy link
Copy Markdown
Author

PR #16488 opens the gate for array
moved to another pull since previous one is ready to go.
this one still needs tests review and addresses a different file, similar fix.

@Yosef-Bunick Yosef-Bunick force-pushed the allow-non-hermitian-expectation-values branch from 520d5cc to 03c860a Compare June 26, 2026 04:39
@Yosef-Bunick Yosef-Bunick reopened this Jun 26, 2026
@github-project-automation github-project-automation Bot moved this from Done to unassigned in Contributor Monitoring Jun 26, 2026
@Yosef-Bunick

Yosef-Bunick commented Jun 26, 2026

Copy link
Copy Markdown
Author

PR #16488 opens the gate but PR #16443 makes the engine work. #16488 without #16443 will return silent wrong answer. moved to another pull since previous one is ready to go but accidentally created pull with both in one file.

reopened with mutually independent separation between fixes.

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

Labels

Community PR PRs from contributors that are not 'members' of the Qiskit repo

Projects

Status: unassigned

2 participants