-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add zero structs * set fixes * hash method * isequal and idiomatic changes * generator comp for dagger * more generators and fix * organize SAdd * doctest fix * change JET threshold to 7 * new version updates
- Loading branch information
Showing
11 changed files
with
135 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using QuantumSymbolics | ||
using Test | ||
|
||
A = SOperator(:A, SpinBasis(1//2)) | ||
k = SKet(:k, SpinBasis(1//2)) | ||
b = SBra(:b, SpinBasis(1//2)) | ||
|
||
Oop = SZeroOperator() | ||
Ok = SZeroKet() | ||
Ob = SZeroBra() | ||
|
||
@testset "zero operator tests" begin | ||
@test isequal(0*A, Oop) && isequal(A*0, Oop) | ||
@test isequal(2*Oop, Oop) && isequal(Oop*2, Oop) && isequal(Oop/2, Oop) | ||
@test isequal(Oop + A, A) && isequal(A + Oop, A) && isequal(Oop + Oop, Oop) | ||
@test isequal(Oop*A, Oop) && isequal(A*Oop, Oop) | ||
@test isequal(Oop ⊗ A, Oop) && isequal(A ⊗ Oop, Oop) && isequal(Oop*Oop, Oop) | ||
@test isequal(commutator(A, Oop), Oop) && isequal(commutator(Oop, A), Oop) && isequal(commutator(Oop, Oop), Oop) | ||
@test isequal(anticommutator(A, Oop), Oop) && isequal(anticommutator(Oop, A), Oop) && isequal(anticommutator(Oop, Oop), Oop) | ||
@test isequal(projector(Ok), Oop) | ||
@test isequal(dagger(Oop), Oop) | ||
end | ||
|
||
@testset "zero bra and ket tests" begin | ||
@test isequal(0*k, Ok) && isequal(k*0, Ok) | ||
@test isequal(2*Ok, Ok) && isequal(Ok*2, Ok) && isequal(Ok/2, Ok) | ||
@test isequal(Ok + k, k) && isequal(k + Ok, k) && isequal(Ok + Ok, Ok) | ||
@test isequal(Ok ⊗ k, Ok) && isequal(k ⊗ Ok, Ok) | ||
@test isequal(0*b, Ob) && isequal(b*0, Ob) | ||
@test isequal(2*Ob, Ob) && isequal(Ob*2, Ob) && isequal(Ob/2, Ob) | ||
@test isequal(Ob + b, b) && isequal(b + Ob, b) && isequal(Ob + Ob, Ob) | ||
@test isequal(Ob ⊗ b, Ob) && isequal(b ⊗ Ob, Ob) | ||
@test isequal(Oop*k, Ok) && isequal(A*Ok, Ok) && isequal(Oop*Ok, Ok) | ||
@test isequal(b*Oop, Ob) && isequal(Ob*A, Ob) && isequal(Ob*Oop, Ob) | ||
@test isequal(Ok*b, Oop) && isequal(k*Ob, Oop) && isequal(Ok*Ob, Oop) | ||
@test isequal(Ob*k, 0) && isequal(b*Ok, 0) && isequal(Ob*Ok, 0) | ||
end | ||
|
||
|
0f47b58
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
0f47b58
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error while trying to register: Register Failed
@apkille, it looks like you are not a publicly listed member/owner in the parent organization (QuantumSavory).
If you are a member/owner, you will need to change your membership to public. See GitHub Help
0f47b58
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
0f47b58
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/109519
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: