Skip to content

Consolidate state tomography implementations#8192

Draft
arettig wants to merge 3 commits into
quantumlib:mainfrom
arettig:refactor-state-tomography
Draft

Consolidate state tomography implementations#8192
arettig wants to merge 3 commits into
quantumlib:mainfrom
arettig:refactor-state-tomography

Conversation

@arettig

@arettig arettig commented Jul 14, 2026

Copy link
Copy Markdown

Closes #2737 (part 2/2, #8191 should be merged first)

Removes the specialized implementations of one and two qubit state tomography, running them instead through the n-qubit state tomography. There are several cleanup changes as a result of this:

  • TomographyResult is moved to n_qubit_tomography.py. This avoids circular dependency and is more appropriate now that this is the only tomography implementation.
  • the n-qubit tomography is generalized to use a unique measurement key name in case the state preparation circuit already uses the 'z' measurement key. This ensures the 1-qubit collisions test still passes.

arettig added 3 commits July 14, 2026 17:07
…entation

The one and two qubit specialized state tomography within
qubit_characterization.py is changed to use the n_qubit_tomography
implementation as the backend.
Use uuid to generate a unique measurement key name when running state
tomography to ensure no collisions occur with existing measurement keys
in the circuit.
Moves TomographyResult definition and plotting helper functions to n_qubit_tomography.py
to avoid circular imports.
@github-actions github-actions Bot added the size: L 250< lines changed <1000 label Jul 14, 2026
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.59%. Comparing base (daf1fa6) to head (00dcd32).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8192      +/-   ##
==========================================
- Coverage   99.60%   99.59%   -0.01%     
==========================================
  Files        1118     1118              
  Lines      101349   101307      -42     
==========================================
- Hits       100945   100896      -49     
- Misses        404      411       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

size: L 250< lines changed <1000

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate the different implementations of state tomography

1 participant