QuantumSavory / QuantumSymbolics.jl

Computer algebra tools for symbolic manipulations in quantum mechanics and quantum information
MIT License
29 stars 9 forks source link

Defining literal quantum objects with macros #51

Closed apkille closed 2 months ago

apkille commented 2 months ago

Enables users to quickly define symbolic bras, kets, and operators with macros. If a basis for the quantum object is not specified, then by default the spin-1/2 basis will be selected.

julia> @sket k
|k⟩

julia> @sbra b
⟨b|

julia> @sop A
A

julia> b*k
⟨b||k⟩

julia> A*k
A|k⟩

julia> QuantumSymbolics.basis(k)
Spin(1/2)

julia> @sbra b FockBasis(2)
⟨b|

julia> QuantumSymbolics.basis(b)
Fock(cutoff=2)
codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 63.37%. Comparing base (6847efb) to head (6a1f908).

Files Patch % Lines
src/QSymbolicsBase/literal_objects.jl 91.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #51 +/- ## ========================================== + Coverage 62.71% 63.37% +0.65% ========================================== Files 15 15 Lines 582 587 +5 ========================================== + Hits 365 372 +7 + Misses 217 215 -2 ```

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

Krastanov commented 2 months ago

after the JET tests pass feel free to merge. A couple of guidelines:

JuliaRegistrator commented 2 months ago

Comments on pull requests will not trigger Registrator, as it is disabled. Please try commenting on a commit or issue.

Krastanov commented 2 months ago

welp... I JuliaRegistrator was a bit too trigger happy :D I hoped it will not respond if I put its handle in backticks.

Krastanov commented 2 months ago

as mentioned on the other pull request: actually, it seems the JET tests fail on master too, because of something I must have merged last minute as I was cleaning up the tests. You can just bump the threshold to 7 and not bother with them