Skip to content

Commit

Permalink
Addresses #62 (#68)
Browse files Browse the repository at this point in the history
* skip metadata in propsequal

* add tests and update changelog, project.toml

* update changelog
  • Loading branch information
apkille authored Jul 12, 2024
1 parent 93ce6e9 commit c9d8eed
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# News

## v0.3.3 - dev
## v0.3.3 - 2024-07-12

- Add single qubit simplification rules.
- Added single qubit simplification rules.
- Removed evaluation of metadata equality in `Base.isequal`.

## v0.3.2 - 2024-07-02

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "QuantumSymbolics"
uuid = "efa7fd63-0460-4890-beb7-be1bbdfbaeae"
authors = ["QuantumSymbolics.jl contributors"]
version = "0.3.3-dev"
version = "0.3.3"

[deps]
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
Expand Down
2 changes: 1 addition & 1 deletion src/QSymbolicsBase/QSymbolicsBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Base.isequal(::Symbolic{Complex}, ::SymQObj) = false

# TODO check that this does not cause incredibly bad runtime performance
# use a macro to provide specializations if that is indeed the case
propsequal(x,y) = all(n->isequal(getproperty(x,n),getproperty(y,n)), propertynames(x))
propsequal(x,y) = all(n->(n==:metadata || isequal(getproperty(x,n),getproperty(y,n))), propertynames(x))


##
Expand Down
7 changes: 7 additions & 0 deletions test/test_sym_expressions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ using QuantumSymbolics
@test isequal(Z1 - Z2, Z1 + (-Z2))
@test_broken isequal(Z1 - 2*Z2 + 2*X1, -2*Z2 + Z1 + 2*X1)
@test_broken isequal(Z1 - 2*Z2 + 2*X1, Z1 + 2*(-Z2+X1))

state1 = XBasisState(1, SpinBasis(1//2))
state2 = XBasisState(1, SpinBasis(1//2))
state3 = XBasisState(2, SpinBasis(1//2))

@test isequal(state1, state2)
@test !isequal(state1, state3)

2 comments on commit c9d8eed

@apkille
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request updated: JuliaRegistries/General/110218

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.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

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:

git tag -a v0.3.3 -m "<description of version>" c9d8eedecb8509726f511e6642497e0037a29741
git push origin v0.3.3

Please sign in to comment.