Skip to content

Conversation

@sagnikpal2004
Copy link
Collaborator

@sagnikpal2004 sagnikpal2004 commented Aug 6, 2025

This pull request adds support for constructing a CliffordOperator directly from a PauliOperator. It also introduces corresponding tests to ensure the correctness of the new constructor.

Changelog

  • Added a constructor to CliffordOperator that creates a Clifford operator from a PauliOperator
  • Added an @inline getter for the phases field of a CliffordOperator.

Testing

  • Added a test set to verify that applying a Pauli operator via the new constructor produces the same result as applying the Pauli operator directly.

Notes

  • This consrtuctor is required to test apply_right #561, however it may not have any other practical uses, since any applications of PauliOperators can be done directly. Need advice if this should simply be left in the test file, or incorporated into the library
  • A PauliOperator constructor from a CliffordOperator is also possible, and I can create a PR for it if deemed valueable for the library.
  • The code is properly formatted and commented.
  • Substantial new functionality is documented within the docs.
  • All new functionality is tested.
  • All of the automated tests on github pass.

Dependency of #561

Copy link
Member

@Krastanov Krastanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you make the small change to the tests for legibility

could you add a mention of this to the changelog

otherwise looks good for merge

of course, only after all tests pass

@codecov
Copy link

codecov bot commented Aug 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.30%. Comparing base (ef85411) to head (85b698b).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #573      +/-   ##
==========================================
+ Coverage   84.27%   84.30%   +0.02%     
==========================================
  Files         108      108              
  Lines        6575     6581       +6     
==========================================
+ Hits         5541     5548       +7     
+ Misses       1034     1033       -1     

☔ View full report in Codecov by Sentry.
📢 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.

@sagnikpal2004 sagnikpal2004 merged commit 09f2172 into QuantumSavory:master Aug 10, 2025
26 checks passed
@Fe-r-oz
Copy link
Contributor

Fe-r-oz commented Aug 10, 2025

@sagnikpal2004, consider using squash merge for future PRs to maintain linear commit history. Currently, this PR's August 7 commit (ab41ecc) appears in the commit timeline before both August 8 merges from other PRs and its own August 10 merge (11165ae to 09f2172). Squash merging would resolve these timeline inconsistencies and provide clearer commit progression.

@sagnikpal2004
Copy link
Collaborator Author

@Fe-r-oz Thanks, I'll definitely keep that in mind next time!

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.

3 participants