Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining literal quantum objects with macros #51

Merged
merged 4 commits into from
Jun 21, 2024

Conversation

apkille
Copy link
Member

@apkille apkille commented Jun 21, 2024

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)

Copy link

codecov bot commented Jun 21, 2024

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 ⚠️
Additional details and impacted files
@@            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     

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

@Krastanov
Copy link
Member

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

  • unless you have a specific reason, always use "Squash and merge", not rebase or merge commit options from the github interface
  • before merge, please make an extra commit to update the CHANGELOG.
  • if you plan to immediately make a new version release update the Project.toml to 0.3.1 and use today's date in the CHANGELOG header for 0.3.1
  • if you plan to wait a bit to merge other things (personal choice, but generally not necessary to wait) update the Project.toml to 0.3.1-dev and use the string dev instead of a date in the CHANGELOG header for 0.3.1
  • if you want to make a public release, after this is merged go to the page for the very latest commit in this repository and leave a comment @JuliaRegistrator register

@JuliaRegistrator
Copy link

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

@Krastanov
Copy link
Member

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

@Krastanov
Copy link
Member

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

@apkille apkille merged commit 237d158 into QuantumSavory:main Jun 21, 2024
16 of 17 checks passed
@apkille apkille deleted the newobjs branch June 21, 2024 16:58
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