Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add the ability to load Pauli strings#3

Draft
BrendanKKrueger wants to merge 10 commits into
mainfrom
bkk_load_pauli_strings
Draft

Add the ability to load Pauli strings#3
BrendanKKrueger wants to merge 10 commits into
mainfrom
bkk_load_pauli_strings

Conversation

@BrendanKKrueger
Copy link
Copy Markdown
Collaborator

@BrendanKKrueger BrendanKKrueger commented Apr 13, 2026

If we're going to claim it in the paper, we should really add it. And it should be easy to quickly add at least a very basic version of this.

Reuben is working on grouping, and he may end up modifying this and/or creating a second reader that does something similar but supports grouping.

  • Add testing

@BrendanKKrueger BrendanKKrueger self-assigned this Apr 13, 2026
@BrendanKKrueger
Copy link
Copy Markdown
Collaborator Author

There are now three ways to transfer a Hamiltonian from hamgen.py to qre_driver.py: the tensors file, the Pauli strings file (dense strings), and the Pauli strings file (sparse strings). The two Pauli strings files are consistent with each other, but the tensors file is a little different. I'm not sure how big of a concern that is -- how consistent should the results be?

format Clifford T qubit
dense Pauli 9985041685 5343554322 23
sparse Pauli 9985041685 5343554322 23
tensors 9978292301 5337820622 23

@BrendanKKrueger BrendanKKrueger marked this pull request as draft April 13, 2026 15:29
@BrendanKKrueger BrendanKKrueger force-pushed the bkk_load_pauli_strings branch from 572b65a to 6ce5b80 Compare April 13, 2026 16:36
@BrendanKKrueger BrendanKKrueger force-pushed the bkk_load_pauli_strings branch from 6ce5b80 to d243d71 Compare May 15, 2026 15:41
@BrendanKKrueger
Copy link
Copy Markdown
Collaborator Author

I ran another comparison (and by "I", I mean "Claude Code"), and got the below results. I see that the Pauli strings formats still agree with each other, but the tensors format still gives a slightly smaller resource estimate.

Generated an H2 molecule Hamiltonian using hamgen.py in three different formats and ran resource analysis on each.

Results Comparison

Format Clifford Count T Count Qubit Count
Tensors (.tensors.npz) 59,071,402 30,753,652 15
Dense Pauli (.dat) 59,914,766 31,273,590 15
Sparse Pauli (.dat) 59,914,766 31,273,590 15

Key Findings

  1. Dense and Sparse Pauli formats are identical - They produce exactly the same resource estimates, as expected since they represent the same Hamiltonian just in different notations.

  2. Tensors format differs slightly - About 1.4-1.7% fewer gates, likely due to the internal fermion-to-qubit mapping process having minor numerical differences.

  3. All formats are viable - The small differences (<2%) show that all three formats work correctly and produce very similar resource estimates for the same physical system.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants