Skip to content

Commit

Permalink
clean up from JET tests
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Krastanov <stefan@krastanov.org>
  • Loading branch information
Krastanov committed Aug 15, 2022
1 parent 8aabf5c commit c04c01c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 15 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# News

## v0.5.8 - dev
## v0.5.8

- Implement `projectremoverand!` which besides performing a projective measurement lik `projectrand!` also removed the measured qubit from the tableau, returning a smaller tableau. Not yet exported in public API.
- Implement `projectremoverand!` which besides performing a projective measurement like `projectrand!` also removes the measured qubit from the tableau, returning a smaller tableau. Not yet exported in public API.

## v0.5.7 - 2022-07-24

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.5.8-dev"
version = "0.5.8"

[deps]
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
Expand Down
5 changes: 2 additions & 3 deletions src/QuantumClifford.jl
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ Stabilizer{Vector{UInt8}, Matrix{UInt64}}
See also: [`stabilizerview`](@ref), [`destabilizerview`](@ref), [`logicalxview`](@ref), [`logicalzview`](@ref)
"""
tab(s::Stabilizer) = s
tab(s::Stabilizer{V,T}) where {V,T} = s
tab(s::AbstractStabilizer) = s.tab

##############################
Expand Down Expand Up @@ -669,8 +669,7 @@ Base.copy(d::MixedDestabilizer) = MixedDestabilizer(copy(d.tab),d.rank)
@inline logicalzview(s::MixedDestabilizer) = @view s.tab[end÷2+s.rank+1:end]

"""The number of qubits of a given state."""
@inline nqubits(s::Stabilizer) = s.nqubits
@inline nqubits(s::AbstractStabilizer) = s.tab.nqubits
@inline nqubits(s::AbstractStabilizer) = tab(s).nqubits

##############################
# Pauli Operator Helpers
Expand Down
10 changes: 1 addition & 9 deletions src/experimental/NoisyCircuits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,7 @@ function mctrajectory!(state,circuit)
return state, continue_stat
end

function countmap(samples::Vector{CircuitStatus}) # A simpler version of StatsBase.countmap, because StatsBase is slow to import
#=
T = eltype(samples)
counts = Dict{T,Int}
for s in samples
counts[s] = get(counts, s, 0)+1
end
counts
=#
function countmap(samples::Vector{CircuitStatus}) # A simpler faster version of StatsBase.countmap
counts = zeros(length(registered_statuses))
for s in samples
counts[s.status] += 1
Expand Down
2 changes: 2 additions & 0 deletions src/project_trace_reset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -828,13 +828,15 @@ function _remove_rowcol!(s::MixedDestabilizer, r,c)
MixedDestabilizer(Stabilizer((@view t.phases[1:end-2]),cols-1,(@view t.xzs[:,1:end-2])), newrank)
end

#=
"""Unexported low-level function that projects a qubit and returns the result while making the tableau smaller by a qubit.
Because MixedDestabilizer is not mutable we return a new MixedDestabilizer with the same (modified) xzs array.
"""
function projectremove!(s::MixedDestabilizer, projfunc::F, qubit) where {F<:Union{typeof(projectX!),typeof(projectY!),typeof(projectZ!)}}
error("can not be implemented in the style of project!, because one can not change `res` after the row has been removed")
end
=#

"""Unexported low-level function that projects a qubit and returns the result while making the tableau smaller by a qubit.
Expand Down
1 change: 1 addition & 0 deletions test/test_jet.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using JET
using ArrayInterface
using Static
using Graphs

function test_jet()
@testset "JET checks" begin
Expand Down

2 comments on commit c04c01c

@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:

  • Implement projectremoverand! which besides performing a projective measurement like projectrand! also removes the measured qubit from the tableau, returning a smaller tableau. Not yet exported in public API.

@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/66293

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.5.8 -m "<description of version>" c04c01c36befd824e372158a5a3063b08ec460a4
git push origin v0.5.8

Please sign in to comment.