CQCL / guppylang

Pythonic quantum-classical programming language
Apache License 2.0
18 stars 2 forks source link

feat: Add nat type #254

Closed mark-koch closed 1 week ago

mark-koch commented 2 weeks ago

Closes #228

mark-koch commented 2 weeks ago

I don't understand what how the width of nat and int are handled.

Guppy currently assumes that ints are 64 bit across the board, so int_op automatically inserts a log width of 6.

I don't understand what is_to_u and iu_to_s are expected to do. If widths aren't changing aren't they the identity?

I guess they could be, but I'd prefer to error when trying to convert a negative int to nat, or when trying to convert a nat that is too large to fit into an int64.

codecov-commenter commented 1 week ago

Codecov Report

Attention: Patch coverage is 95.30686% with 13 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@b2901d8). Learn more about missing BASE report. Report is 1 commits behind head on main.

:exclamation: Current head 0d37aef differs from pull request most recent head b664d2c

Please upload reports for the commit b664d2c to get more accurate results.

Files Patch % Lines
guppylang/prelude/_internal.py 72.97% 10 Missing :warning:
guppylang/checker/core.py 80.00% 2 Missing :warning:
guppylang/tys/ty.py 96.96% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #254 +/- ## ======================================= Coverage ? 90.88% ======================================= Files ? 44 Lines ? 4937 Branches ? 0 ======================================= Hits ? 4487 Misses ? 450 Partials ? 0 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.