Skip to content

Conversation

@thierry-martinez
Copy link
Collaborator

This commit introduces the classes BaseCommand and BaseInstruction, and removes the unused instructions _XC and _ZC. These classes can be used for type checking. They contrast with the type aliases Command and Instruction:

  • BaseCommand and BaseInstruction are open types and the user can define new subclasses. For instance, Veriphix introduces blind preparation commands and measurements.

  • Command and Instruction are closed types that contain exactly the commands of the measurement calculus (N | M | E | C | X | Z | S | T) and the instructions supported by the transpiler.

This commit introduces the classes `BaseCommand` and
`BaseInstruction`, and removes the unused instructions `_XC` and
`_ZC`.  These classes can be used for type checking. They contrast
with the type aliases `Command` and `Instruction`:

- `BaseCommand` and `BaseInstruction` are open types and the user can
  define new subclasses. For instance, Veriphix introduces blind
  preparation commands and measurements.

- `Command` and `Instruction` are closed types that contain exactly
  the commands of the measurement calculus
  (`N | M | E | C | X | Z | S | T`)
  and the instructions supported by the transpiler.
@codecov
Copy link

codecov bot commented Dec 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.90%. Comparing base (15ff8aa) to head (a8c39c1).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #406      +/-   ##
==========================================
+ Coverage   84.87%   84.90%   +0.02%     
==========================================
  Files          46       46              
  Lines        6639     6625      -14     
==========================================
- Hits         5635     5625      -10     
+ Misses       1004     1000       -4     

☔ 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.

Copy link
Contributor

@matulni matulni left a comment

Choose a reason for hiding this comment

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

Thanks, proposal is elegant and nice! I made a small comment only, otherwise looks good.

@mgarnier59
Copy link
Contributor

Thanks! And good idea to generalize to the circuit instructions too. This might come in handy in veriphix.
LGTM.

Copy link
Contributor

@emlynsg emlynsg left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

4 participants