Skip to content

Commit

Permalink
fixes to projectremoverand!
Browse files Browse the repository at this point in the history
  • Loading branch information
Krastanov committed Sep 5, 2022
1 parent 92b016d commit 21f0ebf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "2"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# News

## v0.6.1 - 2022-09-05

- **(fix)** Fix a bug in the unexported `projectremoverand!` that occurred due to the introduction of `Tableau`.

## v0.6.0 - 2022-08-22

- **(breaking)** Split the `Stabilizer` object into a `Stabilizer` that semantically represents a state, and a general `Tableau` that does not carry such an interpretation. `Stabilizer` uses `Tableau` internally. `stab.xzs` and `stab.phases` property access would now fail. Use `tab(stab)` to get the tableau object and `phases(stab)` to get the phases.
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 = "QuantumClifford"
uuid = "0525e862-1e90-11e9-3e4d-1b39d7109de1"
authors = ["Stefan Krastanov <stefan@krastanov.org>"]
version = "0.6.0"
version = "0.6.1"

[deps]
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
Expand Down
2 changes: 1 addition & 1 deletion src/project_trace_reset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ function _remove_rowcol!(s::MixedDestabilizer, r,c)
end
oldrank = rank(s)
newrank = r<=oldrank ? oldrank-1 : oldrank
MixedDestabilizer(Stabilizer((@view t.phases[1:end-2]),cols-1,(@view t.xzs[:,1:end-2])), newrank)
MixedDestabilizer(Tableau((@view t.phases[1:end-2]),cols-1,(@view t.xzs[:,1:end-2])), newrank)
end

#=
Expand Down
11 changes: 11 additions & 0 deletions test/test_projections.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using QuantumClifford: projectremoverand!

function test_projections()
@testset "Projective measurements" begin
@testset "Stabilizer representation" begin
Expand Down Expand Up @@ -323,6 +325,15 @@ function test_projections()
@test tab(apply!(copy(s),sMZ(r))).xzs == tab(sz).xzs
end
end
@testset "projectremoverand!" begin
for n in test_sizes
n > 3 || continue
state = MixedDestabilizer(random_destabilizer(n),n÷2)
state_a = projectremoverand!(copy(state),projectX!,n)[1]
state_b = traceout!(projectX!(state,n)[1],n)
@test stab_to_gf2(canonicalize!(stabilizerview(state_a))) == stab_to_gf2(canonicalize!(stabilizerview(state_b)[:,1:end-1]))
end
end
@testset "Redundant row permutations in `project!(::MixedDestabilizer)`" begin
# Fixed in 41ed1d3c
destab = T"+ ZX_Y_YXZ
Expand Down

2 comments on commit 21f0ebf

@Krastanov
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 register

Release Notes:

  • (fix) Fix a bug in the unexported projectremoverand! that occurred due to the introduction of Tableau.

@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 created: JuliaRegistries/General/67745

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.6.1 -m "<description of version>" 21f0ebf0871da11b0312007e1e4fa1be309101de
git push origin v0.6.1

Please sign in to comment.