diff --git a/CHANGELOG.md b/CHANGELOG.md index b2b1ba5..4978657 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Project.toml b/Project.toml index 758d68d..58d45f7 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/src/QSymbolicsBase/QSymbolicsBase.jl b/src/QSymbolicsBase/QSymbolicsBase.jl index 796cc75..b53808f 100644 --- a/src/QSymbolicsBase/QSymbolicsBase.jl +++ b/src/QSymbolicsBase/QSymbolicsBase.jl @@ -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)) ## diff --git a/test/test_sym_expressions.jl b/test/test_sym_expressions.jl index 1bbd479..6ded747 100644 --- a/test/test_sym_expressions.jl +++ b/test/test_sym_expressions.jl @@ -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)